From 27e19f87c63437db641b736429ac3503160f21ae Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 13 Feb 2020 22:17:28 -0500 Subject: Add following aspect ratios: 16:9, 21:9, Stretch to Window Available as a drop down within the configure graphics tab. --- src/core/frontend/framebuffer_layout.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/core/frontend/framebuffer_layout.cpp') diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index d6d2cf3f0..f94fa0041 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -27,9 +27,22 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { // so just calculate them both even if the other isn't showing. FramebufferLayout res{width, height}; - const float emulation_aspect_ratio{static_cast(ScreenUndocked::Height) / - ScreenUndocked::Width}; const auto window_aspect_ratio = static_cast(height) / width; + float emulation_aspect_ratio; + + switch (Settings::values.aspect_ratio) { + case 0: // 16:9 (Default) + emulation_aspect_ratio = static_cast(ScreenUndocked::Height) / ScreenUndocked::Width; + break; + case 1: // 21:9 + emulation_aspect_ratio = 9.f / 21; + break; + case 2: // Stretch to Window + emulation_aspect_ratio = window_aspect_ratio; + break; + default: // 16:9 + emulation_aspect_ratio = static_cast(ScreenUndocked::Height) / ScreenUndocked::Width; + } const Common::Rectangle screen_window_area{0, 0, width, height}; Common::Rectangle screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); -- cgit v1.2.3