allow default.xml for backgrounds

This commit is contained in:
Glenn Maynard
2005-02-22 22:13:24 +00:00
parent 350faf7e01
commit fd6a03977d
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -31,6 +31,7 @@
#include "ScreenSystemLayer.h" #include "ScreenSystemLayer.h"
#include "BGAnimation.h" #include "BGAnimation.h"
#include "Foreach.h" #include "Foreach.h"
#include "ActorUtil.h"
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
@@ -52,7 +53,7 @@ void ScreenManager::Register( const CString& sClassName, CreateScreenFn pfn )
ScreenManager::ScreenManager() ScreenManager::ScreenManager()
{ {
m_pSharedBGA = new BGAnimation; m_pSharedBGA = new Actor;
m_SystemLayer = NULL; m_SystemLayer = NULL;
m_MessageSendOnPop = SM_None; m_MessageSendOnPop = SM_None;
@@ -387,15 +388,15 @@ retry:
sNewBGA = THEME->GetPathB(sScreenName,"background"); sNewBGA = THEME->GetPathB(sScreenName,"background");
if( sNewBGA.empty() ) if( sNewBGA.empty() )
{ {
m_pSharedBGA->Unload(); SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = new Actor;
m_sLastLoadedBackgroundPath = ""; m_sLastLoadedBackgroundPath = "";
} }
else if( m_sLastLoadedBackgroundPath != sNewBGA ) else if( m_sLastLoadedBackgroundPath != sNewBGA )
{ {
// Create the new background before deleting the previous so that we keep // Create the new background before deleting the previous so that we keep
// any common textures loaded. // any common textures loaded.
BGAnimation *pNewBGA = new BGAnimation; Actor *pNewBGA = ActorUtil::MakeActor( sNewBGA );
pNewBGA->LoadFromAniDir( sNewBGA );
SAFE_DELETE( m_pSharedBGA ); SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = pNewBGA; m_pSharedBGA = pNewBGA;
m_pSharedBGA->PlayCommand( "On" ); m_pSharedBGA->PlayCommand( "On" );
+1 -1
View File
@@ -60,7 +60,7 @@ public:
// //
// in draw order first to last // in draw order first to last
// //
BGAnimation *m_pSharedBGA; // BGA object that's persistent between screens Actor *m_pSharedBGA; // BGA object that's persistent between screens
void PlaySharedBackgroundOffCommand(); void PlaySharedBackgroundOffCommand();
private: private:
vector<Screen*> m_ScreenStack; // bottommost to topmost vector<Screen*> m_ScreenStack; // bottommost to topmost