From e95516032f4e44ea35b7358f60c464c0faa1df91 Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 29 Oct 2020 19:01:09 +0100 Subject: [PATCH 1/3] fix FINAL build, add DEBUGMENU and other simple qol defines to FINAL, add extra defines for menu and game version text --- src/core/Frontend.cpp | 2 ++ src/core/config.h | 24 ++++++++++++++++++++---- src/core/main.cpp | 3 +++ src/rw/RwHelper.cpp | 6 ++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 89b5ba3d..5c65aed5 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -789,9 +789,11 @@ CMenuManager::Draw() CFont::SetScale(MENU_X(0.7f), MENU_Y(0.5f)); CFont::SetWrapx(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)); CFont::SetRightJustifyWrap(0.0f); +#ifdef DRAW_MENU_VERSION_TEXT strcpy(gString, "V1.1"); AsciiToUnicode(gString, gUString); CFont::PrintString(SCREEN_WIDTH / 10, SCREEN_HEIGHT / 45, gUString); +#endif #endif CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_X_MARGIN)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENUACTION_WIDTH)); diff --git a/src/core/config.h b/src/core/config.h index 171c6be9..92c0511f 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -156,6 +156,25 @@ enum Config { // any debug stuff that is only left in mobile, is not in MASTER //#define MASTER +// once and for all: +// pc: FINAL & MASTER +// mobile: FINAL + +// MASTER builds must be FINAL +#ifdef MASTER +#define FINAL +#endif + +// quality of life fixes that should also be in FINAL +#define NASTY_GAME // nasty game for all languages +#define NO_MOVIES // disable intro videos +#define NO_CDCHECK +#define DEBUGMENU + +// those infamous texts +#define DRAW_GAME_VERSION_TEXT +#define DRAW_MENU_VERSION_TEXT + #if defined GTA_PS2 # define GTA_PS2_STUFF # define RANDOMSPLASH @@ -177,6 +196,7 @@ enum Config { #ifdef MASTER // only in master builds + #undef DRAW_GAME_VERSION_TEXT #else // not in master builds #define VALIDATE_SAVE_SIZE @@ -187,11 +207,7 @@ enum Config { # define USE_MY_DOCUMENTS // use my documents directory for user files #else // not in any game -# define NASTY_GAME // nasty game for all languages -# define NO_MOVIES // disable intro videos -# define NO_CDCHECK # define CHATTYSPLASH // print what the game is loading -# define DEBUGMENU # define TIMEBARS // print debug timers #endif diff --git a/src/core/main.cpp b/src/core/main.cpp index 18ee2dc5..1aa0a953 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -768,6 +768,8 @@ DisplayGameDebugText() char str[200]; wchar ustr[200]; + +#ifdef DRAW_GAME_VERSION_TEXT wchar ver[200]; AsciiToUnicode(version_name, ver); @@ -783,6 +785,7 @@ DisplayGameDebugText() CFont::SetBackGroundOnlyTextOff(); CFont::SetColor(CRGBA(255, 108, 0, 255)); CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver); +#endif FrameSamples++; FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f); diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 4b598e9b..dbadae6a 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -6,8 +6,10 @@ #include "Timecycle.h" #include "skeleton.h" #include "Debug.h" -#ifndef FINAL +#if !defined(FINAL) || defined(DEBUGMENU) #include "rtcharse.h" +#endif +#ifndef FINAL RtCharset *debugCharset; #endif @@ -17,7 +19,7 @@ bool gPS2alphaTest = true; bool gPS2alphaTest = false; #endif -#ifndef FINAL +#if !defined(FINAL) || defined(DEBUGMENU) static bool charsetOpen; void OpenCharsetSafe() { From 57b01ac4769b0ac83150f2284f5bad87f2f166a3 Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 29 Oct 2020 19:23:59 +0100 Subject: [PATCH 2/3] NO_MOVIES and DEBUGMENU not for MASTER --- src/core/config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/config.h b/src/core/config.h index 92c0511f..019ff659 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -167,9 +167,7 @@ enum Config { // quality of life fixes that should also be in FINAL #define NASTY_GAME // nasty game for all languages -#define NO_MOVIES // disable intro videos #define NO_CDCHECK -#define DEBUGMENU // those infamous texts #define DRAW_GAME_VERSION_TEXT @@ -200,6 +198,9 @@ enum Config { #else // not in master builds #define VALIDATE_SAVE_SIZE + + #define NO_MOVIES // disable intro videos + #define DEBUGMENU #endif #ifdef FINAL From d34d591ed36557d88d2d0485965e7f7337ed25de Mon Sep 17 00:00:00 2001 From: withmorten Date: Thu, 29 Oct 2020 19:53:23 +0100 Subject: [PATCH 3/3] fix draw menu version text ifdef location --- src/core/Frontend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 5c65aed5..dca9685e 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -783,13 +783,13 @@ CMenuManager::Draw() CFont::SetJustifyOn(); CFont::SetBackGroundOnlyTextOn(); #ifdef GTA3_1_1_PATCH +#ifdef DRAW_MENU_VERSION_TEXT CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); CFont::SetRightJustifyOn(); CFont::SetFontStyle(FONT_HEADING); CFont::SetScale(MENU_X(0.7f), MENU_Y(0.5f)); CFont::SetWrapx(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)); CFont::SetRightJustifyWrap(0.0f); -#ifdef DRAW_MENU_VERSION_TEXT strcpy(gString, "V1.1"); AsciiToUnicode(gString, gUString); CFont::PrintString(SCREEN_WIDTH / 10, SCREEN_HEIGHT / 45, gUString);