From e04a48128d6eb6f2560e101643a9178d38307f83 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 13 Sep 2006 02:44:03 +0000 Subject: [PATCH] IET_FAST_REPEAT is the same as IET_SLOW_REPEAT, sent instead after the button has been held a while. It hasn't actually been a different repeat rate for a very long time, and was partially phased out a while ago. Now it's just used to see if the button has been held a while. Do that with GetSecsHeld instead. --- stepmania/src/ScreenCenterImage.cpp | 8 +++-- stepmania/src/ScreenEdit.cpp | 53 ++++++++++++++--------------- stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenSyncOverlay.cpp | 9 +++-- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/stepmania/src/ScreenCenterImage.cpp b/stepmania/src/ScreenCenterImage.cpp index d4dfb9ff5a..24e4575768 100644 --- a/stepmania/src/ScreenCenterImage.cpp +++ b/stepmania/src/ScreenCenterImage.cpp @@ -131,10 +131,12 @@ void ScreenCenterImage::Input( const InputEventPlus &input ) if( input.DeviceI.level < 0 ) { - switch( input.type ) + if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - case IET_SLOW_REPEAT: fScale *= 4; break; - case IET_FAST_REPEAT: fScale *= 16; break; + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fScale *= 10; + else + fScale *= 40; } if( !bIncrease ) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index a774732256..eb39d288c1 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1474,13 +1474,12 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; // .001 bpm } - else + else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - switch( input.type ) - { - case IET_SLOW_REPEAT: fDelta *= 10; break; - case IET_FAST_REPEAT: fDelta *= 40; break; - } + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 10; + else + fDelta *= 40; } float fNewBPM = fBPM + fDelta; @@ -1502,13 +1501,12 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else + else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - switch( input.type ) - { - case IET_SLOW_REPEAT: fDelta *= 10; break; - case IET_FAST_REPEAT: fDelta *= 40; break; - } + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 10; + else + fDelta *= 40; } unsigned i; for( i=0; im_Timing.m_StopSegments.size(); i++ ) @@ -1547,13 +1545,12 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else + else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - switch( input.type ) - { - case IET_SLOW_REPEAT: fDelta *= 10; break; - case IET_FAST_REPEAT: fDelta *= 40; break; - } + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 10; + else + fDelta *= 40; } m_pSong->m_Timing.m_fBeat0OffsetInSeconds += fDelta; (fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play(); @@ -1573,10 +1570,13 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) case EDIT_BUTTON_SAMPLE_LENGTH_DOWN: fDelta = -0.02f; break; case EDIT_BUTTON_SAMPLE_LENGTH_UP: fDelta = +0.02f; break; } - switch( input.type ) + + if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - case IET_SLOW_REPEAT: fDelta *= 10; break; - case IET_FAST_REPEAT: fDelta *= 40; break; + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 10; + else + fDelta *= 40; } if( EditB == EDIT_BUTTON_SAMPLE_LENGTH_DOWN || EditB == EDIT_BUTTON_SAMPLE_LENGTH_UP ) @@ -2060,13 +2060,12 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB ) { fOffsetDelta /= 20; /* 1ms */ } - else + else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) { - switch( input.type ) - { - case IET_SLOW_REPEAT: fOffsetDelta *= 10; break; - case IET_FAST_REPEAT: fOffsetDelta *= 40; break; - } + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fOffsetDelta *= 10; + else + fOffsetDelta *= 40; } m_pSong->m_Timing.m_fBeat0OffsetInSeconds += fOffsetDelta; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 34eae1827a..289b7c3549 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2119,7 +2119,7 @@ void ScreenGameplay::Input( const InputEventPlus &input ) { 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_FAST_REPEAT)) ) + (input.DeviceI.device!=DEVICE_KEYBOARD && INPUTFILTER->GetSecsHeld(input.DeviceI) >= 1.0f)) ) { LOG->Trace("Player %i went back", input.MenuI.player+1); BeginBackingOutFromGameplay(); diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index 7676263c11..a5230accc4 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -182,8 +182,13 @@ 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: + case IET_FAST_REPEAT: + if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) + fDelta *= 0; + else + fDelta *= 10; + fDelta *= 10; break; } if( GAMESTATE->m_pCurSong != NULL ) {