From fd6a03977d3c6f8867eecffe795809deca18467d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 22 Feb 2005 22:13:24 +0000 Subject: [PATCH] allow default.xml for backgrounds --- stepmania/src/ScreenManager.cpp | 9 +++++---- stepmania/src/ScreenManager.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 1371d75692..9a8f8177b6 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -31,6 +31,7 @@ #include "ScreenSystemLayer.h" #include "BGAnimation.h" #include "Foreach.h" +#include "ActorUtil.h" 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() { - m_pSharedBGA = new BGAnimation; + m_pSharedBGA = new Actor; m_SystemLayer = NULL; m_MessageSendOnPop = SM_None; @@ -387,15 +388,15 @@ retry: sNewBGA = THEME->GetPathB(sScreenName,"background"); if( sNewBGA.empty() ) { - m_pSharedBGA->Unload(); + SAFE_DELETE( m_pSharedBGA ); + m_pSharedBGA = new Actor; m_sLastLoadedBackgroundPath = ""; } else if( m_sLastLoadedBackgroundPath != sNewBGA ) { // Create the new background before deleting the previous so that we keep // any common textures loaded. - BGAnimation *pNewBGA = new BGAnimation; - pNewBGA->LoadFromAniDir( sNewBGA ); + Actor *pNewBGA = ActorUtil::MakeActor( sNewBGA ); SAFE_DELETE( m_pSharedBGA ); m_pSharedBGA = pNewBGA; m_pSharedBGA->PlayCommand( "On" ); diff --git a/stepmania/src/ScreenManager.h b/stepmania/src/ScreenManager.h index d1c150f850..d6ae4da882 100644 --- a/stepmania/src/ScreenManager.h +++ b/stepmania/src/ScreenManager.h @@ -60,7 +60,7 @@ public: // // 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(); private: vector m_ScreenStack; // bottommost to topmost