Merge 5276991517 into c140e9b23c
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Hid;
|
||||||
using SDL2;
|
using SDL2;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
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()
|
private GamepadFeaturesFlag GetFeaturesFlag()
|
||||||
{
|
{
|
||||||
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
|
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
|
||||||
@@ -220,6 +234,9 @@ namespace Ryujinx.Input.SDL2
|
|||||||
{
|
{
|
||||||
_configuration = (StandardControllerInputConfig)configuration;
|
_configuration = (StandardControllerInputConfig)configuration;
|
||||||
|
|
||||||
|
if (Features.HasFlag(GamepadFeaturesFlag.Led))
|
||||||
|
SetLedColor();
|
||||||
|
|
||||||
_buttonsUserMapping.Clear();
|
_buttonsUserMapping.Clear();
|
||||||
|
|
||||||
// First update sticks
|
// First update sticks
|
||||||
|
|||||||
Reference in New Issue
Block a user