From b14d1f1e0bc63ff0b60c540b53dbd60135f77b4a Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 7 Feb 2025 04:05:10 +0100 Subject: [PATCH] just pass the controller directly simplifies this alot --- src/sdl/i_system.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 90412db9d..0b80e8f3f 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1496,12 +1496,7 @@ void I_GamepadRumble(INT32 playernum, UINT16 low_strength, UINT16 high_strength, (void)high_strength; (void)duration; #else - - INT32 device_id = I_GetJoystickDeviceIndex(JoyInfo[playernum].dev); - - I_Assert(device_id > 0); // Gamepad devices are always ID 1 or higher - - SDL_GameController *controller = SDL_GameControllerFromInstanceID(device_id); + SDL_GameController *controller = JoyInfo[playernum].dev; if (controller == NULL) { return; @@ -1519,12 +1514,7 @@ void I_SetGamepadIndicatorColor(INT32 playernum, UINT8 red, UINT8 green, UINT8 b (void)green; (void)blue; #else - - INT32 device_id = I_GetJoystickDeviceIndex(JoyInfo[playernum].dev); - - I_Assert(device_id > 0); // Gamepad devices are always ID 1 or higher - - SDL_GameController *controller = SDL_GameControllerFromInstanceID(device_id); + SDL_GameController *controller = JoyInfo[playernum].dev; if (controller == NULL) { return;