From e4c386a6c89194a68936be90de8110eb3e0867f6 Mon Sep 17 00:00:00 2001 From: Ryan Dortmans Date: Fri, 22 Oct 2004 06:15:14 +0000 Subject: [PATCH] Fixed y axis inversion --- stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp b/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp index b7b0512c0f..a39b9fdff4 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp @@ -142,11 +142,15 @@ void InputHandler_Xbox::Update(float fDeltaTime) { if(axes[j] != 0) { + // Reverse y axis (negative values are down, not up) + if(j == 1 || j == 3) + axes[j] = -axes[j]; + JoystickButton neg = (JoystickButton)(JOY_LEFT + (2 * j)); JoystickButton pos = (JoystickButton)(JOY_RIGHT + (2 * j)); float l = SCALE( axes[j], 0.0f, 32768.0f, 0.0f, 1.0f ); - ButtonPressed(DeviceInput(inputDevice, neg,max(-l,0),RageZeroTimer), axes[j] < -16000); - ButtonPressed(DeviceInput(inputDevice, pos,max(+l,0),RageZeroTimer), axes[j] > +16000); + ButtonPressed(DeviceInput(inputDevice, neg,max(-l,0),RageZeroTimer), axes[j] > -16000); + ButtonPressed(DeviceInput(inputDevice, pos,max(+l,0),RageZeroTimer), axes[j] < +16000); continue; } }