From 4ee48194c4ed20bf44e37cfeb3e515c1dcf94e9f Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 18 Nov 2018 14:43:31 +0000 Subject: [PATCH] Fix the Memory Leak The Kart Minimap heads I believe should use GTC_CACHE as they're shown in level, only(?) Not using it causes the memory to keep creeping up as more colourmaps are loaded but not freed, while OpenGL by extention endlessly keeps making new textures for the "new" colourmaps. --- src/k_kart.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index df88b437..e6b2da17 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4155,7 +4155,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_yougotem]) player->kartstuff[k_yougotem]--; - + if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer])) { if (player->exiting) @@ -4519,7 +4519,7 @@ static void K_KartDrift(player_t *player, boolean onground) || (player->kartstuff[k_driftcharge] < dstwo && player->kartstuff[k_driftcharge]+driftadditive >= dstwo) || (player->kartstuff[k_driftcharge] < dsthree && player->kartstuff[k_driftcharge]+driftadditive >= dsthree))) { - //S_StartSound(player->mo, sfx_s3ka2); + //S_StartSound(player->mo, sfx_s3ka2); S_StartSoundAtVolume(player->mo, sfx_s3ka2, 192); // Ugh... } @@ -6553,11 +6553,11 @@ static boolean K_drawKartPositionFaces(void) if (numplayersingame <= 1) return true; - + #ifdef HAVE_BLUA if (!LUA_HudEnabled(hud_minirankings)) return false; // Don't proceed but still return true for free play above if HUD is disabled. -#endif +#endif for (j = 0; j < numplayersingame; j++) { @@ -7053,9 +7053,9 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat { UINT8 *colormap; if (mo->colorized) - colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, 0); + colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, GTC_CACHE); else - colormap = R_GetTranslationColormap(skin, mo->color, 0); + colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE); V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap); } }