diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 69ed8f670f..fa82a1613a 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -98,7 +98,7 @@ protected: // return true if created and added to m_BGAnimations bool CreateBackground( const Song *pSong, const BackgroundDef &bd ); // return def of the background that was created and added to m_BGAnimations. calls CreateBackground - BackgroundDef CreateRandomBGA( const Song *pSong, deque &RandomBGAnimations ); + BackgroundDef CreateRandomBGA( const Song *pSong, const CString &sEffect, deque &RandomBGAnimations ); int FindBGSegmentForBeat( float fBeat ) const; void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ); @@ -394,7 +394,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun return true; } -BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, deque &RandomBGAnimations ) +BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const CString &sEffect, deque &RandomBGAnimations ) { if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_OFF ) return BackgroundDef(); @@ -408,6 +408,9 @@ BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, deque::const_iterator iter = m_BGAnimations.find( bd ); // create the background if it's not already created @@ -427,11 +430,12 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fLastBeat, const Ba for( float f=fFirstBeat; f iEndIndex ) continue; // skip - BackgroundDef bd = m_Layer[0].CreateRandomBGA( m_pSong, m_RandomBGAnimations ); + BackgroundDef bd = m_Layer[0].CreateRandomBGA( m_pSong, change.m_def.m_sEffect, m_RandomBGAnimations ); if( !bd.IsEmpty() ) { BackgroundChange c = change; - c.m_def = bd; + c.m_def.m_sFile1 = bd.m_sFile1; + c.m_def.m_sFile2 = bd.m_sFile2; c.m_fStartBeat = NoteRowToBeat(bpmseg.m_iStartIndex); m_Layer[0].m_aBGChanges.push_back( c ); } @@ -542,7 +547,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) if( i == 0 ) { // The background was not found. Try to use a random one instead. - bd = layer.CreateRandomBGA( pSong, m_RandomBGAnimations ); + bd = layer.CreateRandomBGA( pSong, "", m_RandomBGAnimations ); if( bd.IsEmpty() ) bd = STATIC_BACKGROUND_DEF; }