summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-02-14 05:13:23 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-02-14 05:13:23 +0100
commit22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10 (patch)
treecd026822fec8db0b27fa7bed40d4c152d4c918c2 /src
parentAdd following aspect ratios: 16:9, 21:9, Stretch to Window (diff)
downloadyuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar.gz
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar.bz2
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar.lz
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar.xz
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.tar.zst
yuzu-22f58cca5e0be7a40c8c8fbebe3d45fb68dfcf10.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp10
-rw-r--r--src/core/frontend/framebuffer_layout.h6
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) {
const auto window_aspect_ratio = static_cast<float>(height) / width;
float emulation_aspect_ratio;
- switch (Settings::values.aspect_ratio) {
- case 0: // 16:9 (Default)
+ switch (static_cast<Aspect>(Settings::values.aspect_ratio)) {
+ case Aspect::AspectDefault:
emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width;
break;
- case 1: // 21:9
+ case Aspect::Aspect21by9:
emulation_aspect_ratio = 9.f / 21;
break;
- case 2: // Stretch to Window
+ case Aspect::AspectStretch:
emulation_aspect_ratio = window_aspect_ratio;
break;
- default: // 16:9
+ default:
emulation_aspect_ratio = static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width;
}
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 {
HeightDocked = 1080,
};
+enum class Aspect {
+ AspectDefault,
+ Aspect21by9,
+ AspectStretch,
+};
+
/// Describes the layout of the window framebuffer
struct FramebufferLayout {
u32 width{ScreenUndocked::Width};