From 2185c82ff8f2c714567078c5d3b4dd1249a515f3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 11 Dec 2004 09:50:09 +0000 Subject: [PATCH] ScreenBranch shouldn't try to load a background --- stepmania/src/Screen.h | 1 + stepmania/src/ScreenBranch.h | 2 ++ stepmania/src/ScreenManager.cpp | 24 +++++++++++++----------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/stepmania/src/Screen.h b/stepmania/src/Screen.h index b4dd3fc602..a77ba54bb5 100644 --- a/stepmania/src/Screen.h +++ b/stepmania/src/Screen.h @@ -35,6 +35,7 @@ public: void ClearMessageQueue( const ScreenMessage SM ); // clear of a specific SM bool IsTransparent() const { return m_bIsTransparent; } + virtual bool UsesBackground() const { return true; } // override and set false if this screen shouldn't load a background static bool ChangeCoinModeInput( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); // return true if CoinMode changed static bool JoinInput( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); // return true if a player joined diff --git a/stepmania/src/ScreenBranch.h b/stepmania/src/ScreenBranch.h index 22881535f0..5b4df72ffc 100644 --- a/stepmania/src/ScreenBranch.h +++ b/stepmania/src/ScreenBranch.h @@ -12,6 +12,8 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); + virtual bool UsesBackground() const { return false; } + private: CString m_sChoice; }; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 172d0303f5..fae726cbd2 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -338,19 +338,21 @@ retry: // Load shared BGAnimation - CString sNewBGA = THEME->GetPathToB(sScreenName+" background"); - if( m_sLastLoadedBackground != sNewBGA ) + if( pNewScreen->UsesBackground() ) { - // 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; + CString sNewBGA = THEME->GetPathToB(sScreenName+" background"); + if( m_sLastLoadedBackground != 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; - } - + m_sLastLoadedBackground = sNewBGA; + } + } if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen ) {