From d03db0c4f938222c0cb99e9c3d5930fae1cf53c6 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 13 Sep 2006 02:55:19 +0000 Subject: [PATCH] remove IET_FAST_REPEAT --- stepmania/src/InputFilter.cpp | 2 +- stepmania/src/InputFilter.h | 3 +-- stepmania/src/Screen.cpp | 3 +-- stepmania/src/ScreenCenterImage.cpp | 2 +- stepmania/src/ScreenEdit.cpp | 11 +++++------ stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenMapControllers.cpp | 2 +- stepmania/src/ScreenNetSelectBase.cpp | 2 +- stepmania/src/ScreenNetSelectMusic.cpp | 2 +- stepmania/src/ScreenOptions.cpp | 2 +- stepmania/src/ScreenSelectMusic.cpp | 3 +-- stepmania/src/ScreenSyncOverlay.cpp | 9 +++++---- stepmania/src/ScreenTextEntry.cpp | 1 - 13 files changed, 20 insertions(+), 24 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index ddb2374f86..f043c43837 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -235,7 +235,7 @@ void InputFilter::Update( float fDeltaTime ) /* Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. */ CheckButtonChange( bs, di, now ); - /* Generate IET_FAST_REPEAT and IET_SLOW_REPEAT events. */ + /* Generate IET_SLOW_REPEAT events. */ if( !bs.m_bLastReportedHeld ) { // If the key isn't pressed, and hasn't been pressed for a while (so debouncing diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index 89aaea5c62..ab7575752e 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -10,10 +10,9 @@ enum InputEventType /* The device was just pressed. */ IET_FIRST_PRESS, - /* The device is auto-repeating. These events are guaranteed to be sent only between + /* The device is auto-repeating. This event is guaranteed to be sent only between * IET_FIRST_PRESS and IET_RELEASE pairs. */ IET_SLOW_REPEAT, - IET_FAST_REPEAT, /* The device is no longer pressed. Exactly one IET_RELEASE event will be sent * for each IET_FIRST_PRESS. */ diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 58f1ee7962..a9c97c8617 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -162,7 +162,7 @@ void Screen::MenuSelect( const InputEventPlus &input ) { if(input.type==IET_FIRS void Screen::MenuBack( const InputEventPlus &input ) { - if(!PREFSMAN->m_bDelayedBack || input.type==IET_SLOW_REPEAT || input.type==IET_FAST_REPEAT) + if(!PREFSMAN->m_bDelayedBack || input.type==IET_SLOW_REPEAT ) MenuBack( input.MenuI.player) ; } @@ -184,7 +184,6 @@ void Screen::Input( const InputEventPlus &input ) { case IET_FIRST_PRESS: case IET_SLOW_REPEAT: - case IET_FAST_REPEAT: break; /* OK */ default: return; // don't care diff --git a/stepmania/src/ScreenCenterImage.cpp b/stepmania/src/ScreenCenterImage.cpp index 24e4575768..789b882532 100644 --- a/stepmania/src/ScreenCenterImage.cpp +++ b/stepmania/src/ScreenCenterImage.cpp @@ -131,7 +131,7 @@ void ScreenCenterImage::Input( const InputEventPlus &input ) if( input.DeviceI.level < 0 ) { - if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fScale *= 10; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index eb39d288c1..d33d0b3674 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1474,7 +1474,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; // .001 bpm } - else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + else if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1501,7 +1501,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + else if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1545,7 +1545,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + else if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1571,7 +1571,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) case EDIT_BUTTON_SAMPLE_LENGTH_UP: fDelta = +0.02f; break; } - if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1964,7 +1964,6 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB ) } break; case IET_SLOW_REPEAT: - case IET_FAST_REPEAT: case IET_RELEASE: // don't add or extend holds here; we do it in Update() break; @@ -2060,7 +2059,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB ) { fOffsetDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + else if( input.type == IET_SLOW_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fOffsetDelta *= 10; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 289b7c3549..77ea0801a6 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2118,7 +2118,7 @@ void ScreenGameplay::Input( const InputEventPlus &input ) if( input.MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP ) { if( ((!PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS) || - (input.DeviceI.device==DEVICE_KEYBOARD && (input.type==IET_SLOW_REPEAT||input.type==IET_FAST_REPEAT)) || + (input.DeviceI.device==DEVICE_KEYBOARD && input.type==IET_SLOW_REPEAT) || (input.DeviceI.device!=DEVICE_KEYBOARD && INPUTFILTER->GetSecsHeld(input.DeviceI) >= 1.0f)) ) { LOG->Trace("Player %i went back", input.MenuI.player+1); diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index 39cd64e445..e7902418ad 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -234,7 +234,7 @@ static bool IsAxis( const DeviceInput& DeviceI ) void ScreenMapControllers::Input( const InputEventPlus &input ) { - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT && input.type != IET_FAST_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) return; // ignore if( IsTransitioning() ) return; // ignore diff --git a/stepmania/src/ScreenNetSelectBase.cpp b/stepmania/src/ScreenNetSelectBase.cpp index d264adb5f1..cec4500af9 100644 --- a/stepmania/src/ScreenNetSelectBase.cpp +++ b/stepmania/src/ScreenNetSelectBase.cpp @@ -92,7 +92,7 @@ void ScreenNetSelectBase::Input( const InputEventPlus &input ) if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) return; - if( (input.type != IET_FIRST_PRESS) && (input.type != IET_SLOW_REPEAT) && (input.type != IET_FAST_REPEAT ) ) + if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) return; bool bHoldingCtrl = diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index b040482ccb..69333334da 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -123,7 +123,7 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input ) return; } - if( (input.type != IET_FIRST_PRESS) && (input.type != IET_SLOW_REPEAT) && (input.type != IET_FAST_REPEAT ) ) + if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) return; bool bHoldingCtrl = diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index fe1cf83693..3e54de6f4a 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1217,7 +1217,7 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir ) ASSERT( iDir == -1 || iDir == +1 ); PlayerNumber pn = input.MenuI.player; - if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) + if( input.type == IET_SLOW_REPEAT ) { /* If down is pressed, don't allow up to repeat, and vice versa. This prevents * holding both up and down from toggling repeatedly in-place. */ diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index b88b58be62..8a0c2b01a6 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -301,8 +301,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) if( !m_bAllowOptionsMenu ) return; /* not allowed */ - if( !m_bAllowOptionsMenuRepeat && - (input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT )) + if( !m_bAllowOptionsMenuRepeat && input.type == IET_SLOW_REPEAT ) { return; /* not allowed yet */ } diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index a5230accc4..f54e41ba20 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -183,12 +183,10 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input ) { case IET_RELEASE: fDelta *= 0; break; case IET_SLOW_REPEAT: - case IET_FAST_REPEAT: if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 0; else fDelta *= 10; - fDelta *= 10; break; } if( GAMESTATE->m_pCurSong != NULL ) { @@ -209,8 +207,11 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input ) switch( input.type ) { case IET_RELEASE: fDelta *= 0; break; - case IET_SLOW_REPEAT: fDelta *= 0; break; - case IET_FAST_REPEAT: fDelta *= 10; break; + case IET_SLOW_REPEAT: + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 0; + else + fDelta *= 10; } switch( a ) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 3e011ae918..2467a9da96 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -187,7 +187,6 @@ void ScreenTextEntry::Input( const InputEventPlus &input ) { case IET_FIRST_PRESS: case IET_SLOW_REPEAT: - case IET_FAST_REPEAT: BackspaceInAnswer(); break; }