Simplify and fix comment to reflect what's actually happening.
This commit is contained in:
@@ -55,12 +55,7 @@ void LyricDisplay::Update( float fDeltaTime )
|
|||||||
if( GAMESTATE->m_fMusicSeconds < fStartTime )
|
if( GAMESTATE->m_fMusicSeconds < fStartTime )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const float MaxDisplayTime = 10;
|
/* Clamp this lyric to the beginning of the next, the end of the music, or 3 seconds. */
|
||||||
|
|
||||||
float fShowLength = MaxDisplayTime;
|
|
||||||
|
|
||||||
/* Clamp this lyric to the beginning of the next, the end of the music,
|
|
||||||
* or 5 seconds. */
|
|
||||||
float fEndTime;
|
float fEndTime;
|
||||||
if( m_iCurLyricNumber+1 < GAMESTATE->m_pCurSong->m_LyricSegments.size() )
|
if( m_iCurLyricNumber+1 < GAMESTATE->m_pCurSong->m_LyricSegments.size() )
|
||||||
fEndTime = pSong->m_LyricSegments[m_iCurLyricNumber+1].m_fStartTime;
|
fEndTime = pSong->m_LyricSegments[m_iCurLyricNumber+1].m_fStartTime;
|
||||||
@@ -70,13 +65,10 @@ void LyricDisplay::Update( float fDeltaTime )
|
|||||||
const float fDistance = fEndTime - pSong->m_LyricSegments[m_iCurLyricNumber].m_fStartTime;
|
const float fDistance = fEndTime - pSong->m_LyricSegments[m_iCurLyricNumber].m_fStartTime;
|
||||||
const float fTweenBufferTime = g_fTweenInTime + g_fTweenOutTime;
|
const float fTweenBufferTime = g_fTweenInTime + g_fTweenOutTime;
|
||||||
|
|
||||||
fShowLength = min( fShowLength, fDistance - fTweenBufferTime );
|
|
||||||
fShowLength = min( fShowLength, 3 );
|
|
||||||
|
|
||||||
/* If it's negative, two lyrics are so close together that there's no time
|
/* If it's negative, two lyrics are so close together that there's no time
|
||||||
* to tween properly. Lyrics should never be this brief, anyway, so just
|
* to tween properly. Lyrics should never be this brief, anyway, so just
|
||||||
* skip it. */
|
* skip it. */
|
||||||
fShowLength = max( fShowLength, 0 );
|
float fShowLength = clamp( fDistance - fTweenBufferTime, 0.0f, 3.0f );
|
||||||
|
|
||||||
// make lyrics show faster a larger song rates.
|
// make lyrics show faster a larger song rates.
|
||||||
fShowLength /= GAMESTATE->m_SongOptions.m_fMusicRate;
|
fShowLength /= GAMESTATE->m_SongOptions.m_fMusicRate;
|
||||||
|
|||||||
Reference in New Issue
Block a user