From 2810a46095ec6568a5ff4c38f70d6e36b4feb7b1 Mon Sep 17 00:00:00 2001 From: Eidolon <furyhunter600@gmail.com> Date: Thu, 26 Jan 2023 19:25:59 -0600 Subject: [PATCH] Revert "sdl: Version-guard rumble and extended buttons" This reverts commit f5f224136ba6d8db1319eb091c9b9877173d8e55. --- src/sdl/i_gamepad.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/sdl/i_gamepad.c b/src/sdl/i_gamepad.c index 109d37d4aa..28f9681bec 100644 --- a/src/sdl/i_gamepad.c +++ b/src/sdl/i_gamepad.c @@ -231,7 +231,6 @@ static boolean Controller_OpenDevice(UINT8 which, INT32 devindex) controller->info->type = GAMEPAD_TYPE_UNKNOWN; #endif // SDL_VERSION_ATLEAST(2,0,12) -#if SDL_VERSION_ATLEAST(2,0,6) // Check the device vendor and product to find out what controller this actually is Uint16 vendor = SDL_JoystickGetDeviceVendor(devindex); Uint16 product = SDL_JoystickGetDeviceProduct(devindex); @@ -240,17 +239,13 @@ static boolean Controller_OpenDevice(UINT8 which, INT32 devindex) controller->info->type = GAMEPAD_TYPE_XBOX_SERIES_XS; else if (IsJoystickXboxOneElite(vendor, product)) controller->info->type = GAMEPAD_TYPE_XBOX_ELITE; -#endif CONS_Debug(DBG_GAMELOGIC, M_GetText(" Type: %s\n"), G_GamepadTypeToString(controller->info->type)); -#if SDL_VERSION_ATLEAST(2,0,12) // Change the ring LEDs on Xbox 360 controllers // FIXME: Doesn't seem to work? SDL_GameControllerSetPlayerIndex(controller->dev, which); -#endif -#if SDL_VERSION_ATLEAST(2,0,18) // Check if rumble is supported if (SDL_GameControllerHasRumble(controller->dev) == SDL_TRUE) { @@ -260,12 +255,8 @@ static boolean Controller_OpenDevice(UINT8 which, INT32 devindex) else { controller->info->rumble.supported = false; - CONS_Debug(DBG_GAMELOGIC, M_GetText(" Rumble supported: No\n")); + CONS_Debug(DBG_GAMELOGIC, M_GetText(" Rumble supported: No\n"));; } -#else - controller->info->rumble.supported = true; - CONS_Debug(DBG_GAMELOGIC, M_GetText(" Rumble supported: Maybe\n")); -#endif // SDL_VERSION_ATLEAST(2,0,18) if (!controller->info->connected) { @@ -609,14 +600,12 @@ void I_HandleControllerButtonEvent(SDL_ControllerButtonEvent evt, Uint32 type) GAMEPAD_BUTTON_CASE(DPAD_DOWN); GAMEPAD_BUTTON_CASE(DPAD_LEFT); GAMEPAD_BUTTON_CASE(DPAD_RIGHT); -#if SDL_VERSION_ATLEAST(2,0,14) GAMEPAD_BUTTON_CASE(MISC1); GAMEPAD_BUTTON_CASE(PADDLE1); GAMEPAD_BUTTON_CASE(PADDLE2); GAMEPAD_BUTTON_CASE(PADDLE3); GAMEPAD_BUTTON_CASE(PADDLE4); GAMEPAD_BUTTON_CASE(TOUCHPAD); -#endif default: return; } @@ -674,10 +663,8 @@ static void Controller_StopRumble(UINT8 num) gamepad->rumble.data.small_magnitude = 0; gamepad->rumble.data.duration = 0; -#if SDL_VERSION_ATLEAST(2,0,9) if (gamepad->rumble.supported) SDL_GameControllerRumble(controller->dev, 0, 0, 0); -#endif } static void Controller_Close(UINT8 num) -- GitLab