diff options
author | SonofUgly <son_of_ugly@yahoo.com> | 2017-02-01 00:22:47 -0800 |
---|---|---|
committer | SonofUgly <son_of_ugly@yahoo.com> | 2017-02-23 10:49:56 -0800 |
commit | e0a4450bbd40d69d288023ab5a95eaa0b00100fd (patch) | |
tree | 288cacc8a345cea50d8c6a25c17e4ebbb1ec41d9 /src/common/framebuffer_layout.cpp | |
parent | ac4ea522cbe653f6362357ca108ca3bf726b6229 (diff) |
Add custom layout settings.
Diffstat (limited to 'src/common/framebuffer_layout.cpp')
-rw-r--r-- | src/common/framebuffer_layout.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/framebuffer_layout.cpp b/src/common/framebuffer_layout.cpp index 46c008d9cb..a2a0e7dada 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; +} } |