misc: chore: Fix warnings in virtual dual Joy-Con code
Some checks failed
Release job / Create tag (push) Has been cancelled
Release job / Release for linux-arm64 (push) Has been cancelled
Release job / Release for linux-x64 (push) Has been cancelled
Release job / Release for win-x64 (push) Has been cancelled
Release job / Release MacOS universal (push) Has been cancelled
Release job / flatpak_release (push) Has been cancelled

This commit is contained in:
KeatonTheBot 2025-04-08 19:44:45 -05:00
parent 25bb6e8af7
commit 6202526666
2 changed files with 6 additions and 16 deletions

View file

@ -52,10 +52,10 @@ namespace Ryujinx.Input.SDL2
private readonly List<ButtonMappingEntry> _buttonsUserMapping;
private readonly StickInputId[] _stickUserMapping = new StickInputId[(int)StickInputId.Count]
{
StickInputId.Unbound, StickInputId.Left, StickInputId.Right,
};
private readonly StickInputId[] _stickUserMapping =
[
StickInputId.Unbound, StickInputId.Left, StickInputId.Right
];
public GamepadFeaturesFlag Features { get; }
@ -212,7 +212,8 @@ namespace Ryujinx.Input.SDL2
Vector3 value = _joyConType switch
{
JoyConType.Left => new Vector3(-values[2], values[1], values[0]),
JoyConType.Right => new Vector3(values[2], values[1], -values[0])
JoyConType.Right => new Vector3(values[2], values[1], -values[0]),
_ => throw new ArgumentOutOfRangeException()
};
return inputId switch

View file

@ -1,6 +1,4 @@
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Controller;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
@ -10,15 +8,6 @@ namespace Ryujinx.Input.SDL2
{
internal class SDL2JoyConPair(IGamepad left, IGamepad right) : IGamepad
{
private StandardControllerInputConfig _configuration;
private readonly StickInputId[] _stickUserMapping =
[
StickInputId.Unbound,
StickInputId.Left,
StickInputId.Right
];
public GamepadFeaturesFlag Features => (left?.Features ?? GamepadFeaturesFlag.None) |
(right?.Features ?? GamepadFeaturesFlag.None);