reset autosync between each loop in SGSyncMachine
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
class TimingData;
|
||||
|
||||
const int SAMPLE_COUNT = 32;
|
||||
const int SAMPLE_COUNT = 30;
|
||||
|
||||
class AdjustSync
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user