Browse Source

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.
Antheas Kapenekakis 2 tuần trước cách đây
mục cha
commit
d04899fcfd
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      src/joystick/hidapi/SDL_hidapi_sinput.c

+ 1 - 3
src/joystick/hidapi/SDL_hidapi_sinput.c

@@ -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);