summaryrefslogtreecommitdiffstats
path: root/src/core/frontend
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-23 20:36:51 +0100
committerGitHub <noreply@github.com>2018-12-23 20:36:51 +0100
commit9a22a94a510e6f537b5156a960f0d49307089668 (patch)
tree05d895b5fc1aa0caa51cce9314fd1c81244f69a0 /src/core/frontend
parentMerge pull request #1930 from lioncash/common (diff)
parentyuzu, video_core: Screenshot functionality (diff)
downloadyuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.gz
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.bz2
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.lz
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.xz
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.zst
yuzu-9a22a94a510e6f537b5156a960f0d49307089668.zip
Diffstat (limited to 'src/core/frontend')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp15
-rw-r--r--src/core/frontend/framebuffer_layout.h7
2 files changed, 22 insertions, 0 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index 8f07aedc9..f8662d193 100644
--- a/src/core/frontend/framebuffer_layout.cpp
+++ b/src/core/frontend/framebuffer_layout.cpp
@@ -6,6 +6,7 @@
#include "common/assert.h"
#include "core/frontend/framebuffer_layout.h"
+#include "core/settings.h"
namespace Layout {
@@ -42,4 +43,18 @@ FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height) {
return res;
}
+FramebufferLayout FrameLayoutFromResolutionScale(u16 res_scale) {
+ int width, height;
+
+ if (Settings::values.use_docked_mode) {
+ width = ScreenDocked::WidthDocked * res_scale;
+ height = ScreenDocked::HeightDocked * res_scale;
+ } else {
+ width = ScreenUndocked::Width * res_scale;
+ height = ScreenUndocked::Height * res_scale;
+ }
+
+ return DefaultFrameLayout(width, height);
+}
+
} // namespace Layout
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h
index f3fddfa94..e06647794 100644
--- a/src/core/frontend/framebuffer_layout.h
+++ b/src/core/frontend/framebuffer_layout.h
@@ -9,6 +9,7 @@
namespace Layout {
enum ScreenUndocked : unsigned { Width = 1280, Height = 720 };
+enum ScreenDocked : unsigned { WidthDocked = 1920, HeightDocked = 1080 };
/// Describes the layout of the window framebuffer
struct FramebufferLayout {
@@ -34,4 +35,10 @@ struct FramebufferLayout {
*/
FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height);
+/**
+ * Convenience method to get frame layout by resolution scale
+ * @param res_scale resolution scale factor
+ */
+FramebufferLayout FrameLayoutFromResolutionScale(u16 res_scale);
+
} // namespace Layout