mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 03:25:10 +00:00
Fix wrong element array for hat to axis
This commit is contained in:
parent
0e8c4ea7ce
commit
682f1cf203
@ -1150,8 +1150,8 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state)
|
|||||||
state->axes[i] = js->axes[js->mapping->axes[i].value];
|
state->axes[i] = js->axes[js->mapping->axes[i].value];
|
||||||
else if (js->mapping->buttons[i].type == _GLFW_JOYSTICK_HATBIT)
|
else if (js->mapping->buttons[i].type == _GLFW_JOYSTICK_HATBIT)
|
||||||
{
|
{
|
||||||
const unsigned int hat = js->mapping->buttons[i].value >> 4;
|
const unsigned int hat = js->mapping->axes[i].value >> 4;
|
||||||
const unsigned int bit = js->mapping->buttons[i].value & 0xf;
|
const unsigned int bit = js->mapping->axes[i].value & 0xf;
|
||||||
if (js->hats[hat] & bit)
|
if (js->hats[hat] & bit)
|
||||||
state->axes[i] = 1.f;
|
state->axes[i] = 1.f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user