free ogl lighttables earlier

ogl lighttable data is owned by extracolormaps apparently, so it has to be freed ealier
This commit is contained in:
Alug committed 2025-04-07 08:40:16 +02:00
1 parent f159b18e96
commit 4b8d072153
2 files changed
+11 -12

No files matched your search

+7 -2
View File
@@ -1444,7 +1444,7 @@ static void P_LoadRawSideDefs2(void *data)
// encore mode colormaps!
// do it like software by aproximating a color to a palette index, and then convert it to its encore variant and then back to a color code.
// do this for both the start and fade colormaps.
color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
@@ -1485,7 +1485,7 @@ static void P_LoadRawSideDefs2(void *data)
col = msd->bottomtexture;
// do the exact same thing as above here.
color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
@@ -3047,6 +3047,11 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
// Clear pointers that would be left dangling by the purge
R_FlushTranslationColormapCache();
#ifdef HWRENDER
// Delete light table textures
HWR_ClearLightTables();
#endif
Z_FreeTags(PU_LEVEL, PU_PURGELEVEL - 1);
#if defined (WALLSPLATS) || defined (FLOORSPLATS)
+4 -10
View File
@@ -28,7 +28,6 @@
#ifdef HWRENDER
#include "hardware/hw_main.h"
#include "hardware/hw_glob.h" // HWR_ClearLightTables
#endif
#ifdef _WIN32
@@ -1266,11 +1265,6 @@ void R_ClearColormaps(void)
foundcolormaps[i] = LUMPERROR;
memset(extra_colormaps, 0, sizeof (extra_colormaps));
#ifdef HWRENDER
if (rendermode == render_opengl)
HWR_ClearLightTables();
#endif
}
/*INT32 R_ColormapNumForName(char *name)
@@ -1451,13 +1445,13 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
extra_colormaps[mapnum].fadestart = (UINT16)fadestart;
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
extra_colormaps[mapnum].fog = fog;
if (rendermode != render_none)
{
{
double r, g, b, cbrightness;
int p;
lighttable_t *colormap_p;
// Initialise the map and delta arrays
// map[i] stores an RGB color (as double) for index i,
// which is then converted to SRB2's palette later
@@ -1537,7 +1531,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
}
}
}
return (INT32)mapnum;
}