reset palette cvars when toggling paletterendering

everything gets wiped anyways, so this would be just confusing
This commit is contained in:
Alug committed 2025-04-22 22:11:02 +02:00
1 parent 8edec89a36
commit db9435f810
5 files changed
+26 -6

No files matched your search

+2
View File
@@ -5721,6 +5721,8 @@ void HWR_LoadLevel(void)
// shader recompilation is done in the cvar callback
static void HWR_TogglePaletteRendering(void)
{
V_ResetPaletteCVars(); // dont carry over changed palettes
// which state should we go to?
if (HWR_ShouldUsePaletteRendering())
{
+3
View File
@@ -3018,7 +3018,10 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
// Reset the palette now all fades have been done
if (rendermode != render_none)
{
//V_ResetPaletteCVars(); // dont carry over changed palettes
V_SetPaletteLump(GetPalette()); // Set the level palette
}
// Print "SPEEDING OFF TO [ZONE] [ACT 1]..."
/*if (rendermode != render_none)
+4 -4
View File
@@ -134,7 +134,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
if (!first_init)
{
if (!gllogstream)
if (!gllogstream)
{
gllogdir = D_Home();
@@ -147,7 +147,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
gllogstream = fopen("./ogllog.txt", "wt");
#endif
}
gl_version = pglGetString(GL_VERSION);
gl_renderer = pglGetString(GL_RENDERER);
gl_extensions = pglGetString(GL_EXTENSIONS);
@@ -220,7 +220,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
}
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
// The screen textures need to be flushed if the width or height change so that they be remade for the correct size
if (screen_width != w || screen_height != h)
{
@@ -310,7 +310,7 @@ void OglSdlFinishUpdate(boolean waitvbl)
#if defined (__unix__)
#ifdef USE_FBO_OGL
if (loaded_config == true)
if (loaded_config)
xwaylandcrap = false;
#endif
#endif
+15 -2
View File
@@ -139,7 +139,7 @@ static boolean InitCube(void)
float globalgammamul, globalgammaoffs;
boolean doinggamma;
if (loaded_config == false)
if (!loaded_config)
return false;
#define diffcons(cv) (strcmp(cv.string, cv.defaultvalue))
@@ -586,7 +586,7 @@ void V_SetPaletteLump(const char *pal)
static void CV_palette_OnChange(void)
{
if (loaded_config == false)
if (!loaded_config)
return;
// reload palette
// recalculate Color Cube
@@ -594,6 +594,19 @@ static void CV_palette_OnChange(void)
V_SetPalette(0);
}
void V_ResetPaletteCVars(void)
{
if (!loaded_config)
return;
#define diffcons(cv) (strcmp(cv.string, cv.defaultvalue))
if diffcons(cv_palette)
CV_StealthSetValue(&cv_palette, atoi(cv_palette.defaultvalue));
if diffcons(cv_palettenum)
CV_StealthSetValue(&cv_palettenum, atoi(cv_palettenum.defaultvalue));
#undef diffcons
}
static void CV_constextsize_OnChange(void)
{
con_recalc = true;
+2
View File
@@ -60,6 +60,8 @@ void V_SetPalette(INT32 palettenum);
void V_SetPaletteLump(const char *pal);
void V_ResetPaletteCVars(void);
const char *R_GetPalname(UINT16 num);
const char *GetPalette(void);