Added lookup table system to TimingData so that GetBeatAndBPS and GetElapsedTime don't have to walk through the entire list of timing segments several times every frame during gameplay.
This commit is contained in:
+4
-5
@@ -712,16 +712,15 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
if( m_aBGChanges.size() == 0 )
|
||||
return;
|
||||
|
||||
float fBeat, fBPS, fThrowAway;
|
||||
bool bFreeze;
|
||||
int iThrowAway;
|
||||
pSong->m_SongTiming.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway );
|
||||
TimingData::GetBeatArgs beat_info;
|
||||
beat_info.elapsed_time= fCurrentTime;
|
||||
pSong->m_SongTiming.GetBeatAndBPSFromElapsedTime(beat_info);
|
||||
|
||||
// Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it.
|
||||
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
|
||||
|
||||
// Find the BGSegment we're in
|
||||
const int i = FindBGSegmentForBeat( fBeat );
|
||||
const int i = FindBGSegmentForBeat(beat_info.beat);
|
||||
|
||||
float fDeltaTime = fCurrentTime - fLastMusicSeconds;
|
||||
if( i != -1 && i != m_iCurBGChangeIndex ) // we're changing backgrounds
|
||||
|
||||
Reference in New Issue
Block a user