summaryrefslogtreecommitdiff
path: root/src/core/frontend/framebuffer_layout.cpp
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2020-10-13 16:20:44 -0300
committerGravatar GitHub2020-10-13 16:20:44 -0300
commitc5b3c8d06bcfa343b2cecbfc60b3530b306ebe88 (patch)
tree9565ff464bbb9e5a0aa66e6e310098314e88d019 /src/core/frontend/framebuffer_layout.cpp
parentMerge pull request #3929 from FearlessTobi/ticket-keys (diff)
parentcore/CMakeLists: Make some warnings errors (diff)
downloadyuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.gz
yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.tar.xz
yuzu-c5b3c8d06bcfa343b2cecbfc60b3530b306ebe88.zip
Merge pull request #4786 from lioncash/flags
core/CMakeLists: Make some warnings errors
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index c1fbc235b..1acc82497 100644
--- a/src/core/frontend/framebuffer_layout.cpp
+++ b/src/core/frontend/framebuffer_layout.cpp
@@ -14,8 +14,8 @@ namespace Layout {
14template <class T> 14template <class T>
15static Common::Rectangle<T> MaxRectangle(Common::Rectangle<T> window_area, 15static Common::Rectangle<T> MaxRectangle(Common::Rectangle<T> window_area,
16 float screen_aspect_ratio) { 16 float screen_aspect_ratio) {
17 float scale = std::min(static_cast<float>(window_area.GetWidth()), 17 const float scale = std::min(static_cast<float>(window_area.GetWidth()),
18 window_area.GetHeight() / screen_aspect_ratio); 18 static_cast<float>(window_area.GetHeight()) / screen_aspect_ratio);
19 return Common::Rectangle<T>{0, 0, static_cast<T>(std::round(scale)), 19 return Common::Rectangle<T>{0, 0, static_cast<T>(std::round(scale)),
20 static_cast<T>(std::round(scale * screen_aspect_ratio))}; 20 static_cast<T>(std::round(scale * screen_aspect_ratio))};
21} 21}
@@ -27,7 +27,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) {
27 // so just calculate them both even if the other isn't showing. 27 // so just calculate them both even if the other isn't showing.
28 FramebufferLayout res{width, height, false, {}}; 28 FramebufferLayout res{width, height, false, {}};
29 29
30 const float window_aspect_ratio = static_cast<float>(height) / width; 30 const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width);
31 const float emulation_aspect_ratio = EmulationAspectRatio( 31 const float emulation_aspect_ratio = EmulationAspectRatio(
32 static_cast<AspectRatio>(Settings::values.aspect_ratio.GetValue()), window_aspect_ratio); 32 static_cast<AspectRatio>(Settings::values.aspect_ratio.GetValue()), window_aspect_ratio);
33 33