From e369d1a090cb0116a115cc4f3e2e0a30c7c85b9c Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jul 2024 18:13:28 +0200 Subject: [PATCH] dont reload palette until config was loaded --- src/d_main.cpp | 4 ++++ src/d_main.h | 2 ++ src/v_video.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 5d00a3442..0a2a5be89 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -181,6 +181,8 @@ INT32 eventhead, eventtail; boolean dedicated = false; +boolean loaded_config = false; + // // D_PostEvent // Called by the I/O functions when input is detected @@ -1793,6 +1795,8 @@ void D_SRB2Main(void) savedata.lives = 0; // flag this as not-used + loaded_config = true; // so pallettechange doesent get called 500 times at startup lol + CON_SetLoadingProgress(LOADED_CONFIG); CONS_Printf("R_InitTextureData()...\n"); diff --git a/src/d_main.h b/src/d_main.h index dad45f4ea..40b9471cd 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -55,6 +55,8 @@ typedef enum extern boolean gameconfig_loaded; extern tic_t rendergametic; +extern boolean loaded_config; + extern char srb2home[256]; //Alam: My Home extern boolean usehome; //Alam: which path? extern const char *pandf; //Alam: how to path? diff --git a/src/v_video.c b/src/v_video.c index 56f7e30bb..d9fed902d 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -15,6 +15,7 @@ #include "doomdef.h" #include "doomtype.h" +#include "d_main.h" #include "r_local.h" #include "p_local.h" // stplyr #include "g_game.h" // players @@ -135,7 +136,7 @@ static boolean InitCube(void) float globalgammamul, globalgammaoffs; boolean doinggamma; - if (con_startup_loadprogress < LOADED_CONFIG) + if (loaded_config == false) return false; #define diffcons(cv) (cv.value != atoi(cv.defaultvalue)) @@ -491,6 +492,8 @@ void V_SetPaletteLump(const char *pal) static void CV_palette_OnChange(void) { + if (loaded_config == false) + return; // recalculate Color Cube V_ReloadPalette(); V_SetPalette(0);