summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorChris <[email protected]>2021-04-08 23:55:47 +0100
committerGitHub <[email protected]>2021-04-09 00:55:47 +0200
commit3cdac3e11e86a2038df395a12e85b0e63e93b326 (patch)
tree4b2eec8605b7c92727d98e3c77e06c84814bb5e3 /src
parent8a8948780ee1c44f6e732d0b87732542cf32b3a2 (diff)
downloadraylib-3cdac3e11e86a2038df395a12e85b0e63e93b326.tar.gz
raylib-3cdac3e11e86a2038df395a12e85b0e63e93b326.zip
Fix off by one bug with GetGamepadAxisCount on PLATFORM_DESKTOP (#1715)
- 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.
Diffstat (limited to 'src')
-rw-r--r--src/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index cf8340f7..f4d64b7f 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;
}
}