diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index b219d504ef..388ce6525c 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -747,7 +747,7 @@ bool InputMapper::ClearFromInputMap( const GameInput &GameI, int iSlotIndex ) return true; } -bool InputMapper::IsMapped( const DeviceInput &DeviceI ) +bool InputMapper::IsMapped( const DeviceInput &DeviceI ) const { return g_tempDItoGI.find(DeviceI) != g_tempDItoGI.end(); } @@ -772,19 +772,19 @@ void InputMapper::UpdateTempDItoGI() } } -bool InputMapper::DeviceToGame( const DeviceInput &DeviceI, GameInput& GameI ) // return true if there is a mapping from device to pad +bool InputMapper::DeviceToGame( const DeviceInput &DeviceI, GameInput& GameI ) const // return true if there is a mapping from device to pad { GameI = g_tempDItoGI[DeviceI]; return GameI.controller != GameController_Invalid; } -bool InputMapper::GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ) // return true if there is a mapping from pad to device +bool InputMapper::GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ) const // return true if there is a mapping from pad to device { DeviceI = m_mappings.m_GItoDI[GameI.controller][GameI.button][iSlotNum]; return DeviceI.device != InputDevice_Invalid; } -PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) +PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) const { if( controller == GameController_Invalid ) return PLAYER_INVALID; @@ -794,7 +794,7 @@ PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) return (PlayerNumber) controller; } -GameButton InputMapper::GameButtonToMenuButton( GameButton gb ) +GameButton InputMapper::GameButtonToMenuButton( GameButton gb ) const { return m_pInputScheme->GameButtonToMenuButton( gb ); } @@ -808,7 +808,7 @@ void InputMapper::SetJoinControllers( PlayerNumber pn ) } -void InputMapper::MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ) +void InputMapper::MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ) const { if( g_JoinControllers != PLAYER_INVALID ) pn = PLAYER_INVALID; @@ -817,7 +817,7 @@ void InputMapper::MenuToGame( GameButton MenuI, PlayerNumber pn, vector GameI; MenuToGame( MenuI, pn, GameI ); @@ -865,7 +865,7 @@ void InputMapper::RepeatStopKey( GameButton MenuI, PlayerNumber pn ) RepeatStopKey( GameI[i] ); } -float InputMapper::GetSecsHeld( const GameInput &GameI, MultiPlayer mp ) +float InputMapper::GetSecsHeld( const GameInput &GameI, MultiPlayer mp ) const { float fMaxSecsHeld = 0; @@ -883,7 +883,7 @@ float InputMapper::GetSecsHeld( const GameInput &GameI, MultiPlayer mp ) return fMaxSecsHeld; } -float InputMapper::GetSecsHeld( GameButton MenuI, PlayerNumber pn ) +float InputMapper::GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const { float fMaxSecsHeld = 0; @@ -913,7 +913,7 @@ void InputMapper::ResetKeyRepeat( GameButton MenuI, PlayerNumber pn ) ResetKeyRepeat( GameI[i] ); } -float InputMapper::GetLevel( const GameInput &GameI ) +float InputMapper::GetLevel( const GameInput &GameI ) const { float fLevel = 0; for( int i=0; i GameI; MenuToGame( MenuI, pn, GameI ); diff --git a/stepmania/src/InputMapper.h b/stepmania/src/InputMapper.h index 09db9c4a4f..b8f15635fb 100644 --- a/stepmania/src/InputMapper.h +++ b/stepmania/src/InputMapper.h @@ -174,20 +174,20 @@ public: void AutoMapJoysticksForCurrentGame(); bool CheckForChangedInputDevicesAndRemap( RString &sMessageOut ); - bool IsMapped( const DeviceInput &DeviceI ); + bool IsMapped( const DeviceInput &DeviceI ) const; - bool DeviceToGame( const DeviceInput &DeviceI, GameInput& GameI ); // return true if there is a mapping from device to pad - bool GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ); // return true if there is a mapping from pad to device + bool DeviceToGame( const DeviceInput &DeviceI, GameInput& GameI ) const; // return true if there is a mapping from device to pad + bool GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInput& DeviceI ) const; // return true if there is a mapping from pad to device - GameButton GameButtonToMenuButton( GameButton gb ); - void MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ); - PlayerNumber ControllerToPlayerNumber( GameController controller ); + GameButton GameButtonToMenuButton( GameButton gb ) const; + void MenuToGame( GameButton MenuI, PlayerNumber pn, vector &GameIout ) const; + PlayerNumber ControllerToPlayerNumber( GameController controller ) const; - float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid ); - float GetSecsHeld( GameButton MenuI, PlayerNumber pn ); + float GetSecsHeld( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid ) const; + float GetSecsHeld( GameButton MenuI, PlayerNumber pn ) const; - bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = NULL ); - bool IsBeingPressed( GameButton MenuI, PlayerNumber pn ); + bool IsBeingPressed( const GameInput &GameI, MultiPlayer mp = MultiPlayer_Invalid, const DeviceInputList *pButtonState = NULL ) const; + bool IsBeingPressed( GameButton MenuI, PlayerNumber pn ) const; void ResetKeyRepeat( const GameInput &GameI ); void ResetKeyRepeat( GameButton MenuI, PlayerNumber pn ); @@ -195,8 +195,8 @@ public: void RepeatStopKey( const GameInput &GameI ); void RepeatStopKey( GameButton MenuI, PlayerNumber pn ); - float GetLevel( const GameInput &GameI ); - float GetLevel( GameButton MenuI, PlayerNumber pn ); + float GetLevel( const GameInput &GameI ) const; + float GetLevel( GameButton MenuI, PlayerNumber pn ) const; static InputDevice MultiPlayerToInputDevice( MultiPlayer mp ); static MultiPlayer InputDeviceToMultiPlayer( InputDevice id );