diff options
Diffstat (limited to 'src/core/frontend')
| -rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 7 | ||||
| -rw-r--r-- | src/core/frontend/framebuffer_layout.h | 11 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 4b58b672a..26a5b12aa 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -25,7 +25,12 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 25 | ASSERT(height > 0); | 25 | ASSERT(height > 0); |
| 26 | // The drawing code needs at least somewhat valid values for both screens | 26 | // The drawing code needs at least somewhat valid values for both screens |
| 27 | // so just calculate them both even if the other isn't showing. | 27 | // so just calculate them both even if the other isn't showing. |
| 28 | FramebufferLayout res{width, height, false, {}}; | 28 | FramebufferLayout res{ |
| 29 | .width = width, | ||
| 30 | .height = height, | ||
| 31 | .screen = {}, | ||
| 32 | .is_srgb = false, | ||
| 33 | }; | ||
| 29 | 34 | ||
| 30 | const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width); | 35 | const float window_aspect_ratio = static_cast<float>(height) / static_cast<float>(width); |
| 31 | const float emulation_aspect_ratio = EmulationAspectRatio( | 36 | const float emulation_aspect_ratio = EmulationAspectRatio( |
diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 2e36c0163..8e341e4e2 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h | |||
| @@ -35,17 +35,8 @@ enum class AspectRatio { | |||
| 35 | struct FramebufferLayout { | 35 | struct FramebufferLayout { |
| 36 | u32 width{ScreenUndocked::Width}; | 36 | u32 width{ScreenUndocked::Width}; |
| 37 | u32 height{ScreenUndocked::Height}; | 37 | u32 height{ScreenUndocked::Height}; |
| 38 | bool is_srgb{}; | ||
| 39 | |||
| 40 | Common::Rectangle<u32> screen; | 38 | Common::Rectangle<u32> screen; |
| 41 | 39 | bool is_srgb{}; | |
| 42 | /** | ||
| 43 | * Returns the ration of pixel size of the screen, compared to the native size of the undocked | ||
| 44 | * Switch screen. | ||
| 45 | */ | ||
| 46 | float GetScalingRatio() const { | ||
| 47 | return static_cast<float>(screen.GetWidth()) / ScreenUndocked::Width; | ||
| 48 | } | ||
| 49 | }; | 40 | }; |
| 50 | 41 | ||
| 51 | /** | 42 | /** |