Return an error if the joystick index isn't 0 on Android
This commit is contained in:
parent
c6918ae961
commit
3f29ebe82f
1 changed files with 11 additions and 6 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
if (device_index == 0) {
|
||||||
joystick->nbuttons = 0;
|
joystick->nbuttons = 0;
|
||||||
joystick->nhats = 0;
|
joystick->nhats = 0;
|
||||||
joystick->nballs = 0;
|
joystick->nballs = 0;
|
||||||
joystick->naxes = 3;
|
joystick->naxes = 3;
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
SDL_SetError("No joystick available with that index");
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue