From 9fb0d09f356fe1fa7759d2701091a3cdd885bade Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 13 Sep 2006 03:04:04 +0000 Subject: [PATCH] unwrap --- stepmania/src/InputFilter.cpp | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 97c633b1ad..e7f2903f11 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -249,29 +249,29 @@ void InputFilter::Update( float fDeltaTime ) bs.m_fSecsHeld += fDeltaTime; const float fNewHoldTime = bs.m_fSecsHeld; - if( fNewHoldTime > g_fTimeBeforeRepeats ) + if( fNewHoldTime <= g_fTimeBeforeRepeats ) + continue; + + float fRepeatTime; + if( fOldHoldTime < g_fTimeBeforeRepeats ) { - float fRepeatTime; - if( fOldHoldTime < g_fTimeBeforeRepeats ) - { - fRepeatTime = g_fTimeBeforeRepeats; - } - else - { - float fAdjustedOldHoldTime = fOldHoldTime - g_fTimeBeforeRepeats; - float fAdjustedNewHoldTime = fNewHoldTime - g_fTimeBeforeRepeats; - if( int(fAdjustedOldHoldTime/g_fTimeBetweenRepeats) == int(fAdjustedNewHoldTime/g_fTimeBetweenRepeats) ) - continue; - fRepeatTime = ftruncf( fNewHoldTime, g_fTimeBetweenRepeats ); - } - - /* Set the timestamp to the exact time of the repeat. This way, - * as long as tab/` aren't being used, the timestamp will always - * increase steadily during repeats. */ - di.ts = bs.m_LastInputTime + fRepeatTime; - - ReportButtonChange( di, IET_REPEAT ); + fRepeatTime = g_fTimeBeforeRepeats; } + else + { + float fAdjustedOldHoldTime = fOldHoldTime - g_fTimeBeforeRepeats; + float fAdjustedNewHoldTime = fNewHoldTime - g_fTimeBeforeRepeats; + if( int(fAdjustedOldHoldTime/g_fTimeBetweenRepeats) == int(fAdjustedNewHoldTime/g_fTimeBetweenRepeats) ) + continue; + fRepeatTime = ftruncf( fNewHoldTime, g_fTimeBetweenRepeats ); + } + + /* Set the timestamp to the exact time of the repeat. This way, + * as long as tab/` aren't being used, the timestamp will always + * increase steadily during repeats. */ + di.ts = bs.m_LastInputTime + fRepeatTime; + + ReportButtonChange( di, IET_REPEAT ); } FOREACH( ButtonStateMap::iterator, ButtonsToErase, it )