GLFW: Fix invalid ranges for gamepad axis sources

From 9420e6f0d0.
This commit is contained in:
Luflosi
2019-07-26 13:30:38 -05:00
parent 00cae4ccd1
commit 922bc62e0e

4
glfw/input.c vendored
View File

@@ -1365,9 +1365,11 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state)
const unsigned int bit = e->index & 0xf;
if (js->hats[hat] & bit)
state->axes[i] = 1.f;
else
state->axes[i] = -1.f;
}
else if (e->type == _GLFW_JOYSTICK_BUTTON)
state->axes[i] = (float) js->buttons[e->index];
state->axes[i] = js->buttons[e->index] * 2.f - 1.f;
}
return true;