summaryrefslogtreecommitdiff
path: root/src/core/frontend/framebuffer_layout.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-05-27 18:06:59 -0700
committerGravatar Yuri Kunde Schlesner2017-05-27 18:41:24 -0700
commiteb10f250254a0153abd789e49a36945d996631a7 (patch)
tree5f7a0e290892f1137ccd28420991ef7981377cf6 /src/core/frontend/framebuffer_layout.cpp
parentOpenGL: Remove unused RendererOpenGL fields (diff)
downloadyuzu-eb10f250254a0153abd789e49a36945d996631a7.tar.gz
yuzu-eb10f250254a0153abd789e49a36945d996631a7.tar.xz
yuzu-eb10f250254a0153abd789e49a36945d996631a7.zip
Move screen size constants from video_core to core
video_core didn't even properly use them, and they were the source of many otherwise-unnecessary dependencies from core to video_core.
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp18
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
12namespace Layout { 12namespace Layout {
13 13
14static const float TOP_SCREEN_ASPECT_RATIO = 14static const float TOP_SCREEN_ASPECT_RATIO =
15 static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth; 15 static_cast<float>(Core::kScreenTopHeight) / Core::kScreenTopWidth;
16static const float BOT_SCREEN_ASPECT_RATIO = 16static const float BOT_SCREEN_ASPECT_RATIO =
17 static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth; 17 static_cast<float>(Core::kScreenBottomHeight) / Core::kScreenBottomWidth;
18
19float 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
20template <class T> 24template <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