mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-25 08:44:13 +00:00
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:
committed by
GitHub
parent
1749aba641
commit
d04899fcfd
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user