From ab7ee6e9057cd759406fb792a3db498710bb86f4 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Thu, 8 Apr 2021 23:43:25 +0100 Subject: [PATCH] Fix off by one bug with GetGamepadAxisCount on PLATFORM_DESKTOP - Found testing core_input_gamepad. The last axis was not drawn. - GLFW_GAMEPAD_AXIS_LAST is defined to the last axis which is 5 not the total number which is 6. --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index cf8340f7e..f4d64b7f5 100644 --- a/src/core.c +++ b/src/core.c @@ -4735,7 +4735,7 @@ static void PollInputEvents(void) CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1); CORE.Input.Gamepad.currentState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1); - CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST; + CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST + 1; } }