Fix HWR_ClearLightTables being called too late

extracolormaps own the OpenGL-specific light table data, so that has to be freed earlier.
This commit is contained in:
Lactozilla 2024-12-07 17:41:39 -03:00
parent baec79e01d
commit 98aed03f15
2 changed files with 3 additions and 3 deletions

View file

@ -8002,6 +8002,9 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
// Free GPU textures before freeing patches. // Free GPU textures before freeing patches.
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED))
HWR_ClearAllTextures(); HWR_ClearAllTextures();
// Delete light table textures
HWR_ClearLightTables();
#endif #endif
Patch_FreeTag(PU_PATCH_LOWPRIORITY); Patch_FreeTag(PU_PATCH_LOWPRIORITY);

View file

@ -426,9 +426,6 @@ void R_ClearColormaps(void)
{ {
// Purged by PU_LEVEL, just overwrite the pointer // Purged by PU_LEVEL, just overwrite the pointer
extra_colormaps = R_CreateDefaultColormap(true); extra_colormaps = R_CreateDefaultColormap(true);
#ifdef HWRENDER
HWR_ClearLightTables();
#endif
} }
// //