Load palette before map data

This commit is contained in:
Alug committed 2024-09-22 16:25:16 +02:00
1 parent 91f8705844
commit ed24674b0c
3 files changed
+10 -5

No files matched your search

+4
View File
@@ -1682,6 +1682,10 @@ void D_SRB2Main(void)
#undef PUSHSPEEDO
memcpy(speedo_cons_t, speedo_cons_temp, sizeof(speedo_cons_t));
// Do it before P_InitMapData because PNG patch
// conversion sometimes needs the palette
V_ReloadPalette();
//
// search for maps
//
+3 -5
View File
@@ -528,7 +528,7 @@ const char *GetPalette(void)
return "PLAYPAL";
}
static void LoadMapPalette(void)
void V_ReloadPalette(void)
{
LoadPalette(GetPalette());
}
@@ -540,7 +540,7 @@ static void LoadMapPalette(void)
void V_SetPalette(INT32 palettenum)
{
if (!pLocalPalette)
LoadMapPalette();
V_ReloadPalette();
#ifdef HWRENDER
if (rendermode == render_opengl)
@@ -575,7 +575,7 @@ static void CV_palette_OnChange(void)
if (loaded_config == false)
return;
// reload palette
LoadMapPalette();
V_ReloadPalette();
V_SetPalette(0);
}
@@ -3377,8 +3377,6 @@ void V_Init(void)
UINT8 *base = vid.buffer;
const INT32 screensize = vid.rowbytes * vid.height;
LoadMapPalette();
for (i = 0; i < NUMSCREENS; i++)
screens[i] = NULL;
+3
View File
@@ -49,6 +49,9 @@ extern UINT8 colorlookup[CLUTSIZE][CLUTSIZE][CLUTSIZE];
void InitColorLUT(void);
// Loads the correct palette into memory
void V_ReloadPalette(void);
// Set the current RGB palette lookup to use for palettized graphics
void V_SetPalette(INT32 palettenum);