mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
Purge resource manager cache on level load
This commit is contained in:
parent
3f42df45fd
commit
433fd62de5
2 changed files with 12 additions and 1 deletions
|
@ -434,9 +434,12 @@ void PreloadCache(void)
|
|||
char tempbuf[128];
|
||||
if (gDemo.at1)
|
||||
return;
|
||||
gSysRes.PurgeCache();
|
||||
gSoundRes.PurgeCache();
|
||||
gSysRes.PrecacheSounds();
|
||||
gSoundRes.PrecacheSounds();
|
||||
if (MusicRestartsOnLoadToggle)
|
||||
sndTryPlaySpecialMusic(MUS_LOADING);
|
||||
gSoundRes.PrecacheSounds();
|
||||
PreloadTiles();
|
||||
ClockTicks clock = totalclock;
|
||||
int cnt = 0;
|
||||
|
|
|
@ -776,6 +776,14 @@ void Resource::PurgeCache(void)
|
|||
for (CACHENODE *node = purgeHead.next; node != &purgeHead; node = node->next)
|
||||
{
|
||||
DICTNODE *pDict = (DICTNODE*)node;
|
||||
if (!(pDict->flags & DICT_LOAD))
|
||||
{
|
||||
dassert(pDict->lockCount == 0);
|
||||
dassert(pDict->ptr != NULL);
|
||||
Free(pDict->ptr);
|
||||
pDict->ptr = NULL;
|
||||
RemoveMRU(pDict);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue