Fix setting RGB without a player led (#13524)

There is a bug where SInput checks for player led capability before
setting RGB. This means that if a controller does not have a player led,
RGB commands are not sent.
This commit is contained in:
Antheas Kapenekakis
2025-08-01 19:15:54 +03:00
committed by GitHub
parent 1749aba641
commit d04899fcfd

View File

@@ -632,9 +632,7 @@ static bool HIDAPI_DriverSInput_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Jo
{
SDL_DriverSInput_Context *ctx = (SDL_DriverSInput_Context *)device->context;
if (ctx->player_leds_supported) {
// Set player number, finalizing the setup
if (ctx->joystick_rgb_supported) {
Uint8 joystickRGBCommand[SINPUT_DEVICE_REPORT_COMMAND_SIZE] = { SINPUT_DEVICE_REPORT_ID_OUTPUT_CMDDAT, SINPUT_DEVICE_COMMAND_JOYSTICKRGB, red, green, blue };
int joystickRGBBytesWritten = SDL_hid_write(device->dev, joystickRGBCommand, SINPUT_DEVICE_REPORT_COMMAND_SIZE);