From 489a58f9fd65ff66dee0abd2321526d7948e256a Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 3 Mar 2026 03:24:08 +0300 Subject: [PATCH] Allocate all colormaps with PU_STATIC --- src/p_setup.c | 3 ++- src/r_draw.cpp | 7 ++++++- src/r_skins.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 0d432e747..afc53234b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2586,7 +2586,8 @@ void P_FreeLevelState(void) } // Clear pointers that would be left dangling by the purge - R_FlushTranslationColormapCache(); + // Pointers are now PU_STATIC so they won't be freed :) + //R_FlushTranslationColormapCache(); #ifdef HWRENDER // Free GPU textures before freeing patches. diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 2e7c47e87..474496108 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -419,7 +419,7 @@ static UINT8* RGetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 f // Generate the colormap if necessary if (!ret) { - ret = static_cast(Z_Malloc(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL)); + ret = static_cast(Z_Malloc(NUM_PALETTE_ENTRIES, PU_STATIC, NULL)); K_GenerateKartColormap(ret, skinnum, color, local); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart // Cache the colormap if desired @@ -487,6 +487,10 @@ patch_t* R_GetSkinFaceMini(player_t* ply) \return void */ + +/* There seems to be no reason to free cached colormaps tho? Not like they can change :ChonkBunckle: */ + +/* void R_FlushTranslationColormapCache(void) { INT32 i; @@ -499,6 +503,7 @@ void R_FlushTranslationColormapCache(void) if (localtranslationtablecache[i]) memset(localtranslationtablecache[i], 0, MAXTRANSLATIONS * sizeof(UINT8**)); } +*/ // ========================================================================== // COMMON DRAWER FOR 8 AND 16 BIT COLOR MODES diff --git a/src/r_skins.c b/src/r_skins.c index 41971788c..9ab6e0fbf 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -774,7 +774,7 @@ void R_AddSkins(UINT16 wadnum, boolean local) // So just let the function in the while loop take care of it for us. } - R_FlushTranslationColormapCache(); + //R_FlushTranslationColormapCache(); CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name); #ifdef SKINVALUES