port: purge texcache when gunmem is released as well

This commit is contained in:
fgsfds committed 2023-08-16 00:19:53 +02:00
1 parent bed505fd91
commit b1247b5eac
1 file changed
+8
+8
View File
@@ -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)