Allow setting the player index to -1, which turns off the player LED for PS5 controllers

This commit is contained in:
Sam Lantinga
2021-01-04 12:24:44 -08:00
parent bf754b52bf
commit b2a0c712cb
4 changed files with 9 additions and 6 deletions

View File

@@ -133,7 +133,9 @@ HIDAPI_DriverXbox360_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joystic
if (!device->dev) {
return;
}
SetSlotLED(device->dev, (player_index % 4));
if (player_index >= 0) {
SetSlotLED(device->dev, (player_index % 4));
}
}
static SDL_bool

View File

@@ -131,7 +131,9 @@ HIDAPI_DriverXbox360W_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joysti
if (!device->dev) {
return;
}
SetSlotLED(device->dev, (player_index % 4));
if (player_index >= 0) {
SetSlotLED(device->dev, (player_index % 4));
}
}
static SDL_bool