From 11222516c4b5042cd8da6fdd72f53ee736139b66 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Wed, 16 Dec 2020 03:19:07 +0100 Subject: gui/gpu: Implement setting and toggle for Aspect Ratio (#1777) * gui/gpu: Implement setting and toggle for Aspect Ratio * address gdkchan feedback and add 16:10 * fix config.json file * Fix rebase * Address gdkchan feedback * Address rip feedback * Fix aspectWidth --- Ryujinx.Common/Configuration/ConfigurationState.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs') diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index 94c9ac0e..e822dcf6 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -278,6 +278,11 @@ namespace Ryujinx.Configuration /// public ReactiveObject MaxAnisotropy { get; private set; } + /// + /// Aspect Ratio applied to the renderer window. + /// + public ReactiveObject AspectRatio { get; private set; } + /// /// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead. /// @@ -308,6 +313,7 @@ namespace Ryujinx.Configuration ResScale = new ReactiveObject(); ResScaleCustom = new ReactiveObject(); MaxAnisotropy = new ReactiveObject(); + AspectRatio = new ReactiveObject(); ShadersDumpPath = new ReactiveObject(); EnableVsync = new ReactiveObject(); EnableShaderCache = new ReactiveObject(); @@ -388,6 +394,7 @@ namespace Ryujinx.Configuration ResScale = Graphics.ResScale, ResScaleCustom = Graphics.ResScaleCustom, MaxAnisotropy = Graphics.MaxAnisotropy, + AspectRatio = Graphics.AspectRatio, GraphicsShadersDumpPath = Graphics.ShadersDumpPath, LoggingEnableDebug = Logger.EnableDebug, LoggingEnableStub = Logger.EnableStub, @@ -449,6 +456,7 @@ namespace Ryujinx.Configuration Graphics.ResScale.Value = 1; Graphics.ResScaleCustom.Value = 1.0f; Graphics.MaxAnisotropy.Value = -1.0f; + Graphics.AspectRatio.Value = AspectRatio.Fixed16x9; Graphics.ShadersDumpPath.Value = ""; Logger.EnableDebug.Value = false; Logger.EnableStub.Value = true; @@ -457,7 +465,7 @@ namespace Ryujinx.Configuration Logger.EnableError.Value = true; Logger.EnableGuest.Value = true; Logger.EnableFsAccessLog.Value = false; - Logger.FilteredClasses.Value = new LogClass[] { }; + Logger.FilteredClasses.Value = Array.Empty(); Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None; Logger.EnableFileLog.Value = true; System.Language.Value = Language.AmericanEnglish; @@ -753,6 +761,15 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 18) + { + Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 18."); + + configurationFileFormat.AspectRatio = AspectRatio.Fixed16x9; + + configurationFileUpdated = true; + } + List inputConfig = new List(); inputConfig.AddRange(configurationFileFormat.ControllerConfig); inputConfig.AddRange(configurationFileFormat.KeyboardConfig); @@ -760,6 +777,7 @@ namespace Ryujinx.Configuration Graphics.ResScale.Value = configurationFileFormat.ResScale; Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom; Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy; + Graphics.AspectRatio.Value = configurationFileFormat.AspectRatio; Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath; Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug; Logger.EnableStub.Value = configurationFileFormat.LoggingEnableStub; -- cgit v1.2.3