This commit is contained in:
mika 2025-01-23 03:39:33 +01:00
parent e945565259
commit 2c4236f733

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