diff --git a/stepmania/src/Game.cpp b/stepmania/src/Game.cpp new file mode 100644 index 0000000000..7956791d8e --- /dev/null +++ b/stepmania/src/Game.cpp @@ -0,0 +1,130 @@ +#include "global.h" +#include "Game.h" +#include "RageLog.h" +#include "RageUtil.h" +#include "IniFile.h" +#include "Style.h" +#include "RageException.h" +#include "GameState.h" +#include "InputMapper.h" +#include "PrefsManager.h" + +int Game::GetNumGameplayButtons() const +{ + int iIndexOfStart = ButtonNameToIndex( "Start" ); + ASSERT( iIndexOfStart != GAME_BUTTON_INVALID ); + return iIndexOfStart; +} + +GameButton Game::ButtonNameToIndex( const CString &sButtonName ) const +{ + for( int i=0; iGetCurrentStyle() ) + type = GAMESTATE->GetCurrentStyle()->m_StyleType; + switch( type ) + { + case Style::ONE_PLAYER_ONE_CREDIT: + case Style::TWO_PLAYERS_TWO_CREDITS: + pn = (PlayerNumber)GameI.controller; + break; + case Style::ONE_PLAYER_TWO_CREDITS: + pn = GAMESTATE->m_MasterPlayerNumber; + break; + default: + ASSERT(0); return MenuInput(); // invalid m_StyleType + }; + + int i; + for( i=0; im_bOnlyDedicatedMenuButtons ) + { + for( i=0; iGetCurrentStyle() ) + type = GAMESTATE->GetCurrentStyle()->m_StyleType; + + int iNumSidesUsing = 1; + switch( type ) + { + case Style::ONE_PLAYER_ONE_CREDIT: + case Style::TWO_PLAYERS_TWO_CREDITS: + controller[0] = (GameController)MenuI.player; + iNumSidesUsing = 1; + break; + case Style::ONE_PLAYER_TWO_CREDITS: + controller[0] = GAME_CONTROLLER_1; + controller[1] = GAME_CONTROLLER_2; + iNumSidesUsing = 2; + break; + default: + ASSERT(0); // invalid m_StyleType + }; + + GameButton button[2] = { m_DedicatedMenuButton[MenuI.button], m_SecondaryMenuButton[MenuI.button] }; + int iNumButtonsUsing = PREFSMAN->m_bOnlyDedicatedMenuButtons ? 1 : 2; + + for( int i=0; i