From e576bdc894f3a6b5b81e8e9965c6ff80a2d0d33b Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 17 Oct 2013 20:08:56 +0200 Subject: [PATCH] Removed joystick axis value negation. --- README.md | 2 ++ src/win32_joystick.c | 4 ++-- src/x11_joystick.c | 9 --------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 21d65a10..20938def 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). - Renamed configuration header to `glfw_config.h` to avoid conflicts - Generated file `glfw3.pc` did not respect the LIB\_SUFFIX CMake option + - [Win32] Bugfix: Removed joystick axis value negation left over from GLFW 2 - [Win32] Bugfix: Restoring windows using the Win+D hot key did not trigger the focus callback - [Win32] Bugfix: The disabled cursor mode clip rectangle was updated for @@ -230,6 +231,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). - [Cocoa] Bugfix: The `install_name` field of the dynamic library was not set - [Cocoa] Bugfix: Full screen windows were never reported as having focus - [X11] Added setting of the `WM_CLASS` property to the initial window title + - [X11] Bugfix: Removed joystick axis value negation left over from GLFW 2 ## Contact diff --git a/src/win32_joystick.c b/src/win32_joystick.c index 8b67dc0f..1a172368 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -97,7 +97,7 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count) return NULL; axes[(*count)++] = calcJoystickPos(ji.dwXpos, jc.wXmin, jc.wXmax); - axes[(*count)++] = -calcJoystickPos(ji.dwYpos, jc.wYmin, jc.wYmax); + axes[(*count)++] = calcJoystickPos(ji.dwYpos, jc.wYmin, jc.wYmax); if (jc.wCaps & JOYCAPS_HASZ) axes[(*count)++] = calcJoystickPos(ji.dwZpos, jc.wZmin, jc.wZmax); @@ -109,7 +109,7 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count) axes[(*count)++] = calcJoystickPos(ji.dwUpos, jc.wUmin, jc.wUmax); if (jc.wCaps & JOYCAPS_HASV) - axes[(*count)++] = -calcJoystickPos(ji.dwVpos, jc.wVmin, jc.wVmax); + axes[(*count)++] = calcJoystickPos(ji.dwVpos, jc.wVmin, jc.wVmax); return axes; } diff --git a/src/x11_joystick.c b/src/x11_joystick.c index 5aaa09aa..248ab127 100644 --- a/src/x11_joystick.c +++ b/src/x11_joystick.c @@ -125,15 +125,6 @@ static void pollJoystickEvents(void) case JS_EVENT_AXIS: _glfw.x11.joystick[i].axes[e.number] = (float) e.value / 32767.0f; - - // We need to change the sign for the Y axes, so that - // positive = up/forward, according to the GLFW spec. - if (e.number & 1) - { - _glfw.x11.joystick[i].axes[e.number] = - -_glfw.x11.joystick[i].axes[e.number]; - } - break; case JS_EVENT_BUTTON: