From b1247b5eace64de0be99e96250790545417d8bea Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 16 Aug 2023 00:19:53 +0200 Subject: [PATCH] port: purge texcache when gunmem is released as well --- src/game/bondgun.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 4c8f313af..04e828d79 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -53,6 +53,9 @@ #include "lib/lib_317f0.h" #include "data.h" #include "types.h" +#ifndef PLATFORM_N64 +#include "video.h" +#endif #define GUNLOADSTATE_FLUX 0 #define GUNLOADSTATE_MODEL 1 @@ -3640,6 +3643,11 @@ u32 bgunCalculateGunMemCapacity(void) void bgunFreeGunMem(void) { g_Vars.currentplayer->gunctrl.gunmemowner = GUNMEMOWNER_FREE; +#ifndef PLATFORM_N64 + // gunmem is stale and so are the textures in it + // TODO: figure out how to purge only those textures + videoResetTextureCache(); +#endif } void bgunSetGunMemWeapon(s32 weaponnum)