diff options
Diffstat (limited to 'src/core/frontend/framebuffer_layout.cpp')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 15 |
1 files changed, 15 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 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "core/frontend/framebuffer_layout.h" | 8 | #include "core/frontend/framebuffer_layout.h" |
| 9 | #include "core/settings.h" | ||
| 9 | 10 | ||
| 10 | namespace Layout { | 11 | namespace Layout { |
| 11 | 12 | ||
| @@ -42,4 +43,18 @@ FramebufferLayout DefaultFrameLayout(unsigned width, unsigned height) { | |||
| 42 | return res; | 43 | return res; |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 46 | FramebufferLayout FrameLayoutFromResolutionScale(u16 res_scale) { | ||
| 47 | int width, height; | ||
| 48 | |||
| 49 | if (Settings::values.use_docked_mode) { | ||
| 50 | width = ScreenDocked::WidthDocked * res_scale; | ||
| 51 | height = ScreenDocked::HeightDocked * res_scale; | ||
| 52 | } else { | ||
| 53 | width = ScreenUndocked::Width * res_scale; | ||
| 54 | height = ScreenUndocked::Height * res_scale; | ||
| 55 | } | ||
| 56 | |||
| 57 | return DefaultFrameLayout(width, height); | ||
| 58 | } | ||
| 59 | |||
| 45 | } // namespace Layout | 60 | } // namespace Layout |