diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 8d8b1b57fb..659477e4a8 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -33,9 +33,6 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : Screen( sN // We have to do initialization in the first update because this->GetElementName() won't // work until the object has been fully constructed. - m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName+" background") ); - this->AddChild( &m_Background ); - m_In.Load( THEME->GetPathToB(m_sName+" in") ); m_In.StartTransitioning(); m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS ); @@ -46,16 +43,6 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : Screen( sN this->AddChild( &m_Out ); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(m_sName) ); - - float fTimeUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds(); - if( fTimeUntilBeginFadingOut < 0 ) - { - LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated", - m_sName.c_str(), m_Out.GetLengthSeconds(), m_Background.GetLengthSeconds() ); - fTimeUntilBeginFadingOut = 0; - } - - this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut ); } @@ -132,6 +119,19 @@ void ScreenAttract::Update( float fDelta ) { if( IsFirstUpdate() ) { + // The shared background isn't loaded until the screen is actually + // showing. The background is loaded by the time of the first update. + BGAnimation &background = *SCREENMAN->m_pSharedBGA; + float fTimeUntilBeginFadingOut = background.GetLengthSeconds() - m_Out.GetLengthSeconds(); + if( fTimeUntilBeginFadingOut < 0 ) + { + LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated", + m_sName.c_str(), m_Out.GetLengthSeconds(), background.GetLengthSeconds() ); + fTimeUntilBeginFadingOut = 0; + } + this->PostScreenMessage( SM_BeginFadingOut, fTimeUntilBeginFadingOut ); + + if( GAMESTATE->IsTimeToPlayAttractSounds() ) SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") ); else diff --git a/stepmania/src/ScreenAttract.h b/stepmania/src/ScreenAttract.h index 4612527f94..d6c2f90fe2 100644 --- a/stepmania/src/ScreenAttract.h +++ b/stepmania/src/ScreenAttract.h @@ -20,7 +20,6 @@ public: virtual void HandleScreenMessage( const ScreenMessage SM ); protected: - BGAnimation m_Background; Transition m_In; Transition m_Out; }; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index b04d5ddc73..5d5793f465 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -412,8 +412,6 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName ) GAMESTATE->ResetNoteSkins(); GAMESTATE->StoreSelectedOptions(); - m_BGAnimation.LoadFromAniDir( THEME->GetPathToB("ScreenEdit background") ); - shiftAnchor = -1; @@ -605,7 +603,6 @@ void ScreenEdit::Update( float fDeltaTime ) } } - m_BGAnimation.Update( fDeltaTime ); m_SnapDisplay.Update( fDeltaTime ); m_NoteFieldEdit.Update( fDeltaTime ); m_In.Update( fDeltaTime ); @@ -713,7 +710,6 @@ void ScreenEdit::DrawPrimitives() { case MODE_EDITING: { - m_BGAnimation.Draw(); m_sprHelp.Draw(); m_textHelp.Draw(); m_sprInfo.Draw(); @@ -733,8 +729,6 @@ void ScreenEdit::DrawPrimitives() case MODE_RECORDING: if( PREFSMAN->m_bEditorShowBGChangesPlay ) m_Background.Draw(); - else - m_BGAnimation.Draw(); m_NoteFieldRecord.Draw(); if( PREFSMAN->m_bEditorShowBGChangesPlay ) @@ -743,8 +737,6 @@ void ScreenEdit::DrawPrimitives() case MODE_PLAYING: if( PREFSMAN->m_bEditorShowBGChangesPlay ) m_Background.Draw(); - else - m_BGAnimation.Draw(); m_Player.Draw(); if( PREFSMAN->m_bEditorShowBGChangesPlay ) diff --git a/stepmania/src/ScreenEdit.h b/stepmania/src/ScreenEdit.h index 47b0e6b2ae..f795c930c8 100644 --- a/stepmania/src/ScreenEdit.h +++ b/stepmania/src/ScreenEdit.h @@ -51,8 +51,6 @@ protected: Song* m_pSong; Steps* m_pSteps; - BGAnimation m_BGAnimation; - NoteField m_NoteFieldEdit; SnapDisplay m_SnapDisplay; diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index 06e952b557..536bd51937 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -246,15 +246,6 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa // Now that we've read the data from the profile, it's ok to Reset() GAMESTATE->Reset(); - - float fSecsUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds(); - if( fSecsUntilBeginFadingOut < 0 ) - { - LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated", - m_sName.c_str(), m_Out.GetLengthSeconds(), m_Background.GetLengthSeconds() ); - fSecsUntilBeginFadingOut = 0; - } - this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut ); } ScreenEnding::~ScreenEnding() @@ -263,6 +254,22 @@ ScreenEnding::~ScreenEnding() void ScreenEnding::Update( float fDeltaTime ) { + // The shared background isn't loaded until the screen is actually + // showing. The background is loaded by the time of the first update. + if( IsFirstUpdate() ) + { + BGAnimation &background = *SCREENMAN->m_pSharedBGA; + float fSecsUntilBeginFadingOut = background.GetLengthSeconds() - m_Out.GetLengthSeconds(); + if( fSecsUntilBeginFadingOut < 0 ) + { + LOG->Warn( "Screen '%s' Out BGAnimation (%f seconds) is longer than Background BGAnimation (%f seconds); background BGA will be truncated", + m_sName.c_str(), m_Out.GetLengthSeconds(), background.GetLengthSeconds() ); + fSecsUntilBeginFadingOut = 0; + } + this->PostScreenMessage( SM_BeginFadingOut, fSecsUntilBeginFadingOut ); + } + + ScreenAttract::Update( fDeltaTime ); if( m_In.IsTransitioning() && m_Out.IsTransitioning() ) diff --git a/stepmania/src/ScreenEz2SelectPlayer.cpp b/stepmania/src/ScreenEz2SelectPlayer.cpp index 09419a1a0f..daeb3865bd 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.cpp +++ b/stepmania/src/ScreenEz2SelectPlayer.cpp @@ -45,9 +45,6 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer( CString sName ) : ScreenWithMenuEl LOG->Trace( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" ); - m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenEz2SelectPlayer background") ); - this->AddChild( &m_Background ); // animated background =) - FOREACH_PlayerNumber( p ) { m_sprJoinFrame[p].Load( THEME->GetPathToG("ScreenEz2SelectPlayer join frame 1x2") ); diff --git a/stepmania/src/ScreenEz2SelectPlayer.h b/stepmania/src/ScreenEz2SelectPlayer.h index 9200a79ce0..3041fc961d 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.h +++ b/stepmania/src/ScreenEz2SelectPlayer.h @@ -28,8 +28,6 @@ private: Sprite m_sprJoinMessage[NUM_PLAYERS]; Sprite m_sprJoinFrame[NUM_PLAYERS]; - - BGAnimation m_Background; }; #endif diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index d5bf32b4e0..0fe669a6a0 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -29,6 +29,7 @@ #include "RageTextureManager.h" #include "ThemeManager.h" #include "ScreenSystemLayer.h" +#include "BGAnimation.h" ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program @@ -50,6 +51,7 @@ void ScreenManager::Register( const CString& sClassName, CreateScreenFn pfn ) ScreenManager::ScreenManager() { + m_pSharedBGA = new BGAnimation; m_SystemLayer = NULL; /* By the time this is constructed, THEME has already been set up and set to @@ -60,7 +62,6 @@ ScreenManager::ScreenManager() this->ThemeChanged(); m_ScreenBuffered = NULL; - m_MessageSendOnPop = SM_None; } @@ -71,7 +72,7 @@ ScreenManager::~ScreenManager() EmptyDeleteQueue(); - // delete current Screens + SAFE_DELETE( m_pSharedBGA ); for( unsigned i=0; iUpdate( fDeltaTime ); + if( !m_ScreenStack.empty() ) { Screen* pScreen = GetTopScreen(); @@ -149,7 +152,7 @@ void ScreenManager::Update( float fDeltaTime ) } m_SystemLayer->Update( fDeltaTime ); - + EmptyDeleteQueue(); if(m_DelayedScreen.size() != 0) @@ -180,13 +183,21 @@ void ScreenManager::Draw() if( !DISPLAY->BeginFrame() ) return; + m_pSharedBGA->Draw(); + if( !m_ScreenStack.empty() && !m_ScreenStack.back()->IsTransparent() ) // top screen isn't transparent + { m_ScreenStack.back()->Draw(); + } else + { for( unsigned i=0; iDraw(); + } + m_SystemLayer->Draw(); + DISPLAY->EndFrame(); } @@ -202,7 +213,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type } -Screen* ScreenManager::MakeNewScreen( const CString &sName ) +Screen* ScreenManager::MakeNewScreen( const CString &sScreenName ) { /* By default, RageSounds handles the song timer. When we change screens, reset this; * screens turn this off in SM_GainFocus if they handle timers themselves (edit). @@ -214,20 +225,20 @@ Screen* ScreenManager::MakeNewScreen( const CString &sName ) SONGMAN->Cleanup(); RageTimer t; - LOG->Trace( "Loading screen name '%s'", sName.c_str() ); + LOG->Trace( "Loading screen name '%s'", sScreenName.c_str() ); - CString sClassName = sName; + CString sClassName = sScreenName; // Look up the class in the metrics group sName if( THEME->HasMetric(sClassName,"Class") ) sClassName = THEME->GetMetric(sClassName,"Class"); map::iterator iter = g_pmapRegistrees->find( sClassName ); - ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sName.c_str(),sClassName.c_str()) ) + ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sScreenName.c_str(),sClassName.c_str()) ) CreateScreenFn pfn = iter->second; - Screen* ret = pfn( sName ); + Screen* ret = pfn( sScreenName ); - LOG->Trace( "Loaded '%s' ('%s') in %f", sName.c_str(), sClassName.c_str(), t.GetDeltaTime()); + LOG->Trace( "Loaded '%s' ('%s') in %f", sScreenName.c_str(), sClassName.c_str(), t.GetDeltaTime()); /* Loading probably took a little while. Let's reset stats. This prevents us * from displaying an unnaturally low FPS value, and the next FPS value we @@ -238,10 +249,10 @@ Screen* ScreenManager::MakeNewScreen( const CString &sName ) return ret; } -void ScreenManager::PrepNewScreen( const CString &sClassName ) +void ScreenManager::PrepNewScreen( const CString &sScreenName ) { ASSERT(m_ScreenBuffered == NULL); - m_ScreenBuffered = MakeNewScreen(sClassName); + m_ScreenBuffered = MakeNewScreen(sScreenName); } void ScreenManager::LoadPreppedScreen() @@ -255,6 +266,7 @@ void ScreenManager::LoadPreppedScreen() void ScreenManager::DeletePreppedScreen() { SAFE_DELETE( m_ScreenBuffered ); + TEXTUREMAN->DeleteCachedTextures(); } @@ -285,9 +297,9 @@ void ScreenManager::SetFromNewScreen( Screen *pNewScreen, bool Stack ) PostMessageToTopScreen( SM_GainFocus, 0 ); } -void ScreenManager::SetNewScreen( const CString &sClassName ) +void ScreenManager::SetNewScreen( const CString &sScreenName ) { - m_DelayedScreen = sClassName; + m_DelayedScreen = sScreenName; /* If we're not delaying screen loads, load it now. Otherwise, we'll load * it on the next iteration. Only delay if we already have a screen @@ -299,7 +311,7 @@ void ScreenManager::SetNewScreen( const CString &sClassName ) void ScreenManager::LoadDelayedScreen() { retry: - CString sClassName = m_DelayedScreen; + CString sScreenName = m_DelayedScreen; m_DelayedScreen = ""; /* If we prepped a screen but didn't use it, nuke it. */ @@ -307,10 +319,13 @@ retry: Screen* pOldTopScreen = m_ScreenStack.empty() ? NULL : m_ScreenStack.back(); + // It makes sense that ScreenManager should allocate memory for a new screen since it // deletes it later on. This also convention will reduce includes because screens won't // have to include each other's headers of other screens. - Screen* pNewScreen = MakeNewScreen(sClassName); + Screen* pNewScreen = MakeNewScreen(sScreenName); + + if( pOldTopScreen!=NULL && m_ScreenStack.back()!=pOldTopScreen ) { @@ -333,16 +348,16 @@ retry: /* If this is a system menu, don't let the operator key touch it! However, if you add an options screen, please include it here -- Miryokuteki */ - if( sClassName == "ScreenOptionsMenu" || - sClassName == "ScreenMachineOptions" || - sClassName == "ScreenInputOptions" || - sClassName == "ScreenGraphicOptions" || - sClassName == "ScreenGameplayOptions" || - sClassName == "ScreenMapControllers" || - sClassName == "ScreenAppearanceOptions" || - sClassName == "ScreenEdit" || - sClassName == "ScreenEditMenu" || - sClassName == "ScreenSoundOptions" ) + if( sScreenName == "ScreenOptionsMenu" || + sScreenName == "ScreenMachineOptions" || + sScreenName == "ScreenInputOptions" || + sScreenName == "ScreenGraphicOptions" || + sScreenName == "ScreenGameplayOptions" || + sScreenName == "ScreenMapControllers" || + sScreenName == "ScreenAppearanceOptions" || + sScreenName == "ScreenEdit" || + sScreenName == "ScreenEditMenu" || + sScreenName == "ScreenSoundOptions" ) GAMESTATE->m_bIsOnSystemMenu = true; else GAMESTATE->m_bIsOnSystemMenu = false; @@ -355,14 +370,14 @@ retry: SetFromNewScreen( pNewScreen, false ); } -void ScreenManager::AddNewScreenToTop( const CString &sClassName, ScreenMessage messageSendOnPop ) +void ScreenManager::AddNewScreenToTop( const CString &sScreenName, ScreenMessage messageSendOnPop ) { /* Send this before making the new screen, since it might set things that will be re-set * in the new screen's ctor. */ if( m_ScreenStack.size() ) m_ScreenStack.back()->HandleScreenMessage( SM_LoseFocus ); - Screen* pNewScreen = MakeNewScreen(sClassName); + Screen* pNewScreen = MakeNewScreen(sScreenName); SetFromNewScreen( pNewScreen, true ); m_MessageSendOnPop = messageSendOnPop; } @@ -512,6 +527,11 @@ void ScreenManager::PlayBackSound() m_soundBack.Play( &p ); } +void ScreenManager::PlaySharedBackgroundOffCommand() +{ + m_pSharedBGA->PlayCommand("Off"); +} + /* * (c) 2001-2003 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/stepmania/src/ScreenManager.h b/stepmania/src/ScreenManager.h index 917931175d..5a26c00ad1 100644 --- a/stepmania/src/ScreenManager.h +++ b/stepmania/src/ScreenManager.h @@ -15,6 +15,7 @@ class Screen; struct Menu; class ScreenSystemLayer; +class BGAnimation; typedef Screen* (*CreateScreenFn)(const CString&); @@ -37,6 +38,7 @@ public: void PrepNewScreen( const CString &sName ); void LoadPreppedScreen(); void DeletePreppedScreen(); + void SetNewScreen( const CString &sName ); void AddNewScreenToTop( const CString &sName, ScreenMessage messageSendOnPop ); void Prompt( ScreenMessage SM_SendWhenDone, const CString &sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); @@ -59,6 +61,12 @@ public: Screen *GetTopScreen(); +public: + // + // in draw order first to last + // + BGAnimation *m_pSharedBGA; // BGA object that's persistent between screens + void PlaySharedBackgroundOffCommand(); private: vector m_ScreenStack; // bottommost to topmost ScreenMessage m_MessageSendOnPop; diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 5b0f8677c6..0f79f7a77f 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -157,9 +157,6 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName ) GAMESTATE->m_bPastHereWeGo = true; // enable the gray arrows - m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenNameEntry background") ); - this->AddChild( &m_Background ); - FOREACH_PlayerNumber( p ) { // load last used ranking name if any diff --git a/stepmania/src/ScreenNameEntry.h b/stepmania/src/ScreenNameEntry.h index fde88a08f6..f6945fbaa8 100644 --- a/stepmania/src/ScreenNameEntry.h +++ b/stepmania/src/ScreenNameEntry.h @@ -29,8 +29,6 @@ public: private: bool AnyStillEntering() const; - BGAnimation m_Background; - ReceptorArrowRow m_ReceptorArrowRow[NUM_PLAYERS]; BitmapText m_textSelectedChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH]; BitmapText m_textScrollingChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH]; diff --git a/stepmania/src/ScreenNameEntryTraditional.h b/stepmania/src/ScreenNameEntryTraditional.h index e5509c4c59..6f2e340da0 100644 --- a/stepmania/src/ScreenNameEntryTraditional.h +++ b/stepmania/src/ScreenNameEntryTraditional.h @@ -60,8 +60,6 @@ private: void ChangeDisplayedFeat(); void SelectChar( PlayerNumber pn, int c ); - BGAnimation m_Background; - ActorFrame m_Keyboard[NUM_PLAYERS]; Sprite m_sprCursor[NUM_PLAYERS]; vector m_textAlphabet[NUM_PLAYERS]; diff --git a/stepmania/src/ScreenStage.cpp b/stepmania/src/ScreenStage.cpp index 18aa8b9a9c..289cf63cee 100644 --- a/stepmania/src/ScreenStage.cpp +++ b/stepmania/src/ScreenStage.cpp @@ -31,11 +31,6 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName ) LIGHTSMAN->SetLightsMode( LIGHTSMODE_STAGE ); - - m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName + " "+GAMESTATE->GetStageText()) ); - m_Background.SetDrawOrder( DRAW_ORDER_BEFORE_EVERYTHING ); - this->AddChild( &m_Background ); - m_Overlay.SetName( "Overlay" ); m_Overlay.LoadFromAniDir( THEME->GetPathToB(m_sName + " overlay")); ON_COMMAND( m_Overlay ); @@ -54,9 +49,6 @@ ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName ) m_Back.SetDrawOrder( DRAW_ORDER_TRANSITIONS ); this->AddChild( &m_Back ); - /* Prep the new screen once m_In is complete. */ - this->PostScreenMessage( SM_PrepScreen, m_Background.GetLengthSeconds() ); - FOREACH_PlayerNumber(p) { Character* pChar = GAMESTATE->m_pCurCharacters[p]; @@ -123,7 +115,8 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM ) OFF_COMMAND( m_SongTitle ); OFF_COMMAND( m_Artist ); OFF_COMMAND( m_Banner ); - OFF_COMMAND( m_Background ); + SCREENMAN->PlaySharedBackgroundOffCommand(); + this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() ); @@ -140,6 +133,11 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM ) void ScreenStage::Update( float fDeltaTime ) { + // The shared BGA isn't loaded until after the screen is showing. It is ready + // to access by the time of the first update. + if( IsFirstUpdate() ) + this->PostScreenMessage( SM_PrepScreen, SCREENMAN->m_pSharedBGA->GetLengthSeconds() ); + if( m_bZeroDeltaOnNextUpdate ) { m_bZeroDeltaOnNextUpdate = false; diff --git a/stepmania/src/ScreenStage.h b/stepmania/src/ScreenStage.h index 69399fe706..0e21913ed5 100644 --- a/stepmania/src/ScreenStage.h +++ b/stepmania/src/ScreenStage.h @@ -21,7 +21,6 @@ public: private: Transition m_In, m_Out, m_Back; - BGAnimation m_Background; BGAnimation m_Overlay; // overlays all elements except bitmaptexts Banner m_Banner; BitmapText m_SongTitle; diff --git a/stepmania/src/ScreenStyleSplash.cpp b/stepmania/src/ScreenStyleSplash.cpp index b0918a3eb3..1d627505e5 100644 --- a/stepmania/src/ScreenStyleSplash.cpp +++ b/stepmania/src/ScreenStyleSplash.cpp @@ -39,9 +39,6 @@ ScreenStyleSplash::ScreenStyleSplash( CString sName ) : ScreenWithMenuElements( iDifficulty = GAMESTATE->m_PreferredDifficulty[PLAYER_2]; } - m_Background.LoadFromAniDir( THEME->GetPathToB(ssprintf("ScreenStyleSplash-%s-%s-%d",sGameName.c_str(),sStyleName.c_str(),iDifficulty) ) ); - this->AddChild( &m_Background ); - this->PostScreenMessage( SM_StartClosing, 2 ); } diff --git a/stepmania/src/ScreenStyleSplash.h b/stepmania/src/ScreenStyleSplash.h index 9391b1e037..7289387d42 100644 --- a/stepmania/src/ScreenStyleSplash.h +++ b/stepmania/src/ScreenStyleSplash.h @@ -18,8 +18,6 @@ public: protected: void MenuStart( PlayerNumber pn ); void MenuBack( PlayerNumber pn ); - - BGAnimation m_Background; }; #endif diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 51a66e11c7..0cf10fb93b 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -29,9 +29,6 @@ ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( s this->SetName( sClassName ); - m_Background.LoadFromAniDir( THEME->GetPathToB(m_sName+" background") ); - this->AddChild( &m_Background ); - m_autoHeader.Load( THEME->GetPathToG(m_sName+" header") ); m_autoHeader->SetName("Header"); UtilSetXY( m_autoHeader, m_sName ); @@ -140,7 +137,7 @@ void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone ) UtilOffCommand( m_autoFooter, m_sName ); UtilOffCommand( m_textHelp, m_sName ); - m_Background.PlayCommand("Off"); + SCREENMAN->PlaySharedBackgroundOffCommand(); m_Out.StartTransitioning(smSendWhenDone); diff --git a/stepmania/src/ScreenWithMenuElements.h b/stepmania/src/ScreenWithMenuElements.h index e695601d15..fae887ebd4 100644 --- a/stepmania/src/ScreenWithMenuElements.h +++ b/stepmania/src/ScreenWithMenuElements.h @@ -27,8 +27,6 @@ public: void ResetTimer(); protected: - BGAnimation m_Background; - AutoActor m_autoHeader; Sprite m_sprStyleIcon; MemoryCardDisplay m_MemoryCardDisplay[NUM_PLAYERS];