From 98aed03f15b8e2012011a130626adc466f5d8af0 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sat, 7 Dec 2024 17:41:39 -0300 Subject: [PATCH] Fix HWR_ClearLightTables being called too late extracolormaps own the OpenGL-specific light table data, so that has to be freed earlier. --- src/p_setup.c | 3 +++ src/r_data.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 8f0d13190..906195c18 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8002,6 +8002,9 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) // Free GPU textures before freeing patches. if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) HWR_ClearAllTextures(); + + // Delete light table textures + HWR_ClearLightTables(); #endif Patch_FreeTag(PU_PATCH_LOWPRIORITY); diff --git a/src/r_data.c b/src/r_data.c index 244690ebe..32faa07a8 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -426,9 +426,6 @@ void R_ClearColormaps(void) { // Purged by PU_LEVEL, just overwrite the pointer extra_colormaps = R_CreateDefaultColormap(true); -#ifdef HWRENDER - HWR_ClearLightTables(); -#endif } //