From ee9fd1ecc2035af8ccc821c68e6eccde087885c1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Sep 2005 23:22:18 +0000 Subject: [PATCH] remove fast repeat rate. It's the same as the slow rate, and nothing uses it. (IET_FAST_REPEAT kept for now, since some code uses it.) --- stepmania/src/InputFilter.cpp | 17 ++++++----------- stepmania/src/InputFilter.h | 2 +- stepmania/src/ScreenOptions.cpp | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 62372aecb1..daf91a73f1 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -29,10 +29,9 @@ InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our p static const float TIME_BEFORE_SLOW_REPEATS = 0.25f; static const float TIME_BEFORE_FAST_REPEATS = 1.5f; -static const float SLOW_REPEATS_PER_SEC = 8; -static const float FAST_REPEATS_PER_SEC = 8; +static const float REPEATS_PER_SEC = 8; -static float g_fTimeBeforeSlow, g_fTimeBeforeFast, g_fTimeBetweenSlow, g_fTimeBetweenFast; +static float g_fTimeBeforeSlow, g_fTimeBeforeFast, g_fTimeBetweenRepeats; InputFilter::InputFilter() @@ -54,17 +53,16 @@ void InputFilter::Reset() ResetDevice( InputDevice(i) ); } -void InputFilter::SetRepeatRate( float fSlowDelay, float fSlowRate, float fFastDelay, float fFastRate ) +void InputFilter::SetRepeatRate( float fSlowDelay, float fFastDelay, float fRepeatRate ) { g_fTimeBeforeSlow = fSlowDelay; g_fTimeBeforeFast = fFastDelay; - g_fTimeBetweenSlow = 1/fSlowRate; - g_fTimeBetweenFast = 1/fFastRate; + g_fTimeBetweenRepeats = 1/fRepeatRate; } void InputFilter::ResetRepeatRate() { - SetRepeatRate( TIME_BEFORE_SLOW_REPEATS, SLOW_REPEATS_PER_SEC, TIME_BEFORE_FAST_REPEATS, FAST_REPEATS_PER_SEC ); + SetRepeatRate( TIME_BEFORE_SLOW_REPEATS, TIME_BEFORE_FAST_REPEATS, REPEATS_PER_SEC ); } InputFilter::ButtonState::ButtonState(): @@ -180,21 +178,18 @@ void InputFilter::Update(float fDeltaTime) bs.m_fSecsHeld += fDeltaTime; const float fNewHoldTime = bs.m_fSecsHeld; - float fTimeBetweenRepeats; InputEventType iet; if( fOldHoldTime > g_fTimeBeforeSlow ) { if( fOldHoldTime > g_fTimeBeforeFast ) { - fTimeBetweenRepeats = g_fTimeBetweenFast; iet = IET_FAST_REPEAT; } else { - fTimeBetweenRepeats = g_fTimeBetweenSlow; iet = IET_SLOW_REPEAT; } - if( int(fOldHoldTime/fTimeBetweenRepeats) != int(fNewHoldTime/fTimeBetweenRepeats) ) + if( int(fOldHoldTime/g_fTimeBetweenRepeats) != int(fNewHoldTime/g_fTimeBetweenRepeats) ) { queue.push_back( InputEvent(di,iet) ); } diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index 4b3c7735d3..b07363b34f 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -50,7 +50,7 @@ public: void Reset(); void Update(float fDeltaTime); - void SetRepeatRate( float fSlowDelay, float fSlowRate, float fFastDelay, float fFastRate ); + void SetRepeatRate( float fSlowDelay, float fFastDelay, float fRepeatRate ); void ResetRepeatRate(); void ResetKeyRepeat( DeviceInput di ); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index c2143fa033..cb5b8e6d48 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -638,7 +638,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) } else if( SM == SM_GainFocus ) { - INPUTFILTER->SetRepeatRate( 0.25f, 12, 0.25f, 12 ); + INPUTFILTER->SetRepeatRate( 0.25f, 0.25f, 12 ); } else if( SM == SM_LoseFocus ) {