From ec3b9382d2726eb08593a2a6ecfd0c20a8f66c4e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 8 Sep 2006 02:12:30 +0000 Subject: [PATCH] InputMapper::IsButtonDown -> IsBeingPressed, to match InputFilter::IsBeingPressed --- stepmania/src/CodeDetector.cpp | 2 +- stepmania/src/InputMapper.cpp | 10 +++++----- stepmania/src/InputMapper.h | 9 ++++++--- stepmania/src/LightsManager.cpp | 2 +- stepmania/src/Player.cpp | 6 +++--- stepmania/src/ScreenEdit.cpp | 2 +- stepmania/src/ScreenNetSelectMusic.cpp | 8 ++++---- stepmania/src/ScreenOptions.cpp | 12 ++++++------ stepmania/src/ScreenSelectMusic.cpp | 8 ++++---- stepmania/src/ScreenSetTime.cpp | 4 ++-- 10 files changed, 33 insertions(+), 30 deletions(-) diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index 6a7134c953..f52f713101 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -74,7 +74,7 @@ bool CodeItem::EnteredCode( GameController controller ) const for( unsigned i=0; iIsButtonDown(gi) ) + if( !INPUTMAPPER->IsBeingPressed(gi) ) return false; } // just pressed the last button diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index ccbd6073d5..5226dd99d4 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -802,7 +802,7 @@ void InputMapper::MenuToGame( const MenuInput &MenuI, GameInput GameIout[4] ) } -bool InputMapper::IsButtonDown( const GameInput &GameI, MultiPlayer mp ) +bool InputMapper::IsBeingPressed( const GameInput &GameI, MultiPlayer mp ) { for( int i=0; iIsButtonDown( GameInput(gc,gb) ); + bool bOn = INPUTMAPPER->IsBeingPressed( GameInput(gc,gb) ); m_LightsState.m_bGameButtonLights[gc][gb] = bOn; } } diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 0338742c69..16d22acc35 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -544,7 +544,7 @@ void Player::Update( float fDeltaTime ) PlayerNumber pn = m_pPlayerState->m_PlayerNumber; const StyleInput StyleI( pn, col ); - bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( StyleI ); + bool bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI ); // TODO: Make this work for non-human-controlled players if( bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox && m_pPlayerState->m_PlayerController==PC_HUMAN ) if( m_pNoteField ) @@ -622,7 +622,7 @@ void Player::Update( float fDeltaTime ) else { const StyleInput StyleI( pn, iTrack ); - bIsHoldingButton = INPUTMAPPER->IsButtonDown( StyleI, m_pPlayerState->m_mp ); + bIsHoldingButton = INPUTMAPPER->IsBeingPressed( StyleI, m_pPlayerState->m_mp ); } int iEndRow = iRow + tn.iDuration; @@ -1501,7 +1501,7 @@ void Player::CrossedMineRow( int iNoteRow, const RageTimer &now ) } else { - bool bIsDown = INPUTMAPPER->IsButtonDown( StyleI, m_pPlayerState->m_mp ); + bool bIsDown = INPUTMAPPER->IsBeingPressed( StyleI, m_pPlayerState->m_mp ); if( bIsDown ) Step( t, iNoteRow, now, true, false ); } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index cd54aa9a11..a765cedccd 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -935,7 +935,7 @@ void ScreenEdit::Update( float fDeltaTime ) for( int t=0; tGetCurrentStyle()->m_iColsPerPlayer; t++ ) // for each track { StyleInput StyleI( PLAYER_1, t ); - if( INPUTMAPPER->IsButtonDown(StyleI) ) + if( INPUTMAPPER->IsBeingPressed(StyleI) ) bButtonIsBeingPressed = true; } diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 9fa1d559b2..b040482ccb 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -321,8 +321,8 @@ done: void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn ) { - bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ); - bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ); + bool bLeftPressed = INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_LEFT) ); + bool bRightPressed = INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_RIGHT) ); bool bLeftAndRightPressed = bLeftPressed && bRightPressed; if ( bLeftAndRightPressed ) @@ -333,8 +333,8 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn ) void ScreenNetSelectMusic::MenuRight( PlayerNumber pn ) { - bool bLeftPressed = INPUTMAPPER->IsButtonDown( MenuInput (pn, MENU_BUTTON_LEFT) ); - bool bRightPressed = INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) ; + bool bLeftPressed = INPUTMAPPER->IsBeingPressed( MenuInput (pn, MENU_BUTTON_LEFT) ); + bool bRightPressed = INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_RIGHT) ) ; bool bLeftAndRightPressed = bLeftPressed && bRightPressed; if ( bLeftAndRightPressed ) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 3adfbef3ef..fe1cf83693 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -794,8 +794,8 @@ void ScreenOptions::MenuStart( const InputEventPlus &input ) case NAV_TOGGLE_THREE_KEY: { bool bHoldingLeftAndRight = - INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) && - INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ); + INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_RIGHT) ) && + INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_LEFT) ); if( bHoldingLeftAndRight ) { if( MoveRowRelative(pn, -1, input.type != IET_FIRST_PRESS) ) @@ -1223,14 +1223,14 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir ) * holding both up and down from toggling repeatedly in-place. */ if( iDir == +1 ) { - if( INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_UP)) || - INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_SELECT)) ) + if( INPUTMAPPER->IsBeingPressed(MenuInput(pn, MENU_BUTTON_UP)) || + INPUTMAPPER->IsBeingPressed(MenuInput(pn, MENU_BUTTON_SELECT)) ) return; } else { - if( INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_DOWN)) || - INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_START)) ) + if( INPUTMAPPER->IsBeingPressed(MenuInput(pn, MENU_BUTTON_DOWN)) || + INPUTMAPPER->IsBeingPressed(MenuInput(pn, MENU_BUTTON_START)) ) return; } } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index bb6d299bbf..a086e1058e 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -339,7 +339,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) return; } - if( SELECT_MENU_AVAILABLE && INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_SELECT) ) ) + if( SELECT_MENU_AVAILABLE && INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_SELECT) ) ) { if( input.type == IET_FIRST_PRESS ) { @@ -375,8 +375,8 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) bool bRightIsDown = false; FOREACH_EnabledPlayer( p ) { - bLeftIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) ); - bRightIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) ); + bLeftIsDown |= INPUTMAPPER->IsBeingPressed( MenuInput(p, MENU_BUTTON_LEFT) ); + bRightIsDown |= INPUTMAPPER->IsBeingPressed( MenuInput(p, MENU_BUTTON_RIGHT) ); } bool bBothDown = bLeftIsDown && bRightIsDown; @@ -512,7 +512,7 @@ void ScreenSelectMusic::UpdateSelectButton() { bool bSelectIsDown = false; FOREACH_EnabledPlayer( p ) - bSelectIsDown |= INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_SELECT) ); + bSelectIsDown |= INPUTMAPPER->IsBeingPressed( MenuInput(p, MENU_BUTTON_SELECT) ); if( !SELECT_MENU_AVAILABLE ) bSelectIsDown = false; diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index 84a41a4ca2..f286c02bb8 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -184,8 +184,8 @@ void ScreenSetTime::MenuRight( PlayerNumber pn ) void ScreenSetTime::MenuStart( PlayerNumber pn ) { bool bHoldingLeftAndRight = - INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_RIGHT) ) && - INPUTMAPPER->IsButtonDown( MenuInput(pn, MENU_BUTTON_LEFT) ); + INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_RIGHT) ) && + INPUTMAPPER->IsBeingPressed( MenuInput(pn, MENU_BUTTON_LEFT) ); if( bHoldingLeftAndRight ) ChangeSelection( -1 );