VERY experimental Nintendo Switch 2 emulator
C++
Use enumeration instead of magic numbers
Morphdb5dc22c68a6
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cppindex f94fa00415..d8821f8fd9 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.hindex d2370added..948c140aca 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 framebufferstruct FramebufferLayout {u32 width{ScreenUndocked::Width};