filter in InputQueue
This commit is contained in:
@@ -18,6 +18,11 @@ InputQueue::InputQueue()
|
|||||||
|
|
||||||
void InputQueue::RememberInput( const InputEventPlus &iep )
|
void InputQueue::RememberInput( const InputEventPlus &iep )
|
||||||
{
|
{
|
||||||
|
if( !iep.GameI.IsValid() )
|
||||||
|
return;
|
||||||
|
if( iep.type != IET_FIRST_PRESS )
|
||||||
|
return;
|
||||||
|
|
||||||
int c = iep.GameI.controller;
|
int c = iep.GameI.controller;
|
||||||
if( m_aQueue[c].size() >= MAX_INPUT_QUEUE_LENGTH ) // full
|
if( m_aQueue[c].size() >= MAX_INPUT_QUEUE_LENGTH ) // full
|
||||||
m_aQueue[c].erase( m_aQueue[c].begin(), m_aQueue[c].begin() + (m_aQueue[c].size()-MAX_INPUT_QUEUE_LENGTH+1) );
|
m_aQueue[c].erase( m_aQueue[c].begin(), m_aQueue[c].begin() + (m_aQueue[c].size()-MAX_INPUT_QUEUE_LENGTH+1) );
|
||||||
|
|||||||
@@ -1379,8 +1379,7 @@ void HandleInputEvents(float fDeltaTime)
|
|||||||
input.pn = INPUTMAPPER->ControllerToPlayerNumber( input.GameI.controller );
|
input.pn = INPUTMAPPER->ControllerToPlayerNumber( input.GameI.controller );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( input.GameI.IsValid() && input.type == IET_FIRST_PRESS )
|
INPUTQUEUE->RememberInput( input );
|
||||||
INPUTQUEUE->RememberInput( input );
|
|
||||||
|
|
||||||
if( HandleGlobalInputs(input) )
|
if( HandleGlobalInputs(input) )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|||||||
Reference in New Issue
Block a user