account for lead-out in song progress meter

This commit is contained in:
Chris Danford
2003-12-31 10:32:52 +00:00
parent 7dd057d636
commit 37ebb054d7
+5 -1
View File
@@ -1341,7 +1341,11 @@ void ScreenGameplay::Update( float fDeltaTime )
//
// update song position meter
//
float fPercentPositionSong = GAMESTATE->m_fMusicSeconds / GAMESTATE->m_pCurSong->m_fMusicLengthSeconds;
float fMusicLengthSeconds = GAMESTATE->m_pCurSong->m_fMusicLengthSeconds;
// HACK: most songs have a lead out, so the meter never makes
// it all the way to the right. Fudge by guessing that there's 5 seconds of lead out
fMusicLengthSeconds -= 5;
float fPercentPositionSong = GAMESTATE->m_fMusicSeconds / fMusicLengthSeconds;
CLAMP( fPercentPositionSong, 0, 1 );
m_meterSongPosition.SetPercent( fPercentPositionSong );
}