diff --git a/src/d_main.c b/src/d_main.c index 1c7fc63e1..3b6573e5c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -150,6 +150,8 @@ INT32 eventhead, eventtail; boolean dedicated = false; +boolean loaded_config = false; + // // D_PostEvent // Called by the I/O functions when input is detected @@ -1753,6 +1755,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 + //------------------------------------------------ COMMAND LINE PARAMS // this must be done after loading gamedata, diff --git a/src/d_main.h b/src/d_main.h index d4d3e6e95..851eaa8b5 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -20,6 +20,8 @@ // make sure not to write back the config until it's been correctly 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 4c5e1cfd3..202b5d288 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -14,6 +14,7 @@ /// Functions to blit a block to the screen. #include "doomdef.h" +#include "d_main.h" #include "r_local.h" #include "p_local.h" #include "v_video.h" @@ -132,6 +133,9 @@ static boolean InitCube(void) float globalgammamul, globalgammaoffs; boolean doinggamma; + if (loaded_config == false) + return false; + #define diffcons(cv) (cv.value != atoi(cv.defaultvalue)) doinggamma = diffcons(cv_globalgamma); @@ -568,6 +572,8 @@ void V_SetPaletteLump(const char *pal) static void CV_palette_OnChange(void) { + if (loaded_config == false) + return; // reload palette LoadMapPalette(); V_SetPalette(0);