Don't randomly change backgrounds when all we have is one
image; we end up looping movies.
This commit is contained in:
@@ -301,9 +301,16 @@ void Background::LoadFromSong( Song* pSong )
|
||||
// start off showing the static song background
|
||||
m_aBGSegments.Add( BGSegment(-10000,0) );
|
||||
|
||||
// change BG every 4 bars
|
||||
/* If we have only 2, only generate a single animation segment for for the
|
||||
* whole song. Otherwise, if it's a movie., it'll loop every four bars; we
|
||||
* want it to play continuously. */
|
||||
const float fFirstBeat = m_BackgroundMode==MODE_MOVIE_BG ? 0 : pSong->m_fFirstBeat;
|
||||
const float fLastBeat = pSong->m_fLastBeat;
|
||||
|
||||
if( m_BackgroundAnimations.GetSize() == 2) {
|
||||
m_aBGSegments.Add( BGSegment(fFirstBeat,1) );
|
||||
} else {
|
||||
// change BG every 4 bars
|
||||
for( float f=fFirstBeat; f<fLastBeat; f+=16 )
|
||||
{
|
||||
int index;
|
||||
@@ -331,14 +338,13 @@ void Background::LoadFromSong( Song* pSong )
|
||||
index = 1 + int(bpmseg.m_fBPM)%(m_BackgroundAnimations.GetSize()-1);
|
||||
m_aBGSegments.Add( BGSegment(bpmseg.m_fStartBeat,index) );
|
||||
}
|
||||
}
|
||||
|
||||
// end showing the static song background
|
||||
m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0) );
|
||||
|
||||
// sort segments
|
||||
SortBGSegmentArray( m_aBGSegments );
|
||||
|
||||
|
||||
}
|
||||
|
||||
for( int i=0; i<m_BackgroundAnimations.GetSize(); i++ )
|
||||
|
||||
Reference in New Issue
Block a user