mirror of https://github.com/libsdl-org/SDL.git
Fixed SDL_GetNumGamepadTouchpads() returning 1 for a NULL gamepad
This commit is contained in:
parent
ca29304ce1
commit
d2b7a84651
|
|
@ -3054,7 +3054,7 @@ SDL_GamepadButtonLabel SDL_GetGamepadButtonLabel(SDL_Gamepad *gamepad, SDL_Gamep
|
|||
*/
|
||||
int SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad)
|
||||
{
|
||||
int result = true;
|
||||
int result = 0;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
|
|
@ -3073,7 +3073,7 @@ int SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad)
|
|||
*/
|
||||
int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad)
|
||||
{
|
||||
int result = true;
|
||||
int result = 0;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
|
|
@ -3081,8 +3081,6 @@ int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad)
|
|||
if (joystick) {
|
||||
if (touchpad >= 0 && touchpad < joystick->ntouchpads) {
|
||||
result = joystick->touchpads[touchpad].nfingers;
|
||||
} else {
|
||||
result = SDL_InvalidParamError("touchpad");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3326,7 +3324,7 @@ SDL_JoystickID SDL_GetGamepadID(SDL_Gamepad *gamepad)
|
|||
|
||||
SDL_PropertiesID SDL_GetGamepadProperties(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_PropertiesID result = true;
|
||||
SDL_PropertiesID result = 0;
|
||||
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue