From 9ef4cf40e094f11e69729a3f25b8504bb96467ad Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 30 Oct 2006 10:00:43 +0000 Subject: [PATCH] Scale GetTotalPossibleStepsSeconds() by fMusicRate. Fixes ComboGraph and GraphDisplay when using a different music rate. --- stepmania/src/GameState.cpp | 2 +- stepmania/src/StageStats.cpp | 3 ++- stepmania/src/StageStats.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index feac672e22..82364ae2a9 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -506,7 +506,7 @@ void GameState::BeginStage() m_pPlayerState[p]->m_PlayerOptions.Assign( ModsLevel_Stage, m_pPlayerState[p]->m_PlayerOptions.GetPreferred() ); m_SongOptions.Assign( ModsLevel_Stage, m_SongOptions.GetPreferred() ); } - + STATSMAN->m_CurStageStats.fMusicRate = m_SongOptions.GetSong().m_fMusicRate; m_iNumStagesOfThisSong = GetNumStagesForCurrentSong(); ASSERT( m_iNumStagesOfThisSong != -1 ); } diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index da4dc31c63..b5b7ff5f3a 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -27,6 +27,7 @@ StageStats::StageStats() bUsedAutoplay = false; fGameplaySeconds = 0; fStepsSeconds = 0; + fMusicRate = 1; } void StageStats::Init() @@ -129,7 +130,7 @@ float StageStats::GetTotalPossibleStepsSeconds() const float fSecs = 0; FOREACH_CONST( Song*, vpPossibleSongs, s ) fSecs += (*s)->GetStepsSeconds(); - return fSecs; + return fSecs / fMusicRate; } void StageStats::CommitScores( bool bSummary ) diff --git a/stepmania/src/StageStats.h b/stepmania/src/StageStats.h index ed01fe73d8..0a2e6f5e55 100644 --- a/stepmania/src/StageStats.h +++ b/stepmania/src/StageStats.h @@ -40,9 +40,10 @@ public: // They should be made more accurate. float fGameplaySeconds; // how many seconds before gameplay ended. Updated by Gameplay, not scaled by music rate. float fStepsSeconds; // this is <= fGameplaySeconds unless the song has steps past the end + float fMusicRate; // Total number of seconds between first beat and last beat for every song. - float GetTotalPossibleStepsSeconds() const; // TODO: Scale this by the music rate + float GetTotalPossibleStepsSeconds() const; PlayerStageStats m_player[NUM_PLAYERS]; PlayerStageStats m_multiPlayer[NUM_MultiPlayer];