mirror of
https://github.com/azahar-emu/azahar.git
synced 2025-04-28 13:47:59 +03:00
framebuffer: Add hybrid layout mode to FrameLayoutFromResolutionScale (#807)
* framebuffer: Add hybrid layout mode to FrameLayoutFromResolutionScale * framebuffer_layout.cpp: Moved seemingly misplaced `default` case to proper location * framebuffer_layout.cpp: Fixed incorrect calculation of framebuffer dimensions for hybrid layout * framebuffer_layout.cpp: Made implicit cast from float to int explicit --------- Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com>
This commit is contained in:
parent
12bc825b8a
commit
32e378a29b
1 changed files with 19 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2016 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
@ -443,6 +443,24 @@ FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale, bool is_secondar
|
|||
Settings::values.upright_screen.GetValue(), 1,
|
||||
Settings::SmallScreenPosition::MiddleRight);
|
||||
|
||||
case Settings::LayoutOption::HybridScreen:
|
||||
height = Core::kScreenTopHeight * res_scale;
|
||||
|
||||
if (Settings::values.swap_screen.GetValue()) {
|
||||
width = Core::kScreenBottomWidth;
|
||||
} else {
|
||||
width = Core::kScreenTopWidth;
|
||||
}
|
||||
// 2.25f comes from HybridScreenLayout's scale_factor value.
|
||||
width = static_cast<int>((width + (Core::kScreenTopWidth / 2.25f)) * res_scale);
|
||||
|
||||
if (Settings::values.upright_screen.GetValue()) {
|
||||
std::swap(width, height);
|
||||
}
|
||||
|
||||
return HybridScreenLayout(width, height, Settings::values.swap_screen.GetValue(),
|
||||
Settings::values.upright_screen.GetValue());
|
||||
|
||||
case Settings::LayoutOption::Default:
|
||||
default:
|
||||
width = Core::kScreenTopWidth * res_scale;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue