Skip to content

Commit

Permalink
misc: Remove GAL/Configuration duplicate enums
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Dec 28, 2024
1 parent 12b264a commit 09107b6
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 48 deletions.
2 changes: 2 additions & 0 deletions src/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public static float ToFloatX(this AspectRatio aspectRatio)
#pragma warning restore IDE0055
};
}



public static float ToFloatY(this AspectRatio aspectRatio)
{
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx.Common/Configuration/ScalingFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public enum ScalingFilter
Bilinear,
Nearest,
Fsr,
Area,
}
}
12 changes: 0 additions & 12 deletions src/Ryujinx.Graphics.GAL/AntiAliasing.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Ryujinx.Graphics.GAL/UpscaleType.cs

This file was deleted.

3 changes: 0 additions & 3 deletions src/Ryujinx.Graphics.Metal/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
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
{
Expand Down
2 changes: 0 additions & 2 deletions src/Ryujinx.Graphics.OpenGL/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
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
{
Expand Down
2 changes: 0 additions & 2 deletions src/Ryujinx.Graphics.Vulkan/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
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
Expand Down
2 changes: 0 additions & 2 deletions src/Ryujinx.Graphics.Vulkan/WindowBase.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static ProcessResult Load(this IFileSystem exeFs, Switch device, BlitStru
}

// Initialize GPU.
Graphics.Gpu.GraphicsConfig.TitleId = $"{programId:x16}";
Graphics.Gpu.GraphicsConfig.TitleId = programId.ToString("X16");
device.Gpu.HostInitalized.Set();

if (!MemoryBlock.SupportsFlags(MemoryAllocationFlags.ViewCompatible))
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.UI.Common/DiscordIntegrationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
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
Expand Down
20 changes: 10 additions & 10 deletions src/Ryujinx/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,19 @@ private void TopLevel_PointerExited(object sender, PointerEventArgs e)

private void UpdateScalingFilterLevel(object sender, ReactiveEventArgs<int> 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<ScalingFilter> 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<bool> e)
{
_renderer.Window?.SetColorSpacePassthrough((bool)ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough.Value);
_renderer.Window?.SetColorSpacePassthrough(ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough);
}

public void UpdateVSyncMode(object sender, ReactiveEventArgs<VSyncMode> e)
Expand Down Expand Up @@ -526,7 +526,7 @@ private void UpdateAspectRatioState(object sender, ReactiveEventArgs<AspectRatio

private void UpdateAntiAliasing(object sender, ReactiveEventArgs<AntiAliasing> e)
{
_renderer?.Window?.SetAntiAliasing((Graphics.GAL.AntiAliasing)e.NewValue);
_renderer?.Window?.SetAntiAliasing(e.NewValue);
}

private void UpdateDockedModeState(object sender, ReactiveEventArgs<bool> e)
Expand Down Expand Up @@ -1057,10 +1057,10 @@ private void RenderLoop()

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;
Expand Down
6 changes: 3 additions & 3 deletions src/Ryujinx/Headless/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ string OptionName(string propertyName) =>
[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
Expand Down Expand Up @@ -370,7 +370,7 @@ string OptionName(string propertyName) =>
[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]")]
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx/Headless/WindowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ private string GetGpuDriverName()

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);
}

Expand Down

0 comments on commit 09107b6

Please sign in to comment.