mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-10 20:06:27 +00:00
Use SDL_bool where appropriate in SDL events
This involved changing button state from Uint8 to SDL_bool, and made SDL_PRESSED and SDL_RELEASED unnecessary. Fixes https://github.com/libsdl-org/SDL/issues/10069
This commit is contained in:
@@ -650,8 +650,8 @@ static void BSD_JoystickUpdate(SDL_Joystick *joy)
|
||||
v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * ((Sint32)y - ymin)) / (ymax - ymin)) + SDL_JOYSTICK_AXIS_MIN;
|
||||
SDL_SendJoystickAxis(timestamp, joy, 1, v);
|
||||
}
|
||||
SDL_SendJoystickButton(timestamp, joy, 0, gameport.b1);
|
||||
SDL_SendJoystickButton(timestamp, joy, 1, gameport.b2);
|
||||
SDL_SendJoystickButton(timestamp, joy, 0, (gameport.b1 != 0));
|
||||
SDL_SendJoystickButton(timestamp, joy, 1, (gameport.b2 != 0));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -720,7 +720,7 @@ static void BSD_JoystickUpdate(SDL_Joystick *joy)
|
||||
case HUP_BUTTON:
|
||||
v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem);
|
||||
nbutton = HID_USAGE(hitem.usage) - 1; // SDL buttons are zero-based
|
||||
SDL_SendJoystickButton(timestamp, joy, nbutton, v);
|
||||
SDL_SendJoystickButton(timestamp, joy, nbutton, (v != 0));
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user