diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 29a4dc5ef7..79ea6471f0 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -229,11 +229,17 @@ void Background::LoadFromSong( Song* pSong ) // Load random backgrounds + bool bLoadedAnyRandomBackgrounds = false; { for( int i=0; i fLastBeat ) continue; // skip - CString sBGName = RANDOM_BACKGROUND[ rand()%MAX_RANDOM_BACKGROUNDS ]; - m_aBGChanges.push_back( BackgroundChange(bpmseg.m_fStartBeat,sBGName) ); + if( bLoadedAnyRandomBackgrounds ) + { + CString sBGName = RANDOM_BACKGROUND[ rand()%MAX_RANDOM_BACKGROUNDS ]; + m_aBGChanges.push_back( BackgroundChange(bpmseg.m_fStartBeat,sBGName) ); + } } } @@ -411,3 +426,10 @@ void Background::FadeOut() m_quadBGBrightness.SetTweenDiffuse( RageColor(0,0,0,1-0.5f) ); } + +BGAnimation* Background::GetCurrentBGA() +{ + CString sBGName = m_aBGChanges[m_iCurBGChange].m_sBGName; + ASSERT( m_BGAnimations[ sBGName ] ); + return m_BGAnimations[ sBGName ]; +} diff --git a/stepmania/src/Background.h b/stepmania/src/Background.h index 60a9737203..2ca6643dfe 100644 --- a/stepmania/src/Background.h +++ b/stepmania/src/Background.h @@ -53,10 +53,7 @@ protected: map m_BGAnimations; vector m_aBGChanges; int m_iCurBGChange; // starts at 0 and increases to m_aBGSegments.size()-1 - BGAnimation* GetCurrentBGA() - { - return m_BGAnimations[ m_aBGChanges[m_iCurBGChange].m_sBGName ]; - } + BGAnimation* GetCurrentBGA(); BGAnimation* m_pFadingBGA; float m_fSecsLeftInFade;