mirror of
https://github.com/yawut/SDL.git
synced 2026-07-20 01:44:46 -05:00
Return an error if the joystick index isn't 0 on Android
This commit is contained in:
parent
376e84c815
commit
a7eef9c98d
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user