diff --git a/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs b/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs index 3ed2880ce..8809c83f0 100644 --- a/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs +++ b/src/Ryujinx.Input.SDL2/SDL2Gamepad.cs @@ -373,7 +373,7 @@ namespace Ryujinx.Input.SDL2 if (HasConfiguration) { - var joyconStickConfig = GetLogicalJoyStickConfig(inputId); + JoyconConfigControllerStick joyconStickConfig = GetLogicalJoyStickConfig(inputId); if (joyconStickConfig != null) { diff --git a/src/Ryujinx.Input.SDL2/SDLKeyboardDriver.cs b/src/Ryujinx.Input.SDL2/SDLKeyboardDriver.cs index 69e12bda0..fef6de788 100644 --- a/src/Ryujinx.Input.SDL2/SDLKeyboardDriver.cs +++ b/src/Ryujinx.Input.SDL2/SDLKeyboardDriver.cs @@ -55,7 +55,7 @@ namespace Ryujinx.Input.SDL2 public IEnumerable GetGamepads() { - foreach (var keyboardId in _keyboardIdentifers) + foreach (string keyboardId in _keyboardIdentifers) { yield return GetGamepad(keyboardId); } diff --git a/src/Ryujinx.Input/Assigner/GamepadButtonAssigner.cs b/src/Ryujinx.Input/Assigner/GamepadButtonAssigner.cs index 80fed2b82..4c8682da5 100644 --- a/src/Ryujinx.Input/Assigner/GamepadButtonAssigner.cs +++ b/src/Ryujinx.Input/Assigner/GamepadButtonAssigner.cs @@ -144,7 +144,7 @@ namespace Ryujinx.Input.Assigner { StringWriter writer = new(); - foreach (var kvp in _stats) + foreach (KeyValuePair kvp in _stats) { writer.WriteLine($"Button {kvp.Key} -> {kvp.Value}"); } diff --git a/src/Ryujinx.Input/GamepadStateSnapshot.cs b/src/Ryujinx.Input/GamepadStateSnapshot.cs index 3de08f574..ed1bf5fe8 100644 --- a/src/Ryujinx.Input/GamepadStateSnapshot.cs +++ b/src/Ryujinx.Input/GamepadStateSnapshot.cs @@ -49,7 +49,7 @@ namespace Ryujinx.Input [MethodImpl(MethodImplOptions.AggressiveInlining)] public (float, float) GetStick(StickInputId inputId) { - var result = _joysticksState[(int)inputId]; + Array2 result = _joysticksState[(int)inputId]; return (result[0], result[1]); } diff --git a/src/Ryujinx.Input/HLE/NpadController.cs b/src/Ryujinx.Input/HLE/NpadController.cs index 380745283..357299fdd 100644 --- a/src/Ryujinx.Input/HLE/NpadController.cs +++ b/src/Ryujinx.Input/HLE/NpadController.cs @@ -276,7 +276,7 @@ namespace Ryujinx.Input.HLE public void Update() { // _gamepad may be altered by other threads - var gamepad = _gamepad; + IGamepad gamepad = _gamepad; if (gamepad != null && GamepadDriver != null) { @@ -489,7 +489,7 @@ namespace Ryujinx.Input.HLE public static KeyboardInput GetHLEKeyboardInput(IGamepadDriver KeyboardDriver) { - var keyboard = KeyboardDriver.GetGamepad("0") as IKeyboard; + IKeyboard keyboard = KeyboardDriver.GetGamepad("0") as IKeyboard; KeyboardStateSnapshot keyboardState = keyboard.GetKeyboardStateSnapshot(); diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 08f222a91..0b3278be5 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Numerics; using System.Runtime.CompilerServices; using System.Threading; using CemuHookClient = Ryujinx.Input.Motion.CemuHook.Client; @@ -56,7 +57,7 @@ namespace Ryujinx.Input.HLE lock (_lock) { List validInputs = new(); - foreach (var inputConfigEntry in _inputConfig) + foreach (InputConfig inputConfigEntry in _inputConfig) { if (_controllers[(int)inputConfigEntry.PlayerIndex] != null) { @@ -234,7 +235,7 @@ namespace Ryujinx.Input.HLE isJoyconPair = inputConfig.ControllerType == ControllerType.JoyconPair; - var altMotionState = isJoyconPair ? controller.GetHLEMotionState(true) : default; + SixAxisInput altMotionState = isJoyconPair ? controller.GetHLEMotionState(true) : default; motionState = (controller.GetHLEMotionState(), altMotionState); } @@ -273,9 +274,9 @@ namespace Ryujinx.Input.HLE if (_enableMouse) { - var mouse = _mouseDriver.GetGamepad("0") as IMouse; + IMouse mouse = _mouseDriver.GetGamepad("0") as IMouse; - var mouseInput = IMouse.GetMouseStateSnapshot(mouse); + MouseStateSnapshot mouseInput = IMouse.GetMouseStateSnapshot(mouse); uint buttons = 0; @@ -304,7 +305,7 @@ namespace Ryujinx.Input.HLE buttons |= 1 << 4; } - var position = IMouse.GetScreenPosition(mouseInput.Position, mouse.ClientSize, aspectRatio); + Vector2 position = IMouse.GetScreenPosition(mouseInput.Position, mouse.ClientSize, aspectRatio); _device.Hid.Mouse.Update((int)position.X, (int)position.Y, buttons, (int)mouseInput.Scroll.X, (int)mouseInput.Scroll.Y, true); } diff --git a/src/Ryujinx.Input/HLE/TouchScreenManager.cs b/src/Ryujinx.Input/HLE/TouchScreenManager.cs index c613f9281..28d800d18 100644 --- a/src/Ryujinx.Input/HLE/TouchScreenManager.cs +++ b/src/Ryujinx.Input/HLE/TouchScreenManager.cs @@ -2,6 +2,7 @@ using Ryujinx.HLE; using Ryujinx.HLE.HOS.Services.Hid; using Ryujinx.HLE.HOS.Services.Hid.Types.SharedMemory.TouchScreen; using System; +using System.Numerics; namespace Ryujinx.Input.HLE { @@ -29,7 +30,7 @@ namespace Ryujinx.Input.HLE if (_wasClicking && !isClicking) { MouseStateSnapshot snapshot = IMouse.GetMouseStateSnapshot(_mouse); - var touchPosition = IMouse.GetScreenPosition(snapshot.Position, _mouse.ClientSize, aspectRatio); + Vector2 touchPosition = IMouse.GetScreenPosition(snapshot.Position, _mouse.ClientSize, aspectRatio); TouchPoint currentPoint = new() { @@ -58,7 +59,7 @@ namespace Ryujinx.Input.HLE if (aspectRatio > 0) { MouseStateSnapshot snapshot = IMouse.GetMouseStateSnapshot(_mouse); - var touchPosition = IMouse.GetScreenPosition(snapshot.Position, _mouse.ClientSize, aspectRatio); + Vector2 touchPosition = IMouse.GetScreenPosition(snapshot.Position, _mouse.ClientSize, aspectRatio); TouchAttribute attribute = TouchAttribute.None; diff --git a/src/Ryujinx.Input/Motion/CemuHook/Client.cs b/src/Ryujinx.Input/Motion/CemuHook/Client.cs index e19f3d847..d07ae6431 100644 --- a/src/Ryujinx.Input/Motion/CemuHook/Client.cs +++ b/src/Ryujinx.Input/Motion/CemuHook/Client.cs @@ -48,7 +48,7 @@ namespace Ryujinx.Input.Motion.CemuHook lock (_clients) { - foreach (var client in _clients) + foreach (KeyValuePair client in _clients) { try { @@ -209,7 +209,7 @@ namespace Ryujinx.Input.Motion.CemuHook { client.Client.ReceiveTimeout = timeout; - var result = client?.Receive(ref endPoint); + byte[] result = client?.Receive(ref endPoint); if (result.Length > 0) { @@ -225,7 +225,7 @@ namespace Ryujinx.Input.Motion.CemuHook private void SetRetryTimer(int clientId) { - var elapsedMs = PerformanceCounter.ElapsedMilliseconds; + long elapsedMs = PerformanceCounter.ElapsedMilliseconds; _clientRetryTimer[clientId] = elapsedMs; } @@ -338,9 +338,9 @@ namespace Ryujinx.Input.Motion.CemuHook { int slot = inputData.Shared.Slot; - if (_motionData.TryGetValue(clientId, out var motionDataItem)) + if (_motionData.TryGetValue(clientId, out Dictionary motionDataItem)) { - if (motionDataItem.TryGetValue(slot, out var previousData)) + if (motionDataItem.TryGetValue(slot, out MotionInput previousData)) { previousData.Update(accelerometer, gyroscrope, timestamp, cemuHookConfig.Sensitivity, (float)cemuHookConfig.GyroDeadzone); }