This commit is contained in:
Otozinclus
2025-01-23 08:18:49 +01:00
committed by GitHub

View File

@@ -1,6 +1,7 @@
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Controller;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Hid;
using SDL2;
using System;
using System.Collections.Generic;
@@ -102,6 +103,19 @@ namespace Ryujinx.Input.SDL2
}
}
public void SetLedColor()
{
if (!HasConfiguration) return;
if (!_configuration.Led.EnableLed) return;
uint _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);
}
private GamepadFeaturesFlag GetFeaturesFlag()
{
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
@@ -220,6 +234,9 @@ namespace Ryujinx.Input.SDL2
{
_configuration = (StandardControllerInputConfig)configuration;
if (Features.HasFlag(GamepadFeaturesFlag.Led))
SetLedColor();
_buttonsUserMapping.Clear();
// First update sticks