summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorSonofUgly <son_of_ugly@yahoo.com>2017-02-01 09:22:47 +0100
committerSonofUgly <son_of_ugly@yahoo.com>2017-02-23 19:49:56 +0100
commite0a4450bbd40d69d288023ab5a95eaa0b00100fd (patch)
tree288cacc8a345cea50d8c6a25c17e4ebbb1ec41d9 /src/common
parentMerge pull request #2485 from Kloen/killing-warnings-computehash64 (diff)
downloadyuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar.gz
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar.bz2
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar.lz
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar.xz
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.tar.zst
yuzu-e0a4450bbd40d69d288023ab5a95eaa0b00100fd.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/framebuffer_layout.cpp19
-rw-r--r--src/common/framebuffer_layout.h8
2 files changed, 27 insertions, 0 deletions
diff --git a/src/common/framebuffer_layout.cpp b/src/common/framebuffer_layout.cpp
index 46c008d9c..a2a0e7dad 100644
--- a/src/common/framebuffer_layout.cpp
+++ b/src/common/framebuffer_layout.cpp
@@ -6,6 +6,7 @@
#include "common/assert.h"
#include "common/framebuffer_layout.h"
+#include "core/settings.h"
#include "video_core/video_core.h"
namespace Layout {
@@ -135,4 +136,22 @@ FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool swapped
res.bottom_screen = swapped ? large_screen : small_screen;
return res;
}
+
+FramebufferLayout CustomFrameLayout(unsigned width, unsigned height) {
+ ASSERT(width > 0);
+ ASSERT(height > 0);
+
+ FramebufferLayout res{width, height, true, true, {}, {}};
+
+ MathUtil::Rectangle<unsigned> top_screen{
+ Settings::values.custom_top_left, Settings::values.custom_top_top,
+ Settings::values.custom_top_right, Settings::values.custom_top_bottom};
+ MathUtil::Rectangle<unsigned> bot_screen{
+ Settings::values.custom_bottom_left, Settings::values.custom_bottom_top,
+ Settings::values.custom_bottom_right, Settings::values.custom_bottom_bottom};
+
+ res.top_screen = top_screen;
+ res.bottom_screen = bot_screen;
+ return res;
+}
}
diff --git a/src/common/framebuffer_layout.h b/src/common/framebuffer_layout.h
index a125646a3..f1df5c55a 100644
--- a/src/common/framebuffer_layout.h
+++ b/src/common/framebuffer_layout.h
@@ -44,4 +44,12 @@ FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swa
* @return Newly created FramebufferLayout object with default screen regions initialized
*/
FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped);
+
+/**
+ * Factory method for constructing a custom FramebufferLayout
+ * @param width Window framebuffer width in pixels
+ * @param height Window framebuffer height in pixels
+ * @return Newly created FramebufferLayout object with default screen regions initialized
+ */
+FramebufferLayout CustomFrameLayout(unsigned width, unsigned height);
}