diff options
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index f3815170d..d2d02f9ff 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -5,16 +5,20 @@ | |||
| 5 | #include <cmath> | 5 | #include <cmath> |
| 6 | 6 | ||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "core/3ds.h" | ||
| 8 | #include "core/frontend/framebuffer_layout.h" | 9 | #include "core/frontend/framebuffer_layout.h" |
| 9 | #include "core/settings.h" | 10 | #include "core/settings.h" |
| 10 | #include "video_core/video_core.h" | ||
| 11 | 11 | ||
| 12 | namespace Layout { | 12 | namespace Layout { |
| 13 | 13 | ||
| 14 | static const float TOP_SCREEN_ASPECT_RATIO = | 14 | static const float TOP_SCREEN_ASPECT_RATIO = |
| 15 | static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth; | 15 | static_cast<float>(Core::kScreenTopHeight) / Core::kScreenTopWidth; |
| 16 | static const float BOT_SCREEN_ASPECT_RATIO = | 16 | static const float BOT_SCREEN_ASPECT_RATIO = |
| 17 | static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth; | 17 | static_cast<float>(Core::kScreenBottomHeight) / Core::kScreenBottomWidth; |
| 18 | |||
| 19 | float FramebufferLayout::GetScalingRatio() const { | ||
| 20 | return static_cast<float>(top_screen.GetWidth()) / Core::kScreenTopWidth; | ||
| 21 | } | ||
| 18 | 22 | ||
| 19 | // Finds the largest size subrectangle contained in window area that is confined to the aspect ratio | 23 | // Finds the largest size subrectangle contained in window area that is confined to the aspect ratio |
| 20 | template <class T> | 24 | template <class T> |
| @@ -106,10 +110,10 @@ FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool swapped | |||
| 106 | float window_aspect_ratio = static_cast<float>(height) / width; | 110 | float window_aspect_ratio = static_cast<float>(height) / width; |
| 107 | float emulation_aspect_ratio = | 111 | float emulation_aspect_ratio = |
| 108 | swapped | 112 | swapped |
| 109 | ? VideoCore::kScreenBottomHeight * 4 / | 113 | ? Core::kScreenBottomHeight * 4 / |
| 110 | (VideoCore::kScreenBottomWidth * 4.0f + VideoCore::kScreenTopWidth) | 114 | (Core::kScreenBottomWidth * 4.0f + Core::kScreenTopWidth) |
| 111 | : VideoCore::kScreenTopHeight * 4 / | 115 | : Core::kScreenTopHeight * 4 / |
| 112 | (VideoCore::kScreenTopWidth * 4.0f + VideoCore::kScreenBottomWidth); | 116 | (Core::kScreenTopWidth * 4.0f + Core::kScreenBottomWidth); |
| 113 | float large_screen_aspect_ratio = swapped ? BOT_SCREEN_ASPECT_RATIO : TOP_SCREEN_ASPECT_RATIO; | 117 | float large_screen_aspect_ratio = swapped ? BOT_SCREEN_ASPECT_RATIO : TOP_SCREEN_ASPECT_RATIO; |
| 114 | float small_screen_aspect_ratio = swapped ? TOP_SCREEN_ASPECT_RATIO : BOT_SCREEN_ASPECT_RATIO; | 118 | float small_screen_aspect_ratio = swapped ? TOP_SCREEN_ASPECT_RATIO : BOT_SCREEN_ASPECT_RATIO; |
| 115 | 119 | ||