Skip to content

Commit

Permalink
Fix a compilation error with the rumble effect when targetting SDL < …
Browse files Browse the repository at this point in the history
…2.0.18.
  • Loading branch information
Arignir committed Sep 11, 2024
1 parent f34c036 commit 11ecfcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/app/sdl/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ app_sdl_handle_events(
app->sdl.controller.ptr = SDL_GameControllerOpen(event.cdevice.which);
app->sdl.controller.joystick.ptr = SDL_GameControllerGetJoystick(app->sdl.controller.ptr);
app->sdl.controller.joystick.idx = SDL_JoystickInstanceID(app->sdl.controller.joystick.ptr);
#if SDL_VERSION_ATLEAST(2, 0, 18)
app->sdl.controller.joystick.can_rumble = SDL_JoystickHasRumble(app->sdl.controller.joystick.ptr);
#else
app->sdl.controller.joystick.can_rumble = true
#endif
app->sdl.controller.connected = true;
logln(
HS_INFO,
Expand Down

0 comments on commit 11ecfcf

Please sign in to comment.