reset autosync between each loop in SGSyncMachine

This commit is contained in:
Chris Danford
2006-03-09 06:39:24 +00:00
parent 280bf4513f
commit e691b97d31
3 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
class TimingData;
const int SAMPLE_COUNT = 32;
const int SAMPLE_COUNT = 30;
class AdjustSync
{
+9 -6
View File
@@ -74,12 +74,15 @@ void MeterDisplay::SetPercent( float fPercent )
void SongMeterDisplay::Update( float fDeltaTime )
{
float fSongStartSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fFirstBeat );
float fSongEndSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat );
float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, fSongStartSeconds, fSongEndSeconds, 0.0f, 1.0f );
CLAMP( fPercentPositionSong, 0, 1 );
SetPercent( fPercentPositionSong );
if( GAMESTATE->m_pCurSong )
{
float fSongStartSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fFirstBeat );
float fSongEndSeconds = GAMESTATE->m_pCurSong->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat );
float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, fSongStartSeconds, fSongEndSeconds, 0.0f, 1.0f );
CLAMP( fPercentPositionSong, 0, 1 );
SetPercent( fPercentPositionSong );
}
MeterDisplay::Update( fDeltaTime );
}
@@ -79,6 +79,9 @@ void ScreenGameplaySyncMachine::ResetAndRestartCurrentSong()
m_pSoundMusic->Stop();
ReloadCurrentSong();
StartPlayingSong( 4, 0 );
// reset autosync
AdjustSync::s_iAutosyncOffsetSample = 0;
}
void ScreenGameplaySyncMachine::RefreshText()