fix background caching

This commit is contained in:
Glenn Maynard
2005-04-23 06:19:36 +00:00
parent 81adc42e5a
commit a8803f9777
+5 -1
View File
@@ -729,6 +729,7 @@ void ScreenSelectMusic::CheckBackgroundRequests()
return; return;
CString sPath; CString sPath;
bool bFreeCache = false;
if( TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) ) if( TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) )
{ {
/* If the file is already loaded into a texture, it's finished, /* If the file is already loaded into a texture, it's finished,
@@ -739,11 +740,14 @@ void ScreenSelectMusic::CheckBackgroundRequests()
{ {
if( !m_BackgroundLoader.IsCacheFileFinished( g_sBannerPath, sPath ) ) if( !m_BackgroundLoader.IsCacheFileFinished( g_sBannerPath, sPath ) )
return; return;
m_BackgroundLoader.FinishedWithCachedFile( g_sBannerPath ); bFreeCache = true;
} }
g_bBannerWaiting = false; g_bBannerWaiting = false;
m_Banner.Load( sPath ); m_Banner.Load( sPath );
if( bFreeCache )
m_BackgroundLoader.FinishedWithCachedFile( g_sBannerPath );
} }
/* Nothing else is going. Start the music, if we havn't yet. */ /* Nothing else is going. Start the music, if we havn't yet. */