From a92e02162591f4692fa5042853b792f3a52cdc87 Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 19 Jul 2021 12:22:45 +0800 Subject: [PATCH] Fix compilation with old SDL2, fix #4554 --- src/input/sdl_controller.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/input/sdl_controller.cpp b/src/input/sdl_controller.cpp index 122c38f5a..6be4a3723 100644 --- a/src/input/sdl_controller.cpp +++ b/src/input/sdl_controller.cpp @@ -269,9 +269,11 @@ void SDLController::doRumble(float strength_low, float strength_high, uint32_t d else #endif { +#if SDL_VERSION_ATLEAST(2,0,9) uint16_t scaled_low = strength_low * pow(2, 16); uint16_t scaled_high = strength_high * pow(2, 16); SDL_GameControllerRumble(m_game_controller, scaled_low, scaled_high, duration_ms); +#endif } }