From 4a730f6dd53c33302862b50a21b7880b76f98797 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 8 Apr 2018 14:28:48 +0200 Subject: [PATCH] - Fix softpoly ignores status bar displacement --- src/polyrenderer/poly_renderer.cpp | 5 ++++- src/polyrenderer/poly_renderer.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/polyrenderer/poly_renderer.cpp b/src/polyrenderer/poly_renderer.cpp index 18ec739570..0566294128 100644 --- a/src/polyrenderer/poly_renderer.cpp +++ b/src/polyrenderer/poly_renderer.cpp @@ -59,6 +59,7 @@ void PolyRenderer::RenderView(player_t *player, DCanvas *target) using namespace swrenderer; RenderTarget = target; + RenderToCanvas = false; int width = SCREENWIDTH; int height = SCREENHEIGHT; float trueratio; @@ -77,6 +78,7 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int viewwidth = width; RenderTarget = canvas; + RenderToCanvas = true; R_SetWindow(Viewpoint, Viewwindow, 12, width, height, height, true); //viewport->SetViewport(&Thread, width, height, Viewwindow.WidescreenRatio); viewwindowx = x; @@ -88,6 +90,7 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int DrawerThreads::WaitForWorkers(); RenderTarget = screen->GetCanvas(); + RenderToCanvas = false; R_ExecuteSetViewSize(Viewpoint, Viewwindow); float trueratio; ActiveRatio(width, height, &trueratio); @@ -154,7 +157,7 @@ void PolyRenderer::SetSceneViewport() { using namespace swrenderer; - if (RenderTarget == screen->GetCanvas()) // Rendering to screen + if (!RenderToCanvas) // Rendering to screen { int height; if (screenblocks >= 10) diff --git a/src/polyrenderer/poly_renderer.h b/src/polyrenderer/poly_renderer.h index 377b10c77d..45fedce52d 100644 --- a/src/polyrenderer/poly_renderer.h +++ b/src/polyrenderer/poly_renderer.h @@ -57,6 +57,7 @@ public: PolyRenderThreads Threads; DCanvas *RenderTarget = nullptr; + bool RenderToCanvas = false; FViewWindow Viewwindow; FRenderViewpoint Viewpoint; PolyLightVisibility Light;