mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Removed joystick axis value negation.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user