Move the reset code to SongPosition.
This commit is contained in:
+5
-10
@@ -893,22 +893,17 @@ const float GameState::MUSIC_SECONDS_INVALID = -5000.0f;
|
|||||||
|
|
||||||
void GameState::ResetMusicStatistics()
|
void GameState::ResetMusicStatistics()
|
||||||
{
|
{
|
||||||
m_fMusicSeconds = 0; // MUSIC_SECONDS_INVALID;
|
m_Position.Reset();
|
||||||
// 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_fMusicSecondsVisible = 0;
|
m_fMusicSecondsVisible = 0;
|
||||||
m_fSongBeatVisible = 0;
|
m_fSongBeatVisible = 0;
|
||||||
Actor::SetBGMTime( 0, 0, 0, 0 );
|
Actor::SetBGMTime( 0, 0, 0, 0 );
|
||||||
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
|
{
|
||||||
m_pPlayerState[p]->ClearHopoState();
|
m_pPlayerState[p]->ClearHopoState();
|
||||||
|
m_pPlayerState[p]->m_Position.Reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameState::ResetStageStatistics()
|
void GameState::ResetStageStatistics()
|
||||||
|
|||||||
+1
-1
@@ -618,7 +618,7 @@ float FindFirstDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistance
|
|||||||
bBoomerang = (fAccels[PlayerOptions::ACCEL_BOOMERANG] != 0);
|
bBoomerang = (fAccels[PlayerOptions::ACCEL_BOOMERANG] != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
while( fFirstBeatToDraw < m_pPlayerState->m_Position.m_fSongBeat )
|
while( fFirstBeatToDraw < pPlayerState->m_Position.m_fSongBeat )
|
||||||
{
|
{
|
||||||
bool bIsPastPeakYOffset;
|
bool bIsPastPeakYOffset;
|
||||||
float fPeakYOffset;
|
float fPeakYOffset;
|
||||||
|
|||||||
@@ -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
|
* @file
|
||||||
* @author Thai Pangsakulyanont (c) 2011
|
* @author Thai Pangsakulyanont (c) 2011
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class SongPosition
|
|||||||
float m_fWarpDestination;
|
float m_fWarpDestination;
|
||||||
RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update
|
RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update
|
||||||
|
|
||||||
|
void Reset();
|
||||||
void UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer );
|
void UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user