diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2021-02-12 02:04:31 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-02-12 14:38:03 +0100 |
commit | 1b8d03f3aaaeaf96844f2d07caddabf90ec1e300 (patch) | |
tree | ed66a28c451ecbafdf095e5eaf5a8cb238e3fdbe /src | |
parent | Remove version text, add toggleable debug info(with commit hash!) (diff) | |
download | re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar.gz re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar.bz2 re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar.lz re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar.xz re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.tar.zst re3-1b8d03f3aaaeaf96844f2d07caddabf90ec1e300.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/core/config.h | 4 | ||||
-rw-r--r-- | src/core/main.cpp | 8 | ||||
-rw-r--r-- | src/core/re3.cpp | 6 | ||||
-rw-r--r-- | src/extras/GitSHA1.cpp | 2 | ||||
-rw-r--r-- | src/extras/GitSHA1.cpp.in | 2 |
6 files changed, 16 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index df39c7c9..c81873fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ -set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +set(THREADS_PREFER_PTHREAD_FLAG ON) file(GLOB_RECURSE ${PROJECT}_SOURCES "*.cpp" "*.h" "*.rc") @@ -17,6 +17,9 @@ endfunction() header_directories(${PROJECT}_INCLUDES) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/extras/GitSHA1.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/extras/GitSHA1.cpp" @ONLY) +list(APPEND ${PROJECT}_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/extras/GitSHA1.cpp") + add_executable(${EXECUTABLE} WIN32 ${${PROJECT}_SOURCES} ) @@ -46,6 +49,8 @@ if(LIBRW_PLATFORM_D3D9) ) endif() +target_compile_definitions(${EXECUTABLE} PRIVATE CMAKE_BUILD) + if(${PROJECT}_AUDIO STREQUAL "OAL") find_package(OpenAL REQUIRED) target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR}) diff --git a/src/core/config.h b/src/core/config.h index 87c31a0f..c051bdbb 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -184,8 +184,8 @@ enum Config { // those infamous texts #define DRAW_GAME_VERSION_TEXT #ifdef DRAW_GAME_VERSION_TEXT - #define TOGGLEABLE_VERSION_TEXT - #define USE_OUR_VERSIONING // If you disable this then game will fetch version peds.col, as R* did while in development + // unlike R* development builds, ours has runtime switch on debug menu & .ini, and disabled as default. + #define USE_OUR_VERSIONING // If you disable this then game will fetch version from peds.col, as R* did while in development #endif //#define DRAW_MENU_VERSION_TEXT diff --git a/src/core/main.cpp b/src/core/main.cpp index 363087c0..65ae5290 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -89,8 +89,8 @@ bool gbModelViewer; #ifdef TIMEBARS bool gbShowTimebars; #endif -#ifdef TOGGLEABLE_VERSION_TEXT -bool gDrawVersionText; +#ifdef DRAW_GAME_VERSION_TEXT +bool gDrawVersionText; // Our addition, we think it was always enabled on !MASTER builds #endif volatile int32 frameCount; @@ -1096,9 +1096,7 @@ DisplayGameDebugText() #ifdef DRAW_GAME_VERSION_TEXT wchar ver[200]; -#ifdef TOGGLEABLE_VERSION_TEXT - if(gDrawVersionText) -#endif + if(gDrawVersionText) // This realtime switch is our thing { #ifdef USE_OUR_VERSIONING diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 80e89ca4..7f7f1f83 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -508,7 +508,7 @@ bool LoadINISettings() #ifdef FIX_SPRITES ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites); #endif -#ifdef TOGGLEABLE_VERSION_TEXT +#ifdef DRAW_GAME_VERSION_TEXT extern bool gDrawVersionText; ReadIniIfExists("General", "DrawVersionText", &gDrawVersionText); #endif @@ -599,7 +599,7 @@ void SaveINISettings() #ifdef FIX_SPRITES StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites); #endif -#ifdef TOGGLEABLE_VERSION_TEXT +#ifdef DRAW_GAME_VERSION_TEXT extern bool gDrawVersionText; StoreIni("General", "DrawVersionText", gDrawVersionText); #endif @@ -993,7 +993,7 @@ extern bool gbRenderWorld2; #endif -#ifdef TOGGLEABLE_VERSION_TEXT +#ifdef DRAW_GAME_VERSION_TEXT extern bool gDrawVersionText; DebugMenuAddVarBool8("Debug", "Version Text", &gDrawVersionText, nil); #endif diff --git a/src/extras/GitSHA1.cpp b/src/extras/GitSHA1.cpp deleted file mode 100644 index 3d1cd73e..00000000 --- a/src/extras/GitSHA1.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#define GIT_SHA1 "" -const char* g_GIT_SHA1 = GIT_SHA1; diff --git a/src/extras/GitSHA1.cpp.in b/src/extras/GitSHA1.cpp.in new file mode 100644 index 00000000..6168dc79 --- /dev/null +++ b/src/extras/GitSHA1.cpp.in @@ -0,0 +1,2 @@ +#define GIT_SHA1 "@GIT_SHA1@" +const char* g_GIT_SHA1 = GIT_SHA1; |