summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-11 23:49:09 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-12 19:09:23 +0100
commit2c784d979a88035176082edf986a2c02b9073338 (patch)
treec44455912d2de60f4c0381c035d44b997c525cbc /src/core
parentSync aspect ratio setting with master (diff)
downloadre3-2c784d979a88035176082edf986a2c02b9073338.tar
re3-2c784d979a88035176082edf986a2c02b9073338.tar.gz
re3-2c784d979a88035176082edf986a2c02b9073338.tar.bz2
re3-2c784d979a88035176082edf986a2c02b9073338.tar.lz
re3-2c784d979a88035176082edf986a2c02b9073338.tar.xz
re3-2c784d979a88035176082edf986a2c02b9073338.tar.zst
re3-2c784d979a88035176082edf986a2c02b9073338.zip
Diffstat (limited to '')
-rw-r--r--src/core/config.h4
-rw-r--r--src/core/main.cpp57
-rw-r--r--src/core/re3.cpp14
3 files changed, 72 insertions, 3 deletions
diff --git a/src/core/config.h b/src/core/config.h
index 4d2ad3bf..506df4c5 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -194,6 +194,10 @@ 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
+#endif
// Memory allocation and compression
// #define USE_CUSTOM_ALLOCATOR // use CMemoryHeap for allocation. use with care, not finished yet
diff --git a/src/core/main.cpp b/src/core/main.cpp
index bf0ce5fe..bb9bd296 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -75,6 +75,9 @@
#include "custompipes.h"
#include "screendroplets.h"
#include "VarConsole.h"
+#ifdef USE_OUR_VERSIONING
+#include "GitSHA1.h"
+#endif
GlobalScene Scene;
@@ -91,6 +94,9 @@ bool gbModelViewer;
#ifdef TIMEBARS
bool gbShowTimebars;
#endif
+#ifdef TOGGLEABLE_VERSION_TEXT
+bool gDrawVersionText;
+#endif
volatile int32 frameCount;
@@ -1061,13 +1067,58 @@ DisplayGameDebugText()
#ifdef DRAW_GAME_VERSION_TEXT
wchar ver[200];
-
+
+#ifdef TOGGLEABLE_VERSION_TEXT
+ if(gDrawVersionText)
+#endif
+ {
+
+#ifdef USE_OUR_VERSIONING
+ char verA[200];
+ sprintf(verA,
+#if defined _WIN32
+ "Win "
+#elif defined __linux__
+ "Linux "
+#elif defined __APPLE__
+ "Mac OS X "
+#elif defined __FreeBSD__
+ "FreeBSD "
+#else
+ "Posix-compliant "
+#endif
+#if defined __LP64__ || defined _WIN64
+ "64-bit "
+#else
+ "32-bit "
+#endif
+#if defined RW_D3D9
+ "D3D9 "
+#elif defined RWLIBS
+ "D3D8 "
+#elif defined RW_GL3
+ "OpenGL "
+#endif
+#if defined AUDIO_OAL
+ "OAL "
+#elif defined AUDIO_MSS
+ "MSS "
+#endif
+#if defined _DEBUG || defined DEBUG
+ "DEBUG "
+#endif
+ "%.8s",
+ g_GIT_SHA1);
+ AsciiToUnicode(verA, ver);
+ CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.7f));
+#else
AsciiToUnicode(version_name, ver);
+ CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f));
+#endif
CFont::SetPropOn();
CFont::SetBackgroundOff();
CFont::SetFontStyle(FONT_STANDARD);
- CFont::SetScale(SCREEN_SCALE_X(0.5f), SCREEN_SCALE_Y(0.5f));
CFont::SetCentreOff();
CFont::SetRightJustifyOff();
CFont::SetWrapx(SCREEN_WIDTH);
@@ -1076,6 +1127,8 @@ DisplayGameDebugText()
CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver);
#endif
+ }
+#endif // #ifdef DRAW_GAME_VERSION_TEXT
FrameSamples++;
#ifdef FIX_HIGH_FPS_BUGS_ON_FRONTEND
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 779a7d13..9773b880 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -457,6 +457,10 @@ bool LoadINISettings()
#ifdef FIX_SPRITES
ReadIniIfExists("Draw", "FixSprites", &CDraw::ms_bFixSprites);
#endif
+#ifdef TOGGLEABLE_VERSION_TEXT
+ extern bool gDrawVersionText;
+ ReadIniIfExists("General", "DrawVersionText", &gDrawVersionText);
+#endif
#ifdef CUSTOM_FRONTEND_OPTIONS
bool migrate = cfg.category_size("FrontendOptions") != 0;
@@ -550,6 +554,10 @@ void SaveINISettings()
#ifdef FIX_SPRITES
StoreIni("Draw", "FixSprites", CDraw::ms_bFixSprites);
#endif
+#ifdef TOGGLEABLE_VERSION_TEXT
+ extern bool gDrawVersionText;
+ StoreIni("General", "DrawVersionText", gDrawVersionText);
+#endif
#ifdef CUSTOM_FRONTEND_OPTIONS
for (int i = 0; i < MENUPAGES; i++) {
for (int j = 0; j < NUM_MENUROWS; j++) {
@@ -988,7 +996,11 @@ extern bool gbRenderWorld2;
#ifdef FIX_SPRITES
DebugMenuAddVarBool8("Draw", "Fix Sprites", &CDraw::ms_bFixSprites, nil);
#endif
-
+
+#ifdef TOGGLEABLE_VERSION_TEXT
+ extern bool gDrawVersionText;
+ DebugMenuAddVarBool8("Debug", "Version Text", &gDrawVersionText, nil);
+#endif
#ifndef FINAL
DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil);
#ifdef USE_CUSTOM_ALLOCATOR