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(); }