diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 948886aff..994d03fa3 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -275,18 +275,19 @@ FramebufferLayout HybridScreenLayout(u32 width, u32 height, bool swapped, bool u std::swap(width, height); } - // Split the window into two parts. Give 2.25x width to the main screen, - // and make a bar on the right side with 1x width top screen and 1.25x width bottom screen - // To do that, find the total emulation box and maximize that based on window size + // use Large Screen layout with these specific ratios to get two of the pieces const float scale_factor = swapped ? 2.25 : 1.8; const Settings::SmallScreenPosition pos = swapped ? Settings::SmallScreenPosition::TopRight : Settings::SmallScreenPosition::BottomRight; - FramebufferLayout res = LargeFrameLayout(width, height, swapped, upright, scale_factor, pos); + // always pass false as the upright value here, as it is being handled here not there + FramebufferLayout res = LargeFrameLayout(width, height, swapped, false, scale_factor, pos); const Common::Rectangle main = swapped ? res.bottom_screen : res.top_screen; const Common::Rectangle small = swapped ? res.top_screen : res.bottom_screen; res.additional_screen = Common::Rectangle{small.left, swapped ? small.bottom : main.top, small.right, swapped ? main.bottom : small.top}; + res.additional_screen_is_bottom = swapped; res.additional_screen_enabled = true; + res.is_rotated = !upright; if (upright) { return reverseLayout(res); } else { diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 1d15e2c89..766929bff 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h @@ -32,13 +32,14 @@ struct FramebufferLayout { bool bottom_screen_enabled; Common::Rectangle top_screen; Common::Rectangle bottom_screen; + // is_rotated is true when the screen is in landscape mode - not sure why! bool is_rotated = true; - bool is_portrait = false; - bool additional_screen_enabled; + bool additional_screen_enabled = false; + // top_opacity is currently not used but could be used in the future float top_opacity = 1.0f; float bottom_opacity = 1.0f; + bool additional_screen_is_bottom = false; Common::Rectangle additional_screen; - CardboardSettings cardboard; /** diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index c8cb6c000..b675b5df4 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -706,7 +706,7 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f if (layout.additional_screen_enabled) { const auto& additional_screen = layout.additional_screen; - if (!Settings::values.swap_screen.GetValue()) { + if (!layout.additional_screen_is_bottom) { DrawTopScreen(layout, additional_screen); } else { DrawBottomScreen(layout, additional_screen); diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 0a25c2036..1281f4a97 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -1037,7 +1037,7 @@ void RendererVulkan::DrawScreens(Frame* frame, const Layout::FramebufferLayout& if (layout.additional_screen_enabled) { const auto& additional_screen = layout.additional_screen; - if (!Settings::values.swap_screen.GetValue()) { + if (!layout.additional_screen_is_bottom) { DrawTopScreen(layout, additional_screen); } else { DrawBottomScreen(layout, additional_screen);