Add option to change controller LED color #572

Merged
Otozinclus merged 33 commits from Change-Controller-LED-Color into master 2025-01-24 20:47:36 +00:00
Showing only changes of commit 96e9e3611d - Show all commits

View File

@ -78,6 +78,8 @@ namespace Ryujinx.Input.SDL2
private float _triggerThreshold;
private uint _rawColor;
public SDL2Gamepad(nint gamepadHandle, string driverId)
{
_gamepadHandle = gamepadHandle;
@ -110,12 +112,11 @@ namespace Ryujinx.Input.SDL2
public void SetLedColor()
{
//IAMTOOTIREDWILLCONTINUETOMORROWSORRY
//uint rawColor = 0;
uint rawColor = _configuration.Led.LedColor;
byte red = (byte)(rawColor >> 16);
byte green = (byte)(rawColor >> 8);
byte blue = (byte)(rawColor % 256);
//_rawColor = _configuration.Led.LedColor;
byte red = (byte)(_rawColor >> 16);
byte green = (byte)(_rawColor >> 8);
byte blue = (byte)(_rawColor % 256);
SDL_GameControllerSetLED(_gamepadHandle, red, green, blue);
}
@ -238,6 +239,9 @@ namespace Ryujinx.Input.SDL2
{
_configuration = (StandardControllerInputConfig)configuration;
_rawColor = _configuration.Led.LedColor;
SetLedColor();
_buttonsUserMapping.Clear();
// First update sticks