store the path in the actor's name, so we can treat backgrounds like loaded

screens
This commit is contained in:
Glenn Maynard
2005-07-02 22:44:56 +00:00
parent e3999565d8
commit abac95a1b7
2 changed files with 8 additions and 11 deletions
+8 -10
View File
@@ -403,22 +403,20 @@ retry:
CString sNewBGA;
if( pNewScreen->UsesBackground() )
sNewBGA = THEME->GetPathB(sScreenName,"background");
if( sNewBGA.empty() )
{
SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = new Actor;
m_sLastLoadedBackgroundPath = "";
}
else if( m_sLastLoadedBackgroundPath != sNewBGA )
if( sNewBGA != m_pSharedBGA->GetName() )
{
// Create the new background before deleting the previous so that we keep
// any common textures loaded.
Actor *pNewBGA = ActorUtil::MakeActor( sNewBGA );
Actor *pNewBGA;
if( sNewBGA.empty() )
pNewBGA = new Actor;
else
pNewBGA = ActorUtil::MakeActor( sNewBGA );
pNewBGA->SetName( sNewBGA );
SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = pNewBGA;
m_pSharedBGA->PlayCommand( "On" );
m_sLastLoadedBackgroundPath = sNewBGA;
}
bool bIsOnSystemMenu = pNewScreen->GetScreenType() == system_menu;