diff options
| author | 2021-09-10 01:28:02 -0400 | |
|---|---|---|
| committer | 2021-11-16 22:11:30 +0100 | |
| commit | 80f8d4989eca127c7ca8c7bd63134127d6fd5edc (patch) | |
| tree | 299bc0d76a3972fbd1875fec40c051bf8c07ce6c /src/core/frontend | |
| parent | gl_texture_cache: Simplify scaling (diff) | |
| download | yuzu-80f8d4989eca127c7ca8c7bd63134127d6fd5edc.tar.gz yuzu-80f8d4989eca127c7ca8c7bd63134127d6fd5edc.tar.xz yuzu-80f8d4989eca127c7ca8c7bd63134127d6fd5edc.zip | |
bootmanager: Fix screenshot resolution factor usage
Fixes screenshots at non integer scaling
Diffstat (limited to 'src/core/frontend')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 15 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 0832463d6..4b58b672a 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -44,16 +44,13 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 44 | return res; | 44 | return res; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale) { | 47 | FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale) { |
| 48 | u32 width, height; | 48 | const bool is_docked = Settings::values.use_docked_mode.GetValue(); |
| 49 | const u32 screen_width = is_docked ? ScreenDocked::Width : ScreenUndocked::Width; | ||
| 50 | const u32 screen_height = is_docked ? ScreenDocked::Height : ScreenUndocked::Height; | ||
| 49 | 51 | ||
| 50 | if (Settings::values.use_docked_mode.GetValue()) { | 52 | const u32 width = static_cast<u32>(static_cast<f32>(screen_width) * res_scale); |
| 51 | width = ScreenDocked::Width * res_scale; | 53 | const u32 height = static_cast<u32>(static_cast<f32>(screen_height) * res_scale); |
| 52 | height = ScreenDocked::Height * res_scale; | ||
| 53 | } else { | ||
| 54 | width = ScreenUndocked::Width * res_scale; | ||
| 55 | height = ScreenUndocked::Height * res_scale; | ||
| 56 | } | ||
| 57 | 54 | ||
| 58 | return DefaultFrameLayout(width, height); | 55 | return DefaultFrameLayout(width, height); |
| 59 | } | 56 | } |
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index e2e3bbbb3..2e36c0163 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -60,7 +60,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height); | |||
| 60 | * Convenience method to get frame layout by resolution scale | 60 | * Convenience method to get frame layout by resolution scale |
| 61 | * @param res_scale resolution scale factor | 61 | * @param res_scale resolution scale factor |
| 62 | */ | 62 | */ |
| 63 | FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale); | 63 | FramebufferLayout FrameLayoutFromResolutionScale(f32 res_scale); |
| 64 | 64 | ||
| 65 | /** | 65 | /** |
| 66 | * Convenience method to determine emulation aspect ratio | 66 | * Convenience method to determine emulation aspect ratio |