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 2c4236f733 - Show all commits

View File

@ -87,9 +87,9 @@ namespace Ryujinx.Input.SDL2
Features = GetFeaturesFlag(); Features = GetFeaturesFlag();
_triggerThreshold = 0.0f; _triggerThreshold = 0.0f;
if (SDL_GameControllerHasLED(_gamepadHandle) == SDL_bool.SDL_TRUE) if (Features.HasFlag(GamepadFeaturesFlag.Led))
{ {
SetLedColor("FFE3B5"); SetLedColor();
} }
// Enable motion tracking // Enable motion tracking
@ -107,12 +107,13 @@ namespace Ryujinx.Input.SDL2
} }
} }
public void SetLedColor(string hex) public void SetLedColor()
{ {
ulong LEDcolor = Convert.ToUInt64(hex, 16); //IAMTOOTIREDWILLCONTINUETOMORROWSORRY
byte red = (byte)((LEDcolor >> 16) % 256); uint rawColor = 100;
byte green = (byte)((LEDcolor >> 8) % 256); byte red = (byte)(rawColor >> 16);
byte blue = (byte)(LEDcolor % 256); byte green = (byte)(rawColor >> 8);
byte blue = (byte)(rawColor % 256);
SDL_GameControllerSetLED(_gamepadHandle, red, green, blue); SDL_GameControllerSetLED(_gamepadHandle, red, green, blue);
} }