diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 2616dec192..431fb8893b 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -974,10 +974,19 @@ void joyScanDevices() inputdevices |= DEV_JOYSTICK; +#if SDL_VERSION_ATLEAST(2, 0, 18) + if (EDUKE32_SDL_LINKED_PREREQ(linked, 2, 0, 18)) + { + if (SDL_GameControllerHasRumble(controller)) + joystick.hasRumble = 1; + else DVLOG_F(LOG_INPUT, "Couldn't init controller rumble: %s.", SDL_GetError()); + } + else +#endif #if SDL_VERSION_ATLEAST(2, 0, 9) if (EDUKE32_SDL_LINKED_PREREQ(linked, 2, 0, 9)) { - if (!SDL_GameControllerRumble(controller, 0xc000, 0xc000, 10)) + if (!SDL_GameControllerRumble(controller, 1, 1, 1)) joystick.hasRumble = 1; else DVLOG_F(LOG_INPUT, "Couldn't init controller rumble: %s.", SDL_GetError()); } @@ -1020,10 +1029,19 @@ void joyScanDevices() SDL_JoystickEventState(SDL_ENABLE); inputdevices |= DEV_JOYSTICK; +#if SDL_VERSION_ATLEAST(2, 0, 18) + if (EDUKE32_SDL_LINKED_PREREQ(linked, 2, 0, 18)) + { + if (SDL_JoystickHasRumble(joydev)) + joystick.hasRumble = 1; + else DVLOG_F(LOG_INPUT, "Couldn't init joystick rumble: %s.", SDL_GetError()); + } + else +#endif #if SDL_VERSION_ATLEAST(2, 0, 9) if (EDUKE32_SDL_LINKED_PREREQ(linked, 2, 0, 9)) { - if (!SDL_JoystickRumble(joydev, 0xffff, 0xffff, 200)) + if (!SDL_JoystickRumble(joydev, 1, 1, 1)) joystick.hasRumble = 1; else DVLOG_F(LOG_INPUT, "Couldn't init joystick rumble: %s.", SDL_GetError()); }