diff options
| author | 2020-02-13 22:17:28 -0500 | |
|---|---|---|
| committer | 2020-02-13 22:17:28 -0500 | |
| commit | 27e19f87c63437db641b736429ac3503160f21ae (patch) | |
| tree | 42a00db2d3ef5e0878c486e5e09eafdba3347edb /src/core/frontend/framebuffer_layout.cpp | |
| parent | Merge pull request #3405 from lioncash/thread (diff) | |
| download | yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.gz yuzu-27e19f87c63437db641b736429ac3503160f21ae.tar.xz yuzu-27e19f87c63437db641b736429ac3503160f21ae.zip | |
Add following aspect ratios: 16:9, 21:9, Stretch to Window
Available as a drop down within the configure graphics tab.
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 17 |
1 files changed, 15 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) { | |||
| 27 | // so just calculate them both even if the other isn't showing. | 27 | // so just calculate them both even if the other isn't showing. |
| 28 | FramebufferLayout res{width, height}; | 28 | FramebufferLayout res{width, height}; |
| 29 | 29 | ||
| 30 | const float emulation_aspect_ratio{static_cast<float>(ScreenUndocked::Height) / | ||
| 31 | ScreenUndocked::Width}; | ||
| 32 | const auto window_aspect_ratio = static_cast<float>(height) / width; | 30 | const auto window_aspect_ratio = static_cast<float>(height) / width; |
| 31 | float emulation_aspect_ratio; | ||
| 32 | |||
| 33 | switch (Settings::values.aspect_ratio) { | ||
| 34 | case 0: // 16:9 (Default) | ||
| 35 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; | ||
| 36 | break; | ||
| 37 | case 1: // 21:9 | ||
| 38 | emulation_aspect_ratio = 9.f / 21; | ||
| 39 | break; | ||
| 40 | case 2: // Stretch to Window | ||
| 41 | emulation_aspect_ratio = window_aspect_ratio; | ||
| 42 | break; | ||
| 43 | default: // 16:9 | ||
| 44 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; | ||
| 45 | } | ||
| 33 | 46 | ||
| 34 | const Common::Rectangle<u32> screen_window_area{0, 0, width, height}; | 47 | const Common::Rectangle<u32> screen_window_area{0, 0, width, height}; |
| 35 | Common::Rectangle<u32> screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); | 48 | Common::Rectangle<u32> screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); |