diff --git a/src/GameState.cpp b/src/GameState.cpp index 9ad930dcd3..4df8259744 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -893,22 +893,17 @@ const float GameState::MUSIC_SECONDS_INVALID = -5000.0f; void GameState::ResetMusicStatistics() { - m_fMusicSeconds = 0; // MUSIC_SECONDS_INVALID; - // todo: move me to FOREACH_EnabledPlayer( p ) after [NUM_PLAYERS]ing - m_fSongBeat = 0; - m_fSongBeatNoOffset = 0; - m_fCurBPS = 10; - //m_bStop = false; - m_bFreeze = false; - m_bDelay = false; - m_iWarpBeginRow = -1; // Set to -1 because some song may want to warp to row 0. -aj - m_fWarpDestination = -1; // Set when a warp is encountered. also see above. -aj + m_Position.Reset(); + m_fMusicSecondsVisible = 0; m_fSongBeatVisible = 0; Actor::SetBGMTime( 0, 0, 0, 0 ); FOREACH_PlayerNumber( p ) + { m_pPlayerState[p]->ClearHopoState(); + m_pPlayerState[p]->m_Position.Reset(); + } } void GameState::ResetStageStatistics() diff --git a/src/NoteField.cpp b/src/NoteField.cpp index c4c6826765..72a9ceb90e 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -618,7 +618,7 @@ float FindFirstDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistance bBoomerang = (fAccels[PlayerOptions::ACCEL_BOOMERANG] != 0); } - while( fFirstBeatToDraw < m_pPlayerState->m_Position.m_fSongBeat ) + while( fFirstBeatToDraw < pPlayerState->m_Position.m_fSongBeat ) { bool bIsPastPeakYOffset; float fPeakYOffset; diff --git a/src/SongPosition.cpp b/src/SongPosition.cpp index 1a68e620a6..14a67c1806 100644 --- a/src/SongPosition.cpp +++ b/src/SongPosition.cpp @@ -46,6 +46,22 @@ void SongPosition::UpdateSongPosition( float fPositionSeconds, const TimingData } +void SongPosition::Reset() +{ + + m_fMusicSeconds = 0; // MUSIC_SECONDS_INVALID; + // todo: move me to FOREACH_EnabledPlayer( p ) after [NUM_PLAYERS]ing + m_fSongBeat = 0; + m_fSongBeatNoOffset = 0; + m_fCurBPS = 10; + //m_bStop = false; + m_bFreeze = false; + m_bDelay = false; + m_iWarpBeginRow = -1; // Set to -1 because some song may want to warp to row 0. -aj + m_fWarpDestination = -1; // Set when a warp is encountered. also see above. -aj + +} + /** * @file * @author Thai Pangsakulyanont (c) 2011 diff --git a/src/SongPosition.h b/src/SongPosition.h index 97d2d6fd3c..abe1dc2a8e 100644 --- a/src/SongPosition.h +++ b/src/SongPosition.h @@ -32,6 +32,7 @@ class SongPosition float m_fWarpDestination; RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update + void Reset(); void UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer ); };