Explorar o código

Fix wrong element array for hat to axis

Camilla Löwy %!s(int64=7) %!d(string=hai) anos
pai
achega
682f1cf203
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/input.c

+ 2 - 2
src/input.c

@@ -1150,8 +1150,8 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state)
             state->axes[i] = js->axes[js->mapping->axes[i].value];
         else if (js->mapping->buttons[i].type == _GLFW_JOYSTICK_HATBIT)
         {
-            const unsigned int hat = js->mapping->buttons[i].value >> 4;
-            const unsigned int bit = js->mapping->buttons[i].value & 0xf;
+            const unsigned int hat = js->mapping->axes[i].value >> 4;
+            const unsigned int bit = js->mapping->axes[i].value & 0xf;
             if (js->hats[hat] & bit)
                 state->axes[i] = 1.f;
         }