From fec82698435c2447f2023ddff77e8af6228b53c4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 26 Dec 2006 22:34:29 +0000 Subject: [PATCH] add bDown --- stepmania/src/RageInputDevice.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageInputDevice.h b/stepmania/src/RageInputDevice.h index 7f2d02ac78..525e3cee33 100644 --- a/stepmania/src/RageInputDevice.h +++ b/stepmania/src/RageInputDevice.h @@ -305,12 +305,16 @@ public: * This should be 0 for analog axes within the dead zone. */ float level; + /* Whether this button is pressed. This is level with a threshold and debouncing + * applied. */ + bool bDown; + RageTimer ts; - DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), ts(RageZeroTimer) { } - DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), ts(RageZeroTimer) { } + DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { } + DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): - device(d), button(b), level(l), ts(t) { } + device(d), button(b), level(l), bDown(level > 0.5), ts(t) { } bool operator==( const DeviceInput &other ) const {