cleanup MultiPlayer/InputDevice mapping
This commit is contained in:
@@ -695,6 +695,16 @@ void InputMapper::ResetKeyRepeat( StyleInput StyleI )
|
|||||||
ResetKeyRepeat( GameI );
|
ResetKeyRepeat( GameI );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InputDevice InputMapper::MultiPlayerToInputDevice( MultiPlayer mp )
|
||||||
|
{
|
||||||
|
return (InputDevice)(mp + DEVICE_JOY1);
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiPlayer InputMapper::InputDeviceToMultiPlayer( InputDevice id )
|
||||||
|
{
|
||||||
|
return (MultiPlayer)(id - DEVICE_JOY1);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2003 Chris Danford
|
* (c) 2001-2003 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ public:
|
|||||||
bool SecondController;
|
bool SecondController;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static InputDevice MultiPlayerToInputDevice( MultiPlayer mp );
|
||||||
|
static MultiPlayer InputDeviceToMultiPlayer( InputDevice id );
|
||||||
|
|
||||||
void ApplyMapping( const Mapping *maps, GameController gc, InputDevice device );
|
void ApplyMapping( const Mapping *maps, GameController gc, InputDevice device );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -2200,7 +2200,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
StyleInput _StyleI;
|
StyleInput _StyleI;
|
||||||
INPUTMAPPER->GameToStyle( _GameI, _StyleI );
|
INPUTMAPPER->GameToStyle( _GameI, _StyleI );
|
||||||
|
|
||||||
mp = (MultiPlayer)(DeviceI.device - DEVICE_JOY1);
|
mp = InputMapper::InputDeviceToMultiPlayer( DeviceI.device );
|
||||||
|
|
||||||
if( mp>=0 && mp<NUM_MultiPlayer )
|
if( mp>=0 && mp<NUM_MultiPlayer )
|
||||||
m_vPlayerInfo[mp].m_pPlayer->Step( _StyleI.col, DeviceI.ts );
|
m_vPlayerInfo[mp].m_pPlayer->Step( _StyleI.col, DeviceI.ts );
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ void ScreenJoinMultiplayer::Init()
|
|||||||
GAMESTATE->m_pCurStyle.Set( v[0] );
|
GAMESTATE->m_pCurStyle.Set( v[0] );
|
||||||
|
|
||||||
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR );
|
||||||
|
|
||||||
GAMESTATE->m_bTemporaryEventMode = true;
|
GAMESTATE->m_bTemporaryEventMode = true;
|
||||||
|
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||||
|
|
||||||
FOREACH_MultiPlayer( p )
|
FOREACH_MultiPlayer( p )
|
||||||
{
|
{
|
||||||
@@ -113,12 +113,12 @@ void ScreenJoinMultiplayer::Input( const DeviceInput& DeviceI, const InputEventT
|
|||||||
GameInput gi;
|
GameInput gi;
|
||||||
INPUTMAPPER->DeviceToGame( di, gi );
|
INPUTMAPPER->DeviceToGame( di, gi );
|
||||||
|
|
||||||
if( GameI.IsValid() )
|
if( gi.IsValid() )
|
||||||
{
|
{
|
||||||
MenuInput mi;
|
MenuInput mi;
|
||||||
INPUTMAPPER->GameToMenu( gi, mi );
|
INPUTMAPPER->GameToMenu( gi, mi );
|
||||||
|
|
||||||
MultiPlayer p = (MultiPlayer)(DeviceI.device - DEVICE_JOY1);
|
MultiPlayer p = InputMapper::InputDeviceToMultiPlayer( DeviceI.device );
|
||||||
|
|
||||||
// testing hack
|
// testing hack
|
||||||
if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD,KEY_LSHIFT) ) )
|
if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD,KEY_LSHIFT) ) )
|
||||||
@@ -179,7 +179,7 @@ void ScreenJoinMultiplayer::UpdatePlayerStatus( bool bFirstUpdate )
|
|||||||
{
|
{
|
||||||
FOREACH_MultiPlayer( p )
|
FOREACH_MultiPlayer( p )
|
||||||
{
|
{
|
||||||
InputDevice id = (InputDevice)p;
|
InputDevice id = InputMapper::MultiPlayerToInputDevice( p );
|
||||||
|
|
||||||
InputDeviceState idsOld = m_InputDeviceState[p];
|
InputDeviceState idsOld = m_InputDeviceState[p];
|
||||||
bool bWasConnected = idsOld == InputDeviceState_Connected;
|
bool bWasConnected = idsOld == InputDeviceState_Connected;
|
||||||
|
|||||||
Reference in New Issue
Block a user