From 37ebb054d7f7f0b2418bb81c4b49e6e9560d0ef9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 31 Dec 2003 10:32:52 +0000 Subject: [PATCH] account for lead-out in song progress meter --- stepmania/src/ScreenGameplay.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 0bf76ff8fe..3457caf6a0 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -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 ); }