summaryrefslogtreecommitdiff
path: root/src/core/frontend/framebuffer_layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp17
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);