don't unload resources shared between backgrounds when loading a new background

This commit is contained in:
Chris Danford
2004-12-11 08:35:23 +00:00
parent 4059c657ca
commit 37cff8a09e
+7 -1
View File
@@ -341,7 +341,13 @@ retry:
CString sNewBGA = THEME->GetPathToB(sScreenName+" background");
if( m_sLastLoadedBackground != sNewBGA )
{
m_pSharedBGA->LoadFromAniDir( sNewBGA );
// Create the new background before deleting the previous so that we keep
// any common textures loaded.
BGAnimation *pNewBGA = new BGAnimation;
pNewBGA->LoadFromAniDir( sNewBGA );
SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = pNewBGA;
m_sLastLoadedBackground = sNewBGA;
}