From 9c3270a2de94630c9f6dc3db8a613b5ff986c027 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 1 Feb 2022 00:14:38 +1000 Subject: [PATCH] InputManager/SDL: Drop version checks They're not needed since we're always using the latest SDL. --- pcsx2/Frontend/SDLInputSource.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pcsx2/Frontend/SDLInputSource.cpp b/pcsx2/Frontend/SDLInputSource.cpp index b93c4aff36..c6a82e9bc2 100644 --- a/pcsx2/Frontend/SDLInputSource.cpp +++ b/pcsx2/Frontend/SDLInputSource.cpp @@ -105,12 +105,8 @@ void SDLInputSource::LoadSettings(SettingsInterface& si) void SDLInputSource::SetHints() { -#if SDL_VERSION_ATLEAST(2, 0, 9) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, m_controller_enhanced_mode ? "1" : "0"); -#endif -#if SDL_VERSION_ATLEAST(2, 0, 16) SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, m_controller_enhanced_mode ? "1" : "0"); -#endif } bool SDLInputSource::InitializeSubsystem() @@ -340,12 +336,8 @@ bool SDLInputSource::OpenGameController(int index) return false; } - int joystick_id = SDL_JoystickInstanceID(joystick); -#if SDL_VERSION_ATLEAST(2, 0, 9) - int player_id = SDL_GameControllerGetPlayerIndex(gcontroller); -#else - int player_id = -1; -#endif + const int joystick_id = SDL_JoystickInstanceID(joystick); + const int player_id = SDL_GameControllerGetPlayerIndex(gcontroller); if (player_id < 0 || GetControllerDataForPlayerId(player_id) != m_controllers.end()) { const int free_player_id = GetFreePlayerId(); @@ -364,12 +356,7 @@ bool SDLInputSource::OpenGameController(int index) cd.haptic_left_right_effect = -1; cd.game_controller = gcontroller; -#if SDL_VERSION_ATLEAST(2, 0, 9) cd.use_game_controller_rumble = (SDL_GameControllerRumble(gcontroller, 0, 0, 0) == 0); -#else - cd.use_game_controller_rumble = false; -#endif - if (cd.use_game_controller_rumble) { Console.WriteLn( @@ -529,13 +516,11 @@ void SDLInputSource::SendRumbleUpdate(ControllerData* cd) // we'll update before this duration is elapsed static constexpr u32 DURATION = 65535; // SDL_MAX_RUMBLE_DURATION_MS -#if SDL_VERSION_ATLEAST(2, 0, 9) if (cd->use_game_controller_rumble) { SDL_GameControllerRumble(cd->game_controller, cd->rumble_intensity[0], cd->rumble_intensity[1], DURATION); return; } -#endif if (cd->haptic_left_right_effect >= 0) {