mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-28 05:58:29 +00:00
Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512 Fixes https://github.com/libsdl-org/SDL/issues/6731
This commit is contained in:
@@ -129,7 +129,7 @@ struct joystick_hwdata
|
||||
|
||||
#ifdef SDL_JOYSTICK_RAWINPUT_MATCHING
|
||||
Uint64 match_state; /* Lowest 16 bits for button states, higher 24 for 6 4bit axes */
|
||||
Uint32 last_state_packet;
|
||||
Uint64 last_state_packet;
|
||||
#endif
|
||||
|
||||
#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT
|
||||
@@ -167,7 +167,7 @@ static const Uint16 subscribed_devices[] = {
|
||||
|
||||
static struct
|
||||
{
|
||||
Uint32 last_state_packet;
|
||||
Uint64 last_state_packet;
|
||||
SDL_Joystick *joystick;
|
||||
SDL_Joystick *last_joystick;
|
||||
} guide_button_candidate;
|
||||
@@ -1808,7 +1808,7 @@ static void RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick)
|
||||
if (!correlated) {
|
||||
if (!guide_button_candidate.joystick ||
|
||||
(ctx->last_state_packet && (!guide_button_candidate.last_state_packet ||
|
||||
SDL_TICKS_PASSED(ctx->last_state_packet, guide_button_candidate.last_state_packet)))) {
|
||||
ctx->last_state_packet >= guide_button_candidate.last_state_packet))) {
|
||||
guide_button_candidate.joystick = joystick;
|
||||
guide_button_candidate.last_state_packet = ctx->last_state_packet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user