android: Fixed landscape layouts not displaying correctly

This commit is contained in:
OpenSauce04 2024-05-28 12:42:25 +01:00
parent 61715bd4a2
commit ab99fff953
3 changed files with 8 additions and 0 deletions

View File

@ -42,7 +42,9 @@ enum class LayoutOption : u32 {
SeparateWindows, SeparateWindows,
#endif #endif
HybridScreen, HybridScreen,
#ifndef ANDROID // TODO: Implement custom layouts on Android
CustomLayout, CustomLayout,
#endif
// Similiar to default, but better for mobile devices in portrait mode. Top screen in clamped to // Similiar to default, but better for mobile devices in portrait mode. Top screen in clamped to
// the top of the frame, and the bottom screen is enlarged to match the top screen. // the top of the frame, and the bottom screen is enlarged to match the top screen.
MobilePortrait, MobilePortrait,

View File

@ -228,10 +228,12 @@ void EmuWindow::UpdateCurrentFramebufferLayout(u32 width, u32 height, bool is_po
Layout::LargeFrameLayout(width, height, Settings::values.swap_screen.GetValue(), Layout::LargeFrameLayout(width, height, Settings::values.swap_screen.GetValue(),
false, 2.25f, Layout::VerticalAlignment::Top); false, 2.25f, Layout::VerticalAlignment::Top);
break; break;
#ifndef ANDROID // TODO: Implement custom layouts on Android
case Settings::LayoutOption::CustomLayout: case Settings::LayoutOption::CustomLayout:
layout = layout =
Layout::CustomFrameLayout(width, height, Settings::values.swap_screen.GetValue()); Layout::CustomFrameLayout(width, height, Settings::values.swap_screen.GetValue());
break; break;
#endif
case Settings::LayoutOption::Default: case Settings::LayoutOption::Default:
default: default:
layout = layout =

View File

@ -696,6 +696,7 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
} }
void RendererOpenGL::ApplySecondLayerOpacity() { void RendererOpenGL::ApplySecondLayerOpacity() {
#ifndef ANDROID // TODO: Implement custom layouts on Android
if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout || if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout ||
Settings::values.custom_layout) && Settings::values.custom_layout) &&
Settings::values.custom_second_layer_opacity.GetValue() < 100) { Settings::values.custom_second_layer_opacity.GetValue() < 100) {
@ -705,9 +706,11 @@ void RendererOpenGL::ApplySecondLayerOpacity() {
state.blend.dst_rgb_func = GL_ONE_MINUS_CONSTANT_ALPHA; state.blend.dst_rgb_func = GL_ONE_MINUS_CONSTANT_ALPHA;
state.blend.color.alpha = Settings::values.custom_second_layer_opacity.GetValue() / 100.0f; state.blend.color.alpha = Settings::values.custom_second_layer_opacity.GetValue() / 100.0f;
} }
#endif
} }
void RendererOpenGL::ResetSecondLayerOpacity() { void RendererOpenGL::ResetSecondLayerOpacity() {
#ifndef ANDROID // TODO: Implement custom layouts on Android
if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout || if ((Settings::values.layout_option.GetValue() == Settings::LayoutOption::CustomLayout ||
Settings::values.custom_layout) && Settings::values.custom_layout) &&
Settings::values.custom_second_layer_opacity.GetValue() < 100) { Settings::values.custom_second_layer_opacity.GetValue() < 100) {
@ -717,6 +720,7 @@ void RendererOpenGL::ResetSecondLayerOpacity() {
state.blend.dst_a_func = GL_ZERO; state.blend.dst_a_func = GL_ZERO;
state.blend.color.alpha = 0.0f; state.blend.color.alpha = 0.0f;
} }
#endif
} }
void RendererOpenGL::DrawTopScreen(const Layout::FramebufferLayout& layout, void RendererOpenGL::DrawTopScreen(const Layout::FramebufferLayout& layout,