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 07:45:05 +02:00
1 parent ef7935e2af
commit a107496f76
2 files changed
+11 -12

No files matched your search

+7 -2
View File
@@ -1435,7 +1435,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]);
@@ -1476,7 +1476,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]);
@@ -3039,6 +3039,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
@@ -1360,11 +1359,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)
@@ -1545,13 +1539,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
@@ -1631,7 +1625,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
}
}
}
return (INT32)mapnum;
}