fix zero timestamps on reset
warn about zero timestamps
This commit is contained in:
@@ -52,6 +52,9 @@ void InputFilter::ButtonPressed( DeviceInput di, bool Down )
|
|||||||
{
|
{
|
||||||
LockMut(*queuemutex);
|
LockMut(*queuemutex);
|
||||||
|
|
||||||
|
if( di.ts.IsZero() )
|
||||||
|
LOG->Warn( "InputFilter::ButtonPressed: zero timestamp is invalid" );
|
||||||
|
|
||||||
ButtonState &bs = m_ButtonState[di.device][di.button];
|
ButtonState &bs = m_ButtonState[di.device][di.button];
|
||||||
|
|
||||||
bs.m_Level = di.level;
|
bs.m_Level = di.level;
|
||||||
@@ -75,8 +78,9 @@ void InputFilter::SetButtonComment( DeviceInput di, const CString &sComment )
|
|||||||
/* Release all buttons on the given device. */
|
/* Release all buttons on the given device. */
|
||||||
void InputFilter::ResetDevice( InputDevice device )
|
void InputFilter::ResetDevice( InputDevice device )
|
||||||
{
|
{
|
||||||
|
RageTimer now;
|
||||||
for( int button = 0; button < GetNumDeviceButtons(device); ++button )
|
for( int button = 0; button < GetNumDeviceButtons(device); ++button )
|
||||||
ButtonPressed( DeviceInput(device, button), false );
|
ButtonPressed( DeviceInput(device, button, -1, now), false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputFilter::Update(float fDeltaTime)
|
void InputFilter::Update(float fDeltaTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user