mirror of
				https://github.com/Ryujinx/Ryujinx.git
				synced 2025-10-31 16:22:49 +00:00 
			
		
		
		
	Compare commits
	
		
			7 Commits
		
	
	
		
			7bbe0dd09c
			...
			5e4a8342f0
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 5e4a8342f0 | ||
|   | 7d158acc3b | ||
|   | b49b348c96 | ||
|   | 6aaec6da5d | ||
|   | dc3614248c | ||
|   | 3f6fca2921 | ||
|   | 89c2c6c76b | 
| @ -743,7 +743,7 @@ namespace Ryujinx.Graphics.Gpu.Shader | ||||
|                 constantBufferUsePerStageMask &= ~(1 << index); | ||||
|             } | ||||
| 
 | ||||
|             if (checkTextures) | ||||
|             if (checkTextures && _allTextures.Length > 0) | ||||
|             { | ||||
|                 TexturePool pool = channel.TextureManager.GetTexturePool(poolState.TexturePoolGpuVa, poolState.TexturePoolMaximumId); | ||||
| 
 | ||||
|  | ||||
| @ -313,6 +313,33 @@ namespace Ryujinx.Input.SDL2 | ||||
|             return value * ConvertRate; | ||||
|         } | ||||
| 
 | ||||
|         private JoyconConfigControllerStick<GamepadInputId, Common.Configuration.Hid.Controller.StickInputId> GetLogicalJoyStickConfig(StickInputId inputId) | ||||
|         { | ||||
|             switch (inputId) | ||||
|             { | ||||
|                 case StickInputId.Left: | ||||
|                     if (_configuration.RightJoyconStick.Joystick == Common.Configuration.Hid.Controller.StickInputId.Left) | ||||
|                     { | ||||
|                         return _configuration.RightJoyconStick; | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         return _configuration.LeftJoyconStick; | ||||
|                     } | ||||
|                 case StickInputId.Right: | ||||
|                     if (_configuration.LeftJoyconStick.Joystick == Common.Configuration.Hid.Controller.StickInputId.Right) | ||||
|                     { | ||||
|                         return _configuration.LeftJoyconStick; | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         return _configuration.RightJoyconStick; | ||||
|                     } | ||||
|             } | ||||
| 
 | ||||
|             return null; | ||||
|         } | ||||
| 
 | ||||
|         public (float, float) GetStick(StickInputId inputId) | ||||
|         { | ||||
|             if (inputId == StickInputId.Unbound) | ||||
| @ -343,26 +370,28 @@ namespace Ryujinx.Input.SDL2 | ||||
| 
 | ||||
|             if (HasConfiguration) | ||||
|             { | ||||
|                 if ((inputId == StickInputId.Left && _configuration.LeftJoyconStick.InvertStickX) || | ||||
|                     (inputId == StickInputId.Right && _configuration.RightJoyconStick.InvertStickX)) | ||||
|                 var joyconStickConfig = GetLogicalJoyStickConfig(inputId); | ||||
| 
 | ||||
|                 if (joyconStickConfig != null) | ||||
|                 { | ||||
|                     if (joyconStickConfig.InvertStickX) | ||||
|                     { | ||||
|                         resultX = -resultX; | ||||
|                     } | ||||
| 
 | ||||
|                 if ((inputId == StickInputId.Left && _configuration.LeftJoyconStick.InvertStickY) || | ||||
|                     (inputId == StickInputId.Right && _configuration.RightJoyconStick.InvertStickY)) | ||||
|                     if (joyconStickConfig.InvertStickY) | ||||
|                     { | ||||
|                         resultY = -resultY; | ||||
|                     } | ||||
| 
 | ||||
|                 if ((inputId == StickInputId.Left && _configuration.LeftJoyconStick.Rotate90CW) || | ||||
|                     (inputId == StickInputId.Right && _configuration.RightJoyconStick.Rotate90CW)) | ||||
|                     if (joyconStickConfig.Rotate90CW) | ||||
|                     { | ||||
|                         float temp = resultX; | ||||
|                         resultX = resultY; | ||||
|                         resultY = -temp; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             return (resultX, resultY); | ||||
|         } | ||||
|  | ||||
| @ -45,7 +45,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input | ||||
| 
 | ||||
|         private PlayerIndex _playerId; | ||||
|         private int _controller; | ||||
|         private int _controllerNumber; | ||||
|         private string _controllerImage; | ||||
|         private int _device; | ||||
|         private object _configViewModel; | ||||
| @ -439,6 +438,24 @@ namespace Ryujinx.Ava.UI.ViewModels.Input | ||||
| 
 | ||||
|         public void LoadDevices() | ||||
|         { | ||||
|             string GetGamepadName(IGamepad gamepad, int controllerNumber) | ||||
|             { | ||||
|                 return $"{GetShortGamepadName(gamepad.Name)} ({controllerNumber})"; | ||||
|             } | ||||
| 
 | ||||
|             string GetUniqueGamepadName(IGamepad gamepad, ref int controllerNumber) | ||||
|             { | ||||
|                 var name = GetGamepadName(gamepad, controllerNumber); | ||||
| 
 | ||||
|                 if (Devices.Any(controller => controller.Name == name)) | ||||
|                 { | ||||
|                     controllerNumber++; | ||||
|                     name = GetGamepadName(gamepad, controllerNumber); | ||||
|                 } | ||||
| 
 | ||||
|                 return name; | ||||
|             } | ||||
| 
 | ||||
|             lock (Devices) | ||||
|             { | ||||
|                 Devices.Clear(); | ||||
| @ -455,23 +472,18 @@ namespace Ryujinx.Ava.UI.ViewModels.Input | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 var controllerNumber = 0; | ||||
|                 foreach (string id in _mainWindow.InputManager.GamepadDriver.GamepadsIds) | ||||
|                 { | ||||
|                     using IGamepad gamepad = _mainWindow.InputManager.GamepadDriver.GetGamepad(id); | ||||
| 
 | ||||
|                     if (gamepad != null) | ||||
|                     { | ||||
|                         if (Devices.Any(controller => GetShortGamepadId(controller.Id) == GetShortGamepadId(gamepad.Id))) | ||||
|                         { | ||||
|                             _controllerNumber++; | ||||
|                         } | ||||
| 
 | ||||
|                         Devices.Add((DeviceType.Controller, id, $"{GetShortGamepadName(gamepad.Name)} ({_controllerNumber})")); | ||||
|                         var name = GetUniqueGamepadName(gamepad, ref controllerNumber); | ||||
|                         Devices.Add((DeviceType.Controller, id, name)); | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 _controllerNumber = 0; | ||||
| 
 | ||||
|                 DeviceList.AddRange(Devices.Select(x => x.Name)); | ||||
|                 Device = Math.Min(Device, DeviceList.Count); | ||||
|             } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user