GameController_Invalid
This commit is contained in:
@@ -60,7 +60,7 @@ static CodeItem g_CodeItems[NUM_Code];
|
|||||||
|
|
||||||
bool CodeItem::EnteredCode( GameController controller ) const
|
bool CodeItem::EnteredCode( GameController controller ) const
|
||||||
{
|
{
|
||||||
if( controller == GAME_CONTROLLER_INVALID )
|
if( controller == GameController_Invalid )
|
||||||
return false;
|
return false;
|
||||||
if( buttons.size() == 0 )
|
if( buttons.size() == 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ bool GameInput::FromString( const Game* pGame, const RString &s )
|
|||||||
|
|
||||||
if( 2 != sscanf( s, "%31[^_]_%31[^_]", szController, szButton ) )
|
if( 2 != sscanf( s, "%31[^_]_%31[^_]", szController, szButton ) )
|
||||||
{
|
{
|
||||||
controller = GAME_CONTROLLER_INVALID;
|
controller = GameController_Invalid;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ enum GameController
|
|||||||
GAME_CONTROLLER_1 = 0, // left controller
|
GAME_CONTROLLER_1 = 0, // left controller
|
||||||
GAME_CONTROLLER_2, // right controller
|
GAME_CONTROLLER_2, // right controller
|
||||||
NUM_GameController, // leave this at the end
|
NUM_GameController, // leave this at the end
|
||||||
GAME_CONTROLLER_INVALID,
|
GameController_Invalid,
|
||||||
};
|
};
|
||||||
#define FOREACH_GameController( gc ) FOREACH_ENUM( GameController, NUM_GameController, gc )
|
#define FOREACH_GameController( gc ) FOREACH_ENUM( GameController, NUM_GameController, gc )
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ enum // LightsButtons
|
|||||||
|
|
||||||
struct GameInput
|
struct GameInput
|
||||||
{
|
{
|
||||||
GameInput(): controller(GAME_CONTROLLER_INVALID), button(GAME_BUTTON_INVALID) { }
|
GameInput(): controller(GameController_Invalid), button(GAME_BUTTON_INVALID) { }
|
||||||
|
|
||||||
GameInput( GameController c, GameButton b ): controller(c), button(b) { }
|
GameInput( GameController c, GameButton b ): controller(c), button(b) { }
|
||||||
|
|
||||||
@@ -257,8 +257,8 @@ struct GameInput
|
|||||||
return button < other.button;
|
return button < other.button;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsValid() const { return controller != GAME_CONTROLLER_INVALID; };
|
inline bool IsValid() const { return controller != GameController_Invalid; };
|
||||||
inline void MakeInvalid() { controller = GAME_CONTROLLER_INVALID; button = GAME_BUTTON_INVALID; };
|
inline void MakeInvalid() { controller = GameController_Invalid; button = GAME_BUTTON_INVALID; };
|
||||||
|
|
||||||
RString ToString( const Game* pGame ) const;
|
RString ToString( const Game* pGame ) const;
|
||||||
bool FromString( const Game* pGame, const RString &s );
|
bool FromString( const Game* pGame, const RString &s );
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ 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 ) // return true if there is a mapping from device to pad
|
||||||
{
|
{
|
||||||
GameI = g_tempDItoGI[DeviceI];
|
GameI = g_tempDItoGI[DeviceI];
|
||||||
return GameI.controller != GAME_CONTROLLER_INVALID;
|
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 ) // return true if there is a mapping from pad to device
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void InputQueue::RememberInput( const InputEventPlus &iep )
|
|||||||
|
|
||||||
bool InputQueue::MatchesSequence( GameController c, const GameButton* button_sequence, const int iNumButtons, float fMaxSecondsBack )
|
bool InputQueue::MatchesSequence( GameController c, const GameButton* button_sequence, const int iNumButtons, float fMaxSecondsBack )
|
||||||
{
|
{
|
||||||
if( c == GAME_CONTROLLER_INVALID )
|
if( c == GameController_Invalid )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( fMaxSecondsBack == -1 )
|
if( fMaxSecondsBack == -1 )
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ void LightsManager::GetFirstLitGameButtonLight( GameController &gcOut, GameButto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gcOut = GAME_CONTROLLER_INVALID;
|
gcOut = GameController_Invalid;
|
||||||
gbOut = GAME_BUTTON_INVALID;
|
gbOut = GAME_BUTTON_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2091,7 +2091,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
|
|||||||
/* If we're paused, only accept MENU_BUTTON_START to unpause. */
|
/* If we're paused, only accept MENU_BUTTON_START to unpause. */
|
||||||
if( GAMESTATE->IsHumanPlayer(input.pn) && input.MenuI == MENU_BUTTON_START && input.type == IET_FIRST_PRESS )
|
if( GAMESTATE->IsHumanPlayer(input.pn) && input.MenuI == MENU_BUTTON_START && input.type == IET_FIRST_PRESS )
|
||||||
{
|
{
|
||||||
if( m_PauseController == GAME_CONTROLLER_INVALID || m_PauseController == input.GameI.controller )
|
if( m_PauseController == GameController_Invalid || m_PauseController == input.GameI.controller )
|
||||||
this->PauseGame( false );
|
this->PauseGame( false );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ protected:
|
|||||||
void LoadCourseSongNumber( int SongNumber );
|
void LoadCourseSongNumber( int SongNumber );
|
||||||
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
|
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
|
||||||
void LoadLights();
|
void LoadLights();
|
||||||
void PauseGame( bool bPause, GameController gc = GAME_CONTROLLER_INVALID );
|
void PauseGame( bool bPause, GameController gc = GameController_Invalid );
|
||||||
void PlayAnnouncer( RString type, float fSeconds );
|
void PlayAnnouncer( RString type, float fSeconds );
|
||||||
void UpdateLights();
|
void UpdateLights();
|
||||||
void SendCrossedMessages();
|
void SendCrossedMessages();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void ScreenGameplaySyncMachine::Input( const InputEventPlus &input )
|
|||||||
// Hack to make this work from Player2's controls
|
// Hack to make this work from Player2's controls
|
||||||
InputEventPlus _input = input;
|
InputEventPlus _input = input;
|
||||||
|
|
||||||
if( _input.GameI.controller != GAME_CONTROLLER_INVALID )
|
if( _input.GameI.controller != GameController_Invalid )
|
||||||
_input.GameI.controller = GAME_CONTROLLER_1;
|
_input.GameI.controller = GAME_CONTROLLER_1;
|
||||||
if( _input.pn != PLAYER_INVALID )
|
if( _input.pn != PLAYER_INVALID )
|
||||||
_input.pn = PLAYER_1;
|
_input.pn = PLAYER_1;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void ScreenTestLights::Update( float fDeltaTime )
|
|||||||
else
|
else
|
||||||
s += ssprintf( CABINET_LIGHT.GetValue()+": %d %s\n", cl, CabinetLightToString(cl).c_str() );
|
s += ssprintf( CABINET_LIGHT.GetValue()+": %d %s\n", cl, CabinetLightToString(cl).c_str() );
|
||||||
|
|
||||||
if( gc == GAME_CONTROLLER_INVALID )
|
if( gc == GameController_Invalid )
|
||||||
{
|
{
|
||||||
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": -----\n" );
|
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": -----\n" );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user