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.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Ryujinx.HLE/HOS') diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index 4927b40e..bdffb499 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -1,4 +1,6 @@ -using Ryujinx.Common.Logging; +using Ryujinx.Common.Configuration; +using Ryujinx.Common.Logging; +using Ryujinx.Configuration; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Gpu; using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap; @@ -277,13 +279,19 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger bool flipX = item.Transform.HasFlag(NativeWindowTransform.FlipX); bool flipY = item.Transform.HasFlag(NativeWindowTransform.FlipY); + AspectRatio aspectRatio = ConfigurationState.Instance.Graphics.AspectRatio.Value; + bool isStretched = aspectRatio == AspectRatio.Stretched; + ImageCrop crop = new ImageCrop( cropRect.Left, cropRect.Right, cropRect.Top, cropRect.Bottom, flipX, - flipY); + flipY, + isStretched, + aspectRatio.ToFloatX(), + aspectRatio.ToFloatY()); TextureCallbackInformation textureCallbackInformation = new TextureCallbackInformation { -- cgit v1.2.3