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

This commit is contained in:
Sam Lantinga 2012-11-26 22:09:34 -08:00
parent c6918ae961
commit 3f29ebe82f

View file

@ -64,13 +64,18 @@ SDL_SYS_JoystickNameForIndex(int index)
It returns 0, or -1 if there is an error. It returns 0, or -1 if there is an error.
*/ */
int int
SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int index) SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
{ {
joystick->nbuttons = 0; if (device_index == 0) {
joystick->nhats = 0; joystick->nbuttons = 0;
joystick->nballs = 0; joystick->nhats = 0;
joystick->naxes = 3; joystick->nballs = 0;
return 0; joystick->naxes = 3;
return 0;
} else {
SDL_SetError("No joystick available with that index");
return (-1);
}
} }