From afec93797fbd1138bcf4698f88075c51a58418dd Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 5 Jun 2005 03:18:09 +0000 Subject: [PATCH] play commands even if not switching backgrounds. This is useful for short "flash" BGAs that play a few times in a row with nothing else in-between. --- stepmania/src/Background.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 41afecf3c5..6dd32b3c2e 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -760,20 +760,21 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus m_pFadingBGA->RunCommands( *bt.cmdRoot ); } } - - m_pCurrentBGA->Reset(); - m_pCurrentBGA->SetUpdateRate( change.m_fRate ); - m_pCurrentBGA->PlayCommand( "On" ); - m_pCurrentBGA->PlayCommand( "GainFocus" ); - - m_fSecsLeftInFade = m_pFadingBGA ? m_pFadingBGA->GetTweenTimeLeft() : 0; - - /* How much time of this BGA have we skipped? (This happens with SetSeconds.) */ - const float fStartSecond = pSong->m_Timing.GetElapsedTimeFromBeat( change.m_fStartBeat ); - - /* This is affected by the music rate. */ - fDeltaTime = fCurrentTime - fStartSecond; } + + m_pCurrentBGA->Reset(); + m_pCurrentBGA->SetUpdateRate( change.m_fRate ); + m_pCurrentBGA->PlayCommand( "Init" ); + m_pCurrentBGA->PlayCommand( "On" ); + m_pCurrentBGA->PlayCommand( "GainFocus" ); + + m_fSecsLeftInFade = m_pFadingBGA ? m_pFadingBGA->GetTweenTimeLeft() : 0; + + /* How much time of this BGA have we skipped? (This happens with SetSeconds.) */ + const float fStartSecond = pSong->m_Timing.GetElapsedTimeFromBeat( change.m_fStartBeat ); + + /* This is affected by the music rate. */ + fDeltaTime = fCurrentTime - fStartSecond; } if( m_pFadingBGA )