summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rcore.c2
-rw-r--r--src/rcore.h2
-rw-r--r--src/rcore_android.c2
-rw-r--r--src/rcore_desktop.c4
-rw-r--r--src/rcore_drm.c4
-rw-r--r--src/rcore_template.c2
-rw-r--r--src/rcore_web.c4
7 files changed, 10 insertions, 10 deletions
diff --git a/src/rcore.c b/src/rcore.c
index e6015b33..f94731f9 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -2168,7 +2168,7 @@ int GetGamepadButtonPressed(void)
// Get gamepad axis count
int GetGamepadAxisCount(int gamepad)
{
- return CORE.Input.Gamepad.axisCount;
+ return CORE.Input.Gamepad.axisCount[gamepad];
}
// Get axis movement vector for a gamepad
diff --git a/src/rcore.h b/src/rcore.h
index dbff6ab1..1127585a 100644
--- a/src/rcore.h
+++ b/src/rcore.h
@@ -179,7 +179,7 @@ typedef struct CoreData {
} Touch;
struct {
int lastButtonPressed; // Register last gamepad button pressed
- int axisCount; // Register number of available gamepad axis
+ int axisCount[MAX_GAMEPADS]; // Register number of available gamepad axis
bool ready[MAX_GAMEPADS]; // Flag to know if gamepad is ready
char name[MAX_GAMEPADS][64]; // Gamepad name holder
char currentButtonState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state
diff --git a/src/rcore_android.c b/src/rcore_android.c
index 4dc0e26c..98ce64a6 100644
--- a/src/rcore_android.c
+++ b/src/rcore_android.c
@@ -566,7 +566,7 @@ void PollInputEvents(void)
// Reset last gamepad button/axis registered state
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
- CORE.Input.Gamepad.axisCount = 0;
+ //CORE.Input.Gamepad.axisCount = 0;
// Register previous touch states
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];
diff --git a/src/rcore_desktop.c b/src/rcore_desktop.c
index fe5a02aa..4039bbd8 100644
--- a/src/rcore_desktop.c
+++ b/src/rcore_desktop.c
@@ -1234,7 +1234,7 @@ void PollInputEvents(void)
// Reset last gamepad button/axis registered state
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
- CORE.Input.Gamepad.axisCount = 0;
+ //CORE.Input.Gamepad.axisCount = 0;
// Keyboard/Mouse input polling (automatically managed by GLFW3 through callback)
// Register previous keys states
@@ -1341,7 +1341,7 @@ void PollInputEvents(void)
CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_LEFT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_LEFT_TRIGGER] > 0.1f);
CORE.Input.Gamepad.currentButtonState[i][GAMEPAD_BUTTON_RIGHT_TRIGGER_2] = (char)(CORE.Input.Gamepad.axisState[i][GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.1f);
- CORE.Input.Gamepad.axisCount = GLFW_GAMEPAD_AXIS_LAST + 1;
+ CORE.Input.Gamepad.axisCount[i] = GLFW_GAMEPAD_AXIS_LAST + 1;
}
}
diff --git a/src/rcore_drm.c b/src/rcore_drm.c
index 3f03bfa1..1fb83c8f 100644
--- a/src/rcore_drm.c
+++ b/src/rcore_drm.c
@@ -655,7 +655,7 @@ void PollInputEvents(void)
// Reset last gamepad button/axis registered state
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
- CORE.Input.Gamepad.axisCount = 0;
+ //CORE.Input.Gamepad.axisCount = 0;
// Register previous keys states
for (int i = 0; i < MAX_KEYBOARD_KEYS; i++)
@@ -1847,7 +1847,7 @@ static void InitGamepad(void)
}
ioctl(platform.gamepadStreamFd[i], JSIOCGNAME(64), &CORE.Input.Gamepad.name[i]);
- ioctl(platform.gamepadStreamFd[i], JSIOCGAXES, &CORE.Input.Gamepad.axisCount);
+ ioctl(platform.gamepadStreamFd[i], JSIOCGAXES, &CORE.Input.Gamepad.axisCount[i]);
}
}
}
diff --git a/src/rcore_template.c b/src/rcore_template.c
index 89be8ac0..4d2db9d3 100644
--- a/src/rcore_template.c
+++ b/src/rcore_template.c
@@ -569,7 +569,7 @@ void PollInputEvents(void)
// Reset last gamepad button/axis registered state
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
- CORE.Input.Gamepad.axisCount = 0;
+ //CORE.Input.Gamepad.axisCount = 0;
// Register previous touch states
for (int i = 0; i < MAX_TOUCH_POINTS; i++) CORE.Input.Touch.previousTouchState[i] = CORE.Input.Touch.currentTouchState[i];
diff --git a/src/rcore_web.c b/src/rcore_web.c
index 9e4ce5b9..f8e1e5b2 100644
--- a/src/rcore_web.c
+++ b/src/rcore_web.c
@@ -705,7 +705,7 @@ void PollInputEvents(void)
// Reset last gamepad button/axis registered state
CORE.Input.Gamepad.lastButtonPressed = 0; // GAMEPAD_BUTTON_UNKNOWN
- CORE.Input.Gamepad.axisCount = 0;
+ //CORE.Input.Gamepad.axisCount = 0;
// Keyboard/Mouse input polling (automatically managed by GLFW3 through callback)
// Register previous keys states
@@ -799,7 +799,7 @@ void PollInputEvents(void)
CORE.Input.Gamepad.axisState[i][j] = gamepadState.axis[j];
}
- CORE.Input.Gamepad.axisCount = gamepadState.numAxes;
+ CORE.Input.Gamepad.axisCount[i] = gamepadState.numAxes;
}
}
}