From f8f94844b21064d239a3b399e1811dcbf5c72c92 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 17 May 2005 20:50:39 +0000 Subject: [PATCH] fix zero timestamps on reset warn about zero timestamps --- stepmania/src/InputFilter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 746f761a68..99f2d44e97 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -52,6 +52,9 @@ void InputFilter::ButtonPressed( DeviceInput di, bool Down ) { LockMut(*queuemutex); + if( di.ts.IsZero() ) + LOG->Warn( "InputFilter::ButtonPressed: zero timestamp is invalid" ); + ButtonState &bs = m_ButtonState[di.device][di.button]; bs.m_Level = di.level; @@ -75,8 +78,9 @@ void InputFilter::SetButtonComment( DeviceInput di, const CString &sComment ) /* Release all buttons on the given device. */ void InputFilter::ResetDevice( InputDevice device ) { + RageTimer now; 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)