aboutsummaryrefslogtreecommitdiff
path: root/src/core/frontend/framebuffer_layout.cpp
diff options
context:
space:
mode:
authorzhupengfei <zhupengfei321@sina.cn>2018-08-31 14:16:16 +0800
committerfearlessTobi <thm.frey@gmail.com>2018-12-18 22:54:41 +0100
commit2dbb90ed65e1a1d132ff28ea9b56854f882233a1 (patch)
tree2a2e38805ae8af0718628682d7e911ccb253fc16 /src/core/frontend/framebuffer_layout.cpp
parentb05edf8b20b45347f8e0a1cb3f1f75b8bea07bd5 (diff)
yuzu, video_core: Screenshot functionality
Allows capturing screenshot at the current internal resolution (native for software renderer), but a setting is available to capture it in other resolutions. The screenshot is saved to a single PNG in the current layout.
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
-rw-r--r--src/core/frontend/framebuffer_layout.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp
index 8f07aedc96..f8662d1931 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