Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Return an error if the joystick index isn't 0 on Android

  • Loading branch information
slouken committed Nov 27, 2012
1 parent 74a2079 commit 7e0b4d1c69b033dc47859c50431414111ae3978f
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/joystick/android/SDL_sysjoystick.c
@@ -64,13 +64,18 @@ SDL_SYS_JoystickNameForIndex(int index)
It returns 0, or -1 if there is an error.
*/
int
SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int index)
SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
{
joystick->nbuttons = 0;
joystick->nhats = 0;
joystick->nballs = 0;
joystick->naxes = 3;
return 0;
if (device_index == 0) {
joystick->nbuttons = 0;
joystick->nhats = 0;
joystick->nballs = 0;
joystick->naxes = 3;
return 0;
} else {
SDL_SetError("No joystick available with that index");
return (-1);
}
}


0 comments on commit 7e0b4d1

Please sign in to comment.