From 85fc5a2dfbf98d5afc9b8da57c8edf00e6a9a7ff Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 30 Sep 2006 05:52:06 +0000 Subject: [PATCH] simplify (now InputMapper::ControllerToPlayerNumber logic is the same as InputMapper::MenuToGame) --- stepmania/src/InputMapper.cpp | 4 ++-- stepmania/src/Style.cpp | 14 -------------- stepmania/src/Style.h | 2 -- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index 61c315da35..5cf991c389 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -763,8 +763,8 @@ bool InputMapper::GameToDevice( const GameInput &GameI, int iSlotNum, DeviceInpu PlayerNumber InputMapper::ControllerToPlayerNumber( GameController controller ) { - if( GAMESTATE->GetCurrentStyle() ) - return GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber(controller); + if( GAMESTATE->GetCurrentStyle() && GAMESTATE->GetCurrentStyle()->m_StyleType == ONE_PLAYER_TWO_SIDES ) + return GAMESTATE->m_MasterPlayerNumber; else return (PlayerNumber) controller; } diff --git a/stepmania/src/Style.cpp b/stepmania/src/Style.cpp index fabb9a0a6b..66e8125cde 100644 --- a/stepmania/src/Style.cpp +++ b/stepmania/src/Style.cpp @@ -68,20 +68,6 @@ int Style::GameInputToColumn( const GameInput &GameI ) const } -PlayerNumber Style::ControllerToPlayerNumber( GameController controller ) const -{ - switch( m_StyleType ) - { - case ONE_PLAYER_ONE_SIDE: - case TWO_PLAYERS_TWO_SIDES: - case TWO_PLAYERS_SHARED_SIDES: - return (PlayerNumber)controller; - case ONE_PLAYER_TWO_SIDES: - return GAMESTATE->m_MasterPlayerNumber; - DEFAULT_FAIL( m_StyleType ); - } -} - void Style::GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const { ASSERT( pn != PLAYER_INVALID ); diff --git a/stepmania/src/Style.h b/stepmania/src/Style.h index 4d8678f433..570009e4c3 100644 --- a/stepmania/src/Style.h +++ b/stepmania/src/Style.h @@ -57,8 +57,6 @@ public: int GameInputToColumn( const GameInput &GameI ) const; RString ColToButtonName( int iCol ) const; - PlayerNumber ControllerToPlayerNumber( GameController controller ) const; - void GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const; void GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const;