Fix compilation with old SDL2, fix #4554

This commit is contained in:
Benau 2021-07-19 12:22:45 +08:00
parent d988f502a4
commit a92e021625

View File

@ -269,9 +269,11 @@ void SDLController::doRumble(float strength_low, float strength_high, uint32_t d
else else
#endif #endif
{ {
#if SDL_VERSION_ATLEAST(2,0,9)
uint16_t scaled_low = strength_low * pow(2, 16); uint16_t scaled_low = strength_low * pow(2, 16);
uint16_t scaled_high = strength_high * pow(2, 16); uint16_t scaled_high = strength_high * pow(2, 16);
SDL_GameControllerRumble(m_game_controller, scaled_low, scaled_high, duration_ms); SDL_GameControllerRumble(m_game_controller, scaled_low, scaled_high, duration_ms);
#endif
} }
} }