GameInputToMenuInput -> GameInputToMenuButton; one less place Game.cpp
depends on GameState
This commit is contained in:
+6
-10
@@ -22,27 +22,23 @@ GameButton Game::ButtonNameToIndex( const RString &sButtonName ) const
|
||||
return GAME_BUTTON_INVALID;
|
||||
}
|
||||
|
||||
MenuInput Game::GameInputToMenuInput( GameInput GameI ) const
|
||||
MenuButton Game::GameInputToMenuButton( GameInput GameI ) const
|
||||
{
|
||||
PlayerNumber pn = (PlayerNumber) GameI.controller;
|
||||
if( GAMESTATE->GetCurrentStyle() )
|
||||
pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber(GameI.controller);
|
||||
|
||||
FOREACH_MenuButton(i)
|
||||
if( m_DedicatedMenuButton[i] == GameI.button )
|
||||
return MenuInput( pn, i );
|
||||
return i;
|
||||
|
||||
if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
|
||||
{
|
||||
FOREACH_MenuButton(i)
|
||||
if( m_SecondaryMenuButton[i] == GameI.button )
|
||||
return MenuInput( pn, i );
|
||||
return i;
|
||||
}
|
||||
|
||||
return MenuInput(); // invalid GameInput
|
||||
return MenuButton_INVALID; // invalid GameInput
|
||||
}
|
||||
|
||||
void Game::MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const
|
||||
void Game::MenuInputToGameInput( MenuInput MenuI, PlayerNumber pn, GameInput GameIout[4] ) const
|
||||
{
|
||||
ASSERT( MenuI.IsValid() );
|
||||
|
||||
@@ -61,7 +57,7 @@ void Game::MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const
|
||||
{
|
||||
case ONE_PLAYER_ONE_SIDE:
|
||||
case TWO_PLAYERS_TWO_SIDES:
|
||||
controller[0] = (GameController)MenuI.player;
|
||||
controller[0] = (GameController)pn;
|
||||
iNumSidesUsing = 1;
|
||||
break;
|
||||
case ONE_PLAYER_TWO_SIDES:
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
DeviceButton m_iDefaultKeyboardKey[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // default keyboard keys only have an effect the current game is this game
|
||||
|
||||
GameButton ButtonNameToIndex( const RString &sButtonName ) const;
|
||||
MenuInput GameInputToMenuInput( GameInput GameI ) const; // looks up current style in GAMESTATE. Yuck.
|
||||
void MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const; // looks up current style in GAMESTATE. Yuck.
|
||||
MenuButton GameInputToMenuButton( GameInput GameI ) const;
|
||||
void MenuInputToGameInput( MenuInput MenuI, PlayerNumber pn, GameInput GameIout[4] ) const; // looks up current style in GAMESTATE. Yuck.
|
||||
RString ColToButtonName( int col ) const; // looks up current style. Yuck.
|
||||
|
||||
TapNoteScore MapTapNoteScore( TapNoteScore tns ) const;
|
||||
|
||||
Reference in New Issue
Block a user