commit fb9eae0caa7ce60bed6cd101c87856740a338c95
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sat Dec 6 04:55:14 2014 -0500
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Sat Dec 6 04:55:14 2014 -0500
setup: Fix call to SDL_JoystickName().
SDL_JoystickName() in SDL2 takes a joystick handle rather than an
index. Change calls to this function to match the new API.
---
src/setup/joystick.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index 49931312..0848161b 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -367,7 +367,7 @@ static const known_joystick_t *GetJoystickType(int index)
int i;
joystick = all_joysticks[index];
- name = SDL_JoystickName(index);
+ name = SDL_JoystickName(joystick);
axes = SDL_JoystickNumAxes(joystick);
buttons = SDL_JoystickNumButtons(joystick);
hats = SDL_JoystickNumHats(joystick);
@@ -494,7 +494,7 @@ static void SetJoystickButtonLabel(void)
if (joystick_initted
&& joystick_index >= 0 && joystick_index < SDL_NumJoysticks())
{
- name = (char *) SDL_JoystickName(joystick_index);
+ name = (char *) SDL_JoystickNameForIndex(joystick_index);
}
TXT_SetButtonLabel(joystick_button, name);