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:
@@ -1486,6 +1486,13 @@ void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMu
|
||||
UpdateSongPosition(0);
|
||||
|
||||
ASSERT( GAMESTATE->m_Position.m_fMusicSeconds > -4000 ); /* make sure the "fake timer" code doesn't trigger */
|
||||
FOREACH_EnabledPlayer(pn)
|
||||
{
|
||||
if(GAMESTATE->m_pCurSteps[pn])
|
||||
{
|
||||
GAMESTATE->m_pCurSteps[pn]->GetTimingData()->PrepareLookup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2548,6 +2555,13 @@ void ScreenGameplay::SaveStats()
|
||||
|
||||
void ScreenGameplay::SongFinished()
|
||||
{
|
||||
FOREACH_EnabledPlayer(pn)
|
||||
{
|
||||
if(GAMESTATE->m_pCurSteps[pn])
|
||||
{
|
||||
GAMESTATE->m_pCurSteps[pn]->GetTimingData()->ReleaseLookup();
|
||||
}
|
||||
}
|
||||
AdjustSync::HandleSongEnd();
|
||||
SaveStats(); // Let subclasses save the stats.
|
||||
/* Extremely important: if we don't remove attacks before moving on to the next
|
||||
|
||||
Reference in New Issue
Block a user