diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-02-14 04:17:28 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-02-14 04:17:28 +0100 |
commit | 27e19f87c63437db641b736429ac3503160f21ae (patch) | |
tree | 42a00db2d3ef5e0878c486e5e09eafdba3347edb /src/core | |
parent | Merge pull request #3405 from lioncash/thread (diff) | |
download | yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.gz yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.bz2 yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.lz yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.xz yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.zst yuzu-27e19f87c63437db641b736429ac3503160f21ae.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 17 | ||||
-rw-r--r-- | src/core/settings.h | 1 |
2 files changed, 16 insertions, 2 deletions
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<float>(ScreenUndocked::Height) / - ScreenUndocked::Width}; const auto window_aspect_ratio = static_cast<float>(height) / width; + float emulation_aspect_ratio; + + switch (Settings::values.aspect_ratio) { + case 0: // 16:9 (Default) + emulation_aspect_ratio = static_cast<float>(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<float>(ScreenUndocked::Height) / ScreenUndocked::Width; + } const Common::Rectangle<u32> screen_window_area{0, 0, width, height}; Common::Rectangle<u32> screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); diff --git a/src/core/settings.h b/src/core/settings.h index e1a9a0ffa..f837d3fbc 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -429,6 +429,7 @@ struct Values { int vulkan_device; float resolution_factor; + int aspect_ratio; bool use_frame_limit; u16 frame_limit; bool use_disk_shader_cache; |