dont reload palette until config was loaded

This commit is contained in:
Alug committed 2024-08-03 17:40:34 +02:00
1 parent 64ef0465d5
commit cd72bce3cb
3 files changed
+12

No files matched your search

+4
View File
@@ -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,
+2
View File
@@ -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?
+6
View File
@@ -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);