Skip to content

Commit 80c8fc1

Browse files
committed
SDLInputState: Add SDL version guards for newer GameController functions
1 parent dabf82f commit 80c8fc1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/SDLInputState.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,15 +1012,19 @@ std::string SDLInputState::getInputBindName(int type, int bind) {
10121012
}
10131013

10141014
void SDLInputState::joystickRumble(uint16_t low_freq, uint16_t high_freq, uint32_t duration) {
1015+
#if SDL_VERSION_ATLEAST(2, 0, 18)
10151016
if (gamepad && mode == MODE_JOYSTICK && settings->joystick_rumble && SDL_GameControllerHasRumble(gamepad) == SDL_TRUE) {
10161017
SDL_GameControllerRumble(gamepad, low_freq, high_freq, duration);
10171018
}
1019+
#endif
10181020
}
10191021

10201022
void SDLInputState::setJoystickLED(Color color) {
1023+
#if SDL_VERSION_ATLEAST(2, 0, 14)
10211024
if (gamepad && mode == MODE_JOYSTICK && SDL_GameControllerHasLED(gamepad) == SDL_TRUE) {
10221025
SDL_GameControllerSetLED(gamepad, color.r, color.g, color.b);
10231026
}
1027+
#endif
10241028
}
10251029

10261030
void SDLInputState::reset() {

src/Version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FLARE. If not, see http://www.gnu.org/licenses/
3030

3131
#include <SDL.h>
3232

33-
Version VersionInfo::ENGINE(1, 14, 258);
33+
Version VersionInfo::ENGINE(1, 14, 259);
3434
Version VersionInfo::MIN(0, 0, 0);
3535
Version VersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);
3636

0 commit comments

Comments
 (0)