From bec67dbef7a505fb5c4a1734be1517f67474fb4d Mon Sep 17 00:00:00 2001 From: Mary Date: Sun, 16 May 2021 17:12:14 +0200 Subject: misc: Move configuration management to the Ryujinx project (#2269) * Decouple configuration from Ryujinx.HLE and Ryujinx.Input * Move Configuration to the Ryujinx project --- Ryujinx.Input/Motion/CemuHook/Client.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Ryujinx.Input/Motion') diff --git a/Ryujinx.Input/Motion/CemuHook/Client.cs b/Ryujinx.Input/Motion/CemuHook/Client.cs index 395bd0b3..214e23f0 100644 --- a/Ryujinx.Input/Motion/CemuHook/Client.cs +++ b/Ryujinx.Input/Motion/CemuHook/Client.cs @@ -4,7 +4,7 @@ using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Controller.Motion; using Ryujinx.Common.Logging; -using Ryujinx.Configuration; +using Ryujinx.Input.HLE; using Ryujinx.Input.Motion.CemuHook.Protocol; using System; using System.Collections.Generic; @@ -29,12 +29,14 @@ namespace Ryujinx.Input.Motion.CemuHook private readonly bool[] _clientErrorStatus = new bool[Enum.GetValues(typeof(PlayerIndex)).Length]; private readonly long[] _clientRetryTimer = new long[Enum.GetValues(typeof(PlayerIndex)).Length]; + private NpadManager _npadManager; - public Client() + public Client(NpadManager npadManager) { - _hosts = new Dictionary(); - _motionData = new Dictionary>(); - _clients = new Dictionary(); + _npadManager = npadManager; + _hosts = new Dictionary(); + _motionData = new Dictionary>(); + _clients = new Dictionary(); CloseClients(); } @@ -323,7 +325,7 @@ namespace Ryujinx.Input.Motion.CemuHook ulong timestamp = inputData.MotionTimestamp; - InputConfig config = ConfigurationState.Instance.Hid.InputConfig.Value.Find(x => x.PlayerIndex == (PlayerIndex)clientId); + InputConfig config = _npadManager.GetPlayerInputConfigByIndex(clientId); lock (_motionData) { -- cgit v1.2.3