add GetSongPercent
This commit is contained in:
@@ -240,6 +240,12 @@ void GameState::UpdateSongPosition(float fPositionSeconds)
|
|||||||
// LOG->Trace( "m_fMusicSeconds = %f, m_fSongBeat = %f, m_fCurBPS = %f, m_bFreeze = %f", m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
// LOG->Trace( "m_fMusicSeconds = %f, m_fSongBeat = %f, m_fCurBPS = %f, m_bFreeze = %f", m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float GameState::GetSongPercent( float beat ) const
|
||||||
|
{
|
||||||
|
/* 0 = first step; 1 = last step */
|
||||||
|
return (beat - m_pCurSong->m_fFirstBeat) / m_pCurSong->m_fLastBeat;
|
||||||
|
}
|
||||||
|
|
||||||
int GameState::GetStageIndex()
|
int GameState::GetStageIndex()
|
||||||
{
|
{
|
||||||
return m_iCurrentStageIndex;
|
return m_iCurrentStageIndex;
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ public:
|
|||||||
|
|
||||||
void ResetMusicStatistics(); // Call this when it's time to play a new song. Clears the values above.
|
void ResetMusicStatistics(); // Call this when it's time to play a new song. Clears the values above.
|
||||||
void UpdateSongPosition(float fPositionSeconds);
|
void UpdateSongPosition(float fPositionSeconds);
|
||||||
|
float GetSongPercent( float beat ) const;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Stage Statistics:
|
// Stage Statistics:
|
||||||
|
|||||||
Reference in New Issue
Block a user