Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Return an error if the joystick index isn't 0 on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 27, 2012
1 parent 74a2079 commit 7e0b4d1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/joystick/android/SDL_sysjoystick.c
Expand Up @@ -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);
}
}


Expand Down

0 comments on commit 7e0b4d1

Please sign in to comment.