Skip to content

Commit

Permalink
Ensure the texture garbage collector never runs during gameplay.
Browse files Browse the repository at this point in the history
  • Loading branch information
xwidghet committed Mar 16, 2017
1 parent 0d2688c commit b988947
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/RageTextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "RageDisplay.h"
#include "Foreach.h"
#include "ActorUtil.h"
#include "Screen.h"
#include "ScreenManager.h"

#include <map>

Expand Down Expand Up @@ -61,10 +63,13 @@ void RageTextureManager::Update( float fDeltaTime )
static RageTimer garbageCollector;
if (garbageCollector.PeekDeltaTime() >= 30.0f)
{
DoDelayedDelete();
garbageCollector.Touch();
}

if (SCREENMAN && SCREENMAN->GetTopScreen() &&
SCREENMAN->GetTopScreen()->GetScreenType() != gameplay)
{
DoDelayedDelete();
garbageCollector.Touch();
}
}

FOREACHM(RageTextureID, RageTexture*, m_textures_to_update, i)
{
Expand Down

0 comments on commit b988947

Please sign in to comment.