mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-08-20 09:57:09 +00:00
commit
edf4f5dc51
16
.gitignore
vendored
16
.gitignore
vendored
|
|
@ -28,6 +28,17 @@ ipch/
|
||||||
*.ilk
|
*.ilk
|
||||||
*.exp
|
*.exp
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# CLion files
|
||||||
|
# ===========================================
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# ===========================================
|
||||||
|
# CMake
|
||||||
|
# ===========================================
|
||||||
|
cmake-build-debug
|
||||||
|
cmake-build-release
|
||||||
|
|
||||||
# ===========================================
|
# ===========================================
|
||||||
# Archives & packaged binaries
|
# Archives & packaged binaries
|
||||||
# ===========================================
|
# ===========================================
|
||||||
|
|
@ -43,7 +54,8 @@ Minecraft.Client/music/
|
||||||
*.binka
|
*.binka
|
||||||
|
|
||||||
# Common Media - UI (SWF), Graphics (PNG), Sound (WAV), Fonts
|
# Common Media - UI (SWF), Graphics (PNG), Sound (WAV), Fonts
|
||||||
Minecraft.Client/Common/Media/
|
Assets
|
||||||
|
Assets/Common/Media/
|
||||||
# Game resource textures, art, audio, etc.
|
# Game resource textures, art, audio, etc.
|
||||||
Minecraft.Client/Common/res/
|
Minecraft.Client/Common/res/
|
||||||
Minecraft.Client/Common/DummyTexturePack/
|
Minecraft.Client/Common/DummyTexturePack/
|
||||||
|
|
@ -71,7 +83,7 @@ Minecraft.Client/Windows64/GameHDD/
|
||||||
# Thumbnail / test images
|
# Thumbnail / test images
|
||||||
*.png
|
*.png
|
||||||
# But allow source code PNG references to be noted
|
# But allow source code PNG references to be noted
|
||||||
!Minecraft.Client/Common/Media/Graphics/.gitkeep
|
!Assets/Common/Media/Graphics/.gitkeep
|
||||||
|
|
||||||
# SWF UI files (Flash-based UI assets)
|
# SWF UI files (Flash-based UI assets)
|
||||||
*.swf
|
*.swf
|
||||||
|
|
|
||||||
71
CMakeLists.txt
Normal file
71
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project("LCEMP")
|
||||||
|
|
||||||
|
set(LCEMP_WORKING_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Assets" CACHE STRING "The working directory for MinecraftClient")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
message(FATAL_ERROR "Windows is currently the only supported OS")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Fix linking errors with other libs compiled with an older CRT
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Sources.cmake")
|
||||||
|
|
||||||
|
list(TRANSFORM MINECRAFT_WORLD_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/")
|
||||||
|
list(TRANSFORM MINECRAFT_CLIENT_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/")
|
||||||
|
|
||||||
|
add_library(MinecraftWorld STATIC ${MINECRAFT_WORLD_SOURCES})
|
||||||
|
add_executable(MinecraftClient WIN32 ${MINECRAFT_CLIENT_SOURCES})
|
||||||
|
|
||||||
|
set_property(TARGET MinecraftClient PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${LCEMP_WORKING_DIR}")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
# /MT and /MTd options set the CRT version to multi-threaded static mode
|
||||||
|
# which is what the 4J libs were compiled with
|
||||||
|
target_compile_options(MinecraftWorld PRIVATE /W3 /MP $<$<CONFIG:Debug>:/MTd> $<$<NOT:$<CONFIG:Debug>>:/MT> /EHsc)
|
||||||
|
target_compile_options(MinecraftClient PRIVATE /W3 /MP $<$<CONFIG:Debug>:/MTd> $<$<NOT:$<CONFIG:Debug>>:/MT> /EHsc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_compile_definitions(MinecraftWorld PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||||
|
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(MinecraftClient PRIVATE
|
||||||
|
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||||
|
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(MinecraftWorld PUBLIC
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(MinecraftClient PRIVATE
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/include"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/Sentient/Include"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(MinecraftClient PRIVATE
|
||||||
|
MinecraftWorld
|
||||||
|
d3d11
|
||||||
|
XInput9_1_0
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Miles/lib/mss64.lib"
|
||||||
|
$<$<CONFIG:Debug>:
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_d.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC_d.lib"
|
||||||
|
>
|
||||||
|
$<$<NOT:$<CONFIG:Debug>>:
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_r.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_r.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_r.lib"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC.lib"
|
||||||
|
>
|
||||||
|
)
|
||||||
|
|
@ -730,6 +730,8 @@ app.DebugPrintf("width: %d, height: %d\n", width, height);
|
||||||
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
|
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||||
descDSView.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
|
descDSView.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
|
||||||
descDSView.Texture2D.MipSlice = 0;
|
descDSView.Texture2D.MipSlice = 0;
|
||||||
|
// when would this ever be a non-garbage value?
|
||||||
|
descDSView.Flags = 0;
|
||||||
|
|
||||||
hr = g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, &descDSView, &g_pDepthStencilView);
|
hr = g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, &descDSView, &g_pDepthStencilView);
|
||||||
|
|
||||||
|
|
|
||||||
28
Minecraft.Client/crt_compat.cpp
Normal file
28
Minecraft.Client/crt_compat.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
// CRT compatibility shim for linking VS2012-era libraries with VS2022
|
||||||
|
// Provides symbols removed in the Universal CRT (VS2015+)
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
// __iob_func was removed in VS2015. Old code (e.g. libpng) references it.
|
||||||
|
// Provide a shim that returns the stdio file pointers.
|
||||||
|
extern "C" FILE* __iob_func(void)
|
||||||
|
{
|
||||||
|
// The old __iob_func returned an array of {stdin, stdout, stderr}.
|
||||||
|
// In the Universal CRT, these are functions, not a contiguous array.
|
||||||
|
// We return a static array mimicking the old layout.
|
||||||
|
static FILE iob[3];
|
||||||
|
iob[0] = *stdin;
|
||||||
|
iob[1] = *stdout;
|
||||||
|
iob[2] = *stderr;
|
||||||
|
return iob;
|
||||||
|
}
|
||||||
|
|
||||||
|
// std::_Winerror_map was an internal MSVC runtime function used by
|
||||||
|
// std::system_category::message(). Old .lib files compiled with VS2012
|
||||||
|
// may reference it. Provide a minimal stub.
|
||||||
|
namespace std {
|
||||||
|
const char* _Winerror_map(int) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <xhash>
|
#include <xhash>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include "Hasher.h"
|
#include "Hasher.h"
|
||||||
|
|
||||||
|
|
@ -19,7 +20,7 @@ wstring Hasher::getHash(wstring &name)
|
||||||
//return new BigInteger(1, m.digest()).toString(16);
|
//return new BigInteger(1, m.digest()).toString(16);
|
||||||
|
|
||||||
// TODO 4J Stu - Will this hash us with the same distribution as the MD5?
|
// TODO 4J Stu - Will this hash us with the same distribution as the MD5?
|
||||||
return _toString( hash_value( s ) );
|
return _toString( std::hash<wstring>{}( s ) );
|
||||||
//}
|
//}
|
||||||
//catch (NoSuchAlgorithmException e)
|
//catch (NoSuchAlgorithmException e)
|
||||||
//{
|
//{
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@
|
||||||
#include "I18n.h"
|
#include "I18n.h"
|
||||||
|
|
||||||
Language *I18n::lang = Language::getInstance();
|
Language *I18n::lang = Language::getInstance();
|
||||||
wstring I18n::get(const wstring& id, ...)
|
wstring I18n::get(const wstring& id, ...) {
|
||||||
{
|
|
||||||
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
|
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
|
||||||
return L"";
|
return L"";
|
||||||
|
#elif _MSC_VER >= 1930 // VS2022+ also disallows va_start with reference types
|
||||||
|
return id;
|
||||||
#else
|
#else
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, id);
|
va_start(va, id);
|
||||||
return I18n::get(id, va);
|
return I18n::get(id, va);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ wstring Language::getElement(const wstring& elementId, ...)
|
||||||
{
|
{
|
||||||
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
|
#ifdef __PSVITA__ // 4J - vita doesn't like having a reference type as the last parameter passed to va_start - we shouldn't need this method anyway
|
||||||
return L"";
|
return L"";
|
||||||
|
#elif _MSC_VER >= 1930 // VS2022+ also disallows va_start with reference types
|
||||||
|
return elementId;
|
||||||
#else
|
#else
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, elementId);
|
va_start(args, elementId);
|
||||||
|
|
|
||||||
|
|
@ -2561,7 +2561,7 @@ int Player::hash_fnct(const shared_ptr<Player> k)
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
return (int)boost::hash_value( k->name ); // 4J Stu - Names are completely unique?
|
return (int)boost::hash_value( k->name ); // 4J Stu - Names are completely unique?
|
||||||
#else
|
#else
|
||||||
return (int)std::hash_value( k->name ); // 4J Stu - Names are completely unique?
|
return (int)std::hash<wstring>{}( k->name ); // 4J Stu - Names are completely unique?
|
||||||
#endif //__PS3__
|
#endif //__PS3__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1162
cmake/Sources.cmake
Normal file
1162
cmake/Sources.cmake
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue