From 09107b67ff4d2d124dde1211816bc5300b1182fe Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sat, 28 Dec 2024 05:08:21 -0600 Subject: [PATCH] misc: Remove GAL/Configuration duplicate enums --- .../Configuration/AspectRatioExtensions.cs | 2 ++ .../Configuration/ScalingFilter.cs | 1 + src/Ryujinx.Graphics.GAL/AntiAliasing.cs | 12 ----------- src/Ryujinx.Graphics.GAL/UpscaleType.cs | 10 ---------- src/Ryujinx.Graphics.Metal/Window.cs | 3 --- src/Ryujinx.Graphics.OpenGL/Window.cs | 2 -- src/Ryujinx.Graphics.Vulkan/Window.cs | 2 -- src/Ryujinx.Graphics.Vulkan/WindowBase.cs | 2 -- .../Extensions/FileSystemExtensions.cs | 2 +- .../DiscordIntegrationModule.cs | 1 - src/Ryujinx/AppHost.cs | 20 +++++++++---------- src/Ryujinx/Headless/Options.cs | 6 +++--- src/Ryujinx/Headless/WindowBase.cs | 4 ++-- 13 files changed, 19 insertions(+), 48 deletions(-) delete mode 100644 src/Ryujinx.Graphics.GAL/AntiAliasing.cs delete mode 100644 src/Ryujinx.Graphics.GAL/UpscaleType.cs diff --git a/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs b/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs index bae6e35de..05dbe67d9 100644 --- a/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs +++ b/src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs @@ -35,6 +35,8 @@ namespace Ryujinx.Common.Configuration #pragma warning restore IDE0055 }; } + + public static float ToFloatY(this AspectRatio aspectRatio) { diff --git a/src/Ryujinx.Common/Configuration/ScalingFilter.cs b/src/Ryujinx.Common/Configuration/ScalingFilter.cs index 1c6a74b3a..474685d49 100644 --- a/src/Ryujinx.Common/Configuration/ScalingFilter.cs +++ b/src/Ryujinx.Common/Configuration/ScalingFilter.cs @@ -9,5 +9,6 @@ namespace Ryujinx.Common.Configuration Bilinear, Nearest, Fsr, + Area, } } diff --git a/src/Ryujinx.Graphics.GAL/AntiAliasing.cs b/src/Ryujinx.Graphics.GAL/AntiAliasing.cs deleted file mode 100644 index 04b529764..000000000 --- a/src/Ryujinx.Graphics.GAL/AntiAliasing.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Ryujinx.Graphics.GAL -{ - public enum AntiAliasing - { - None, - Fxaa, - SmaaLow, - SmaaMedium, - SmaaHigh, - SmaaUltra, - } -} diff --git a/src/Ryujinx.Graphics.GAL/UpscaleType.cs b/src/Ryujinx.Graphics.GAL/UpscaleType.cs deleted file mode 100644 index e2482faef..000000000 --- a/src/Ryujinx.Graphics.GAL/UpscaleType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Ryujinx.Graphics.GAL -{ - public enum ScalingFilter - { - Bilinear, - Nearest, - Fsr, - Area, - } -} diff --git a/src/Ryujinx.Graphics.Metal/Window.cs b/src/Ryujinx.Graphics.Metal/Window.cs index 61137f97d..7d9a51a9e 100644 --- a/src/Ryujinx.Graphics.Metal/Window.cs +++ b/src/Ryujinx.Graphics.Metal/Window.cs @@ -2,13 +2,10 @@ using Ryujinx.Common.Configuration; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Metal.Effects; -using Ryujinx.Graphics.Metal.SharpMetalExtensions; using SharpMetal.ObjectiveCCore; using SharpMetal.QuartzCore; using System; using System.Runtime.Versioning; -using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing; -using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter; namespace Ryujinx.Graphics.Metal { diff --git a/src/Ryujinx.Graphics.OpenGL/Window.cs b/src/Ryujinx.Graphics.OpenGL/Window.cs index 8c35663ab..f161be506 100644 --- a/src/Ryujinx.Graphics.OpenGL/Window.cs +++ b/src/Ryujinx.Graphics.OpenGL/Window.cs @@ -5,8 +5,6 @@ using Ryujinx.Graphics.OpenGL.Effects; using Ryujinx.Graphics.OpenGL.Effects.Smaa; using Ryujinx.Graphics.OpenGL.Image; using System; -using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing; -using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter; namespace Ryujinx.Graphics.OpenGL { diff --git a/src/Ryujinx.Graphics.Vulkan/Window.cs b/src/Ryujinx.Graphics.Vulkan/Window.cs index d135d0076..8e53e7f7e 100644 --- a/src/Ryujinx.Graphics.Vulkan/Window.cs +++ b/src/Ryujinx.Graphics.Vulkan/Window.cs @@ -5,8 +5,6 @@ using Silk.NET.Vulkan; using Silk.NET.Vulkan.Extensions.KHR; using System; using System.Linq; -using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing; -using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter; using VkFormat = Silk.NET.Vulkan.Format; namespace Ryujinx.Graphics.Vulkan diff --git a/src/Ryujinx.Graphics.Vulkan/WindowBase.cs b/src/Ryujinx.Graphics.Vulkan/WindowBase.cs index 807bb65e5..34ac63a83 100644 --- a/src/Ryujinx.Graphics.Vulkan/WindowBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/WindowBase.cs @@ -1,8 +1,6 @@ using Ryujinx.Common.Configuration; using Ryujinx.Graphics.GAL; using System; -using AntiAliasing = Ryujinx.Graphics.GAL.AntiAliasing; -using ScalingFilter = Ryujinx.Graphics.GAL.ScalingFilter; namespace Ryujinx.Graphics.Vulkan { diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs index cd215781f..97284f3bb 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs @@ -102,7 +102,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions } // Initialize GPU. - Graphics.Gpu.GraphicsConfig.TitleId = $"{programId:x16}"; + Graphics.Gpu.GraphicsConfig.TitleId = programId.ToString("X16"); device.Gpu.HostInitalized.Set(); if (!MemoryBlock.SupportsFlags(MemoryAllocationFlags.ViewCompatible)) diff --git a/src/Ryujinx.UI.Common/DiscordIntegrationModule.cs b/src/Ryujinx.UI.Common/DiscordIntegrationModule.cs index 0cb9779ff..574aaff87 100644 --- a/src/Ryujinx.UI.Common/DiscordIntegrationModule.cs +++ b/src/Ryujinx.UI.Common/DiscordIntegrationModule.cs @@ -5,7 +5,6 @@ using Ryujinx.Common; using Ryujinx.HLE.Loaders.Processes; using Ryujinx.UI.App.Common; using Ryujinx.UI.Common.Configuration; -using System.Linq; using System.Text; namespace Ryujinx.UI.Common diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 9a9c1d226..909eb05d5 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -289,19 +289,19 @@ namespace Ryujinx.Ava private void UpdateScalingFilterLevel(object sender, ReactiveEventArgs e) { - _renderer.Window?.SetScalingFilter((Graphics.GAL.ScalingFilter)ConfigurationState.Instance.Graphics.ScalingFilter.Value); - _renderer.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel.Value); + _renderer.Window?.SetScalingFilter(ConfigurationState.Instance.Graphics.ScalingFilter); + _renderer.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel); } private void UpdateScalingFilter(object sender, ReactiveEventArgs e) { - _renderer.Window?.SetScalingFilter((Graphics.GAL.ScalingFilter)ConfigurationState.Instance.Graphics.ScalingFilter.Value); - _renderer.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel.Value); + _renderer.Window?.SetScalingFilter(ConfigurationState.Instance.Graphics.ScalingFilter); + _renderer.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel); } private void UpdateColorSpacePassthrough(object sender, ReactiveEventArgs e) { - _renderer.Window?.SetColorSpacePassthrough((bool)ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough.Value); + _renderer.Window?.SetColorSpacePassthrough(ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough); } public void UpdateVSyncMode(object sender, ReactiveEventArgs e) @@ -526,7 +526,7 @@ namespace Ryujinx.Ava private void UpdateAntiAliasing(object sender, ReactiveEventArgs e) { - _renderer?.Window?.SetAntiAliasing((Graphics.GAL.AntiAliasing)e.NewValue); + _renderer?.Window?.SetAntiAliasing(e.NewValue); } private void UpdateDockedModeState(object sender, ReactiveEventArgs e) @@ -1057,10 +1057,10 @@ namespace Ryujinx.Ava Device.Gpu.Renderer.Initialize(_glLogLevel); - _renderer?.Window?.SetAntiAliasing((Graphics.GAL.AntiAliasing)ConfigurationState.Instance.Graphics.AntiAliasing.Value); - _renderer?.Window?.SetScalingFilter((Graphics.GAL.ScalingFilter)ConfigurationState.Instance.Graphics.ScalingFilter.Value); - _renderer?.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel.Value); - _renderer?.Window?.SetColorSpacePassthrough(ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough.Value); + _renderer?.Window?.SetAntiAliasing(ConfigurationState.Instance.Graphics.AntiAliasing); + _renderer?.Window?.SetScalingFilter(ConfigurationState.Instance.Graphics.ScalingFilter); + _renderer?.Window?.SetScalingFilterLevel(ConfigurationState.Instance.Graphics.ScalingFilterLevel); + _renderer?.Window?.SetColorSpacePassthrough(ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough); Width = (int)RendererHost.Bounds.Width; Height = (int)RendererHost.Bounds.Height; diff --git a/src/Ryujinx/Headless/Options.cs b/src/Ryujinx/Headless/Options.cs index 0dd4216f0..b0a349a2b 100644 --- a/src/Ryujinx/Headless/Options.cs +++ b/src/Ryujinx/Headless/Options.cs @@ -250,10 +250,10 @@ namespace Ryujinx.Headless [Option("hide-cursor", Required = false, Default = HideCursorMode.OnIdle, HelpText = "Change when the cursor gets hidden.")] public HideCursorMode HideCursorMode { get; set; } - [Option("list-input-profiles", Required = false, HelpText = "List inputs profiles.")] + [Option("list-input-profiles", Required = false, HelpText = "List input profiles.")] public bool ListInputProfiles { get; set; } - [Option("list-inputs-ids", Required = false, HelpText = "List inputs ids.")] + [Option("list-input-ids", Required = false, HelpText = "List input IDs.")] public bool ListInputIds { get; set; } // System @@ -370,7 +370,7 @@ namespace Ryujinx.Headless [Option("anti-aliasing", Required = false, Default = AntiAliasing.None, HelpText = "Set the type of anti aliasing being used. [None|Fxaa|SmaaLow|SmaaMedium|SmaaHigh|SmaaUltra]")] public AntiAliasing AntiAliasing { get; set; } - [Option("scaling-filter", Required = false, Default = ScalingFilter.Bilinear, HelpText = "Set the scaling filter. [Bilinear|Nearest|Fsr]")] + [Option("scaling-filter", Required = false, Default = ScalingFilter.Bilinear, HelpText = "Set the scaling filter. [Bilinear|Nearest|Fsr|Area]")] public ScalingFilter ScalingFilter { get; set; } [Option("scaling-filter-level", Required = false, Default = 0, HelpText = "Set the scaling filter intensity (currently only applies to FSR). [0-100]")] diff --git a/src/Ryujinx/Headless/WindowBase.cs b/src/Ryujinx/Headless/WindowBase.cs index 21bee368a..d89638cc1 100644 --- a/src/Ryujinx/Headless/WindowBase.cs +++ b/src/Ryujinx/Headless/WindowBase.cs @@ -255,12 +255,12 @@ namespace Ryujinx.Headless private void SetAntiAliasing() { - Renderer?.Window.SetAntiAliasing((Graphics.GAL.AntiAliasing)AntiAliasing); + Renderer?.Window.SetAntiAliasing(AntiAliasing); } private void SetScalingFilter() { - Renderer?.Window.SetScalingFilter((Graphics.GAL.ScalingFilter)ScalingFilter); + Renderer?.Window.SetScalingFilter(ScalingFilter); Renderer?.Window.SetScalingFilterLevel(ScalingFilterLevel); }