simplify
This commit is contained in:
@@ -771,15 +771,12 @@ bool InputMapper::GameToDevice( const GameInput &GameI, int iSoltNum, DeviceInpu
|
|||||||
return DeviceI.device != DEVICE_NONE;
|
return DeviceI.device != DEVICE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputMapper::GameToStyle( const GameInput &GameI, StyleInput &StyleI )
|
StyleInput InputMapper::GameToStyle( const GameInput &GameI )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->m_pCurStyle == NULL )
|
if( GAMESTATE->m_pCurStyle == NULL )
|
||||||
{
|
return StyleInput_INVALID;
|
||||||
StyleI.MakeInvalid();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
StyleI = GAMESTATE->m_pCurStyle->GameInputToStyleInput( GameI );
|
return GAMESTATE->m_pCurStyle->GameInputToStyleInput( GameI );
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputMapper::GameToMenu( const GameInput &GameI, MenuInput &MenuI )
|
void InputMapper::GameToMenu( const GameInput &GameI, MenuInput &MenuI )
|
||||||
|
|||||||
@@ -1404,11 +1404,6 @@ void HandleInputEvents(float fDeltaTime)
|
|||||||
|
|
||||||
if( input.GameI.IsValid() && input.type == IET_FIRST_PRESS )
|
if( input.GameI.IsValid() && input.type == IET_FIRST_PRESS )
|
||||||
INPUTQUEUE->RememberInput( input );
|
INPUTQUEUE->RememberInput( input );
|
||||||
if( input.GameI.IsValid() )
|
|
||||||
{
|
|
||||||
INPUTMAPPER->GameToMenu( input.GameI, input.MenuI );
|
|
||||||
INPUTMAPPER->GameToStyle( input.GameI, input.StyleI );
|
|
||||||
}
|
|
||||||
|
|
||||||
input.mp = MultiPlayer_INVALID;
|
input.mp = MultiPlayer_INVALID;
|
||||||
|
|
||||||
@@ -1428,13 +1423,8 @@ void HandleInputEvents(float fDeltaTime)
|
|||||||
{
|
{
|
||||||
input.GameI = gi;
|
input.GameI = gi;
|
||||||
//LOG->Trace( "game %d %d", input.GameI.controller, input.GameI.button );
|
//LOG->Trace( "game %d %d", input.GameI.controller, input.GameI.button );
|
||||||
INPUTMAPPER->GameToStyle( input.GameI, input.StyleI );
|
|
||||||
INPUTMAPPER->GameToMenu( input.GameI, input.MenuI );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//LOG->Trace( "style %d %d", input.StyleI.player, input.StyleI.col );
|
|
||||||
//LOG->Trace( "menu %d %d", input.MenuI.player, input.MenuI.button );
|
|
||||||
|
|
||||||
input.mp = InputMapper::InputDeviceToMultiPlayer( input.DeviceI.device );
|
input.mp = InputMapper::InputDeviceToMultiPlayer( input.DeviceI.device );
|
||||||
//LOG->Trace( "multiplayer %d", input.mp );
|
//LOG->Trace( "multiplayer %d", input.mp );
|
||||||
ASSERT( input.mp >= 0 && input.mp < NUM_MultiPlayer );
|
ASSERT( input.mp >= 0 && input.mp < NUM_MultiPlayer );
|
||||||
@@ -1442,6 +1432,12 @@ void HandleInputEvents(float fDeltaTime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( input.GameI.IsValid() )
|
||||||
|
{
|
||||||
|
INPUTMAPPER->GameToMenu( input.GameI, input.MenuI );
|
||||||
|
INPUTMAPPER->GameToStyle( input.GameI, input.StyleI );
|
||||||
|
}
|
||||||
|
|
||||||
if( HandleGlobalInputs(input) )
|
if( HandleGlobalInputs(input) )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user