From 96e9e3611d9ef25dc6cad2f4202163ec69b36b87 Mon Sep 17 00:00:00 2001 From: mika Date: Thu, 23 Jan 2025 05:29:18 +0100 Subject: [PATCH] move logic around --- src/Ryujinx.Input.SDL2/SDL2Gamepad.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs b/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs index 82004729f..641ccebe9 100644 --- a/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs +++ b/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs @@ -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