From a21c951ebf11e8a3184a372eae1f0a7cb19423c2 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 6a57ade6f..0a1fcb483 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8905,6 +8905,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 G_FreeGhosts(); // ghosts are allocated with PU_LEVEL diff --git a/src/r_data.c b/src/r_data.c index 247cea619..8fc6ed333 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -374,9 +374,6 @@ void R_ClearColormaps(void) { // Purged by PU_LEVEL, just overwrite the pointer extra_colormaps = R_CreateDefaultColormap(true); -#ifdef HWRENDER - HWR_ClearLightTables(); -#endif } //