diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index cb70424cff..f076d80554 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -18,7 +18,37 @@ InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program +InputFilter::InputFilter() +{ + for( int i=0; iBeingPressed(di, Prev); +} + +bool InputFilter::WasBeingPressed( DeviceInput di ) +{ + return BeingPressed(di, true); +} + +bool InputFilter::IsBeingPressed( DeviceInput di ) +{ + return BeingPressed(di, false); +} void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) { @@ -32,9 +62,9 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) { const DeviceInput di = DeviceInput(InputDevice(d),b); - if( INPUTMAN->WasBeingPressed(di) ) + if( WasBeingPressed(di) ) { - if( INPUTMAN->IsBeingPressed(di) ) + if( IsBeingPressed(di) ) { const float fOldHoldTime = m_fTimeHeld[d][b]; m_fTimeHeld[d][b] += fDeltaTime; @@ -58,16 +88,16 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) array.Add( InputEvent(di,iet) ); } } - else { // !INPUTMAN->IsBeingPressed(di) + else { // !IsBeingPressed(di) m_fTimeHeld[d][b] = 0; array.Add( InputEvent(di,IET_RELEASE) ); } } - else // !INPUTMAN->WasBeingPressed(di) + else // !WasBeingPressed(di) { - if( INPUTMAN->IsBeingPressed(di) ) + if( IsBeingPressed(di) ) array.Add( InputEvent(di,IET_FIRST_PRESS) ); - else // !INPUTMAN->IsBeingPressed(di) + else // !IsBeingPressed(di) ; // don't care } } diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index f2f287205c..4cd03676f3 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -38,15 +38,12 @@ typedef CArray InputEventArray; class InputFilter { public: - InputFilter() - { - for( int i=0; i