From 8a101a8009701784f11d7e0bf39ad63d2d0ad4ca Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 26 Mar 2004 10:17:22 +0000 Subject: [PATCH] don't cache foregrounds in memory --- stepmania/src/Foreground.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stepmania/src/Foreground.cpp b/stepmania/src/Foreground.cpp index ce9cd69429..958025f851 100644 --- a/stepmania/src/Foreground.cpp +++ b/stepmania/src/Foreground.cpp @@ -4,6 +4,7 @@ #include "RageUtil.h" #include "IniFile.h" #include "GameState.h" +#include "RageTextureManager.h" Foreground::~Foreground() { @@ -22,6 +23,10 @@ void Foreground::Unload() void Foreground::LoadFromSong( const Song *pSong ) { + /* Song graphics can get very big; never keep them in memory. */ + RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy(); + TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE ); + m_pSong = pSong; for( unsigned i=0; im_ForegroundChanges.size(); i++ ) { @@ -47,6 +52,8 @@ void Foreground::LoadFromSong( const Song *pSong ) m_BGAnimations.push_back( bga ); } + TEXTUREMAN->SetDefaultTexturePolicy( OldPolicy ); + this->SortByZ(); }