From 523c52c7088ddfba0b2461a4c418f91f314dc7b1 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Fri, 1 Jun 2018 13:53:38 +0200 Subject: [PATCH] renderer_opengl: Add Universal 3D Layout Adaption --- .../renderer_opengl/renderer_opengl.cpp | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index c5060571f..625a3755b 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -401,23 +401,32 @@ void RendererOpenGL::DrawScreens() { glUniform1i(uniform_color_texture, 0); if (layout.top_screen_enabled) { - DrawSingleScreenRotated(screen_infos[0], (float)top_screen.left, (float)top_screen.top, - (float)top_screen.GetWidth(), (float)top_screen.GetHeight()); - if (Settings::values.toggle_3d) { - DrawSingleScreenRotated( - screen_infos[1], ((float)top_screen.left * 3) + (float)top_screen.GetWidth(), - (float)top_screen.top, (float)top_screen.GetWidth(), (float)top_screen.GetHeight()); + if (!Settings::values.toggle_3d) { + DrawSingleScreenRotated(screen_infos[0], (float)top_screen.left, (float)top_screen.top, + (float)top_screen.GetWidth(), (float)top_screen.GetHeight()); + } else { + DrawSingleScreenRotated(screen_infos[0], (float)top_screen.left / 2, + (float)top_screen.top, (float)top_screen.GetWidth() / 2, + (float)top_screen.GetHeight()); + DrawSingleScreenRotated(screen_infos[1], + ((float)top_screen.left / 2) + ((float)layout.width / 2), + (float)top_screen.top, (float)top_screen.GetWidth() / 2, + (float)top_screen.GetHeight()); } } if (layout.bottom_screen_enabled) { - DrawSingleScreenRotated(screen_infos[2], (float)bottom_screen.left, - (float)bottom_screen.top, (float)bottom_screen.GetWidth(), - (float)bottom_screen.GetHeight()); - if (Settings::values.toggle_3d) { - DrawSingleScreenRotated( - screen_infos[2], ((float)bottom_screen.left * 3) + (float)bottom_screen.GetWidth(), - (float)bottom_screen.top, (float)bottom_screen.GetWidth(), - (float)bottom_screen.GetHeight()); + if (!Settings::values.toggle_3d) { + DrawSingleScreenRotated(screen_infos[2], (float)bottom_screen.left, + (float)bottom_screen.top, (float)bottom_screen.GetWidth(), + (float)bottom_screen.GetHeight()); + } else { + DrawSingleScreenRotated(screen_infos[2], (float)bottom_screen.left / 2, + (float)bottom_screen.top, (float)bottom_screen.GetWidth() / 2, + (float)bottom_screen.GetHeight()); + DrawSingleScreenRotated(screen_infos[2], + ((float)bottom_screen.left / 2) + ((float)layout.width / 2), + (float)bottom_screen.top, (float)bottom_screen.GetWidth() / 2, + (float)bottom_screen.GetHeight()); } }