Add the LED functionality to the base IGamepad interface
This commit is contained in:
@@ -103,16 +103,16 @@ namespace Ryujinx.Input.SDL2
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLedColor()
|
||||
public void SetLed(uint packedRgb)
|
||||
{
|
||||
if (!Features.HasFlag(GamepadFeaturesFlag.Led)) return;
|
||||
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);
|
||||
|
||||
byte red = (byte)(packedRgb >> 16);
|
||||
byte green = (byte)(packedRgb >> 8);
|
||||
byte blue = (byte)(packedRgb % 256);
|
||||
|
||||
SDL_GameControllerSetLED(_gamepadHandle, red, green, blue);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Ryujinx.Input.SDL2
|
||||
_configuration = (StandardControllerInputConfig)configuration;
|
||||
|
||||
if (Features.HasFlag(GamepadFeaturesFlag.Led))
|
||||
SetLedColor();
|
||||
SetLed(_configuration.Led.LedColor);
|
||||
|
||||
_buttonsUserMapping.Clear();
|
||||
|
||||
|
||||
@@ -384,6 +384,8 @@ namespace Ryujinx.Input.SDL2
|
||||
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.SingleLeftTrigger1, (Key)_configuration.RightJoycon.ButtonSl));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLed(uint packedRgb) {}
|
||||
|
||||
public void SetTriggerThreshold(float triggerThreshold)
|
||||
{
|
||||
|
||||
@@ -75,6 +75,8 @@ namespace Ryujinx.Input.SDL2
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetLed(uint packedRgb) {}
|
||||
|
||||
public void SetTriggerThreshold(float triggerThreshold)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user