diff options
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 10 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index f94fa0041..d8821f8fd 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -30,17 +30,17 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 30 | 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; | 31 | float emulation_aspect_ratio; |
| 32 | 32 | ||
| 33 | switch (Settings::values.aspect_ratio) { | 33 | switch (static_cast<Aspect>(Settings::values.aspect_ratio)) { |
| 34 | case 0: // 16:9 (Default) | 34 | case Aspect::AspectDefault: |
| 35 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; | 35 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; |
| 36 | break; | 36 | break; |
| 37 | case 1: // 21:9 | 37 | case Aspect::Aspect21by9: |
| 38 | emulation_aspect_ratio = 9.f / 21; | 38 | emulation_aspect_ratio = 9.f / 21; |
| 39 | break; | 39 | break; |
| 40 | case 2: // Stretch to Window | 40 | case Aspect::AspectStretch: |
| 41 | emulation_aspect_ratio = window_aspect_ratio; | 41 | emulation_aspect_ratio = window_aspect_ratio; |
| 42 | break; | 42 | break; |
| 43 | default: // 16:9 | 43 | default: |
| 44 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; | 44 | emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width; |
| 45 | } | 45 | } |
| 46 | 46 | ||
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index d2370adde..948c140ac 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -18,6 +18,12 @@ enum ScreenDocked : u32 { | |||
| 18 | HeightDocked = 1080, | 18 | HeightDocked = 1080, |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | enum class Aspect { | ||
| 22 | AspectDefault, | ||
| 23 | Aspect21by9, | ||
| 24 | AspectStretch, | ||
| 25 | }; | ||
| 26 | |||
| 21 | /// Describes the layout of the window framebuffer | 27 | /// Describes the layout of the window framebuffer |
| 22 | struct FramebufferLayout { | 28 | struct FramebufferLayout { |
| 23 | u32 width{ScreenUndocked::Width}; | 29 | u32 width{ScreenUndocked::Width}; |