- Fix softpoly ignores status bar displacement

This commit is contained in:
Magnus Norddahl 2018-04-08 14:28:48 +02:00
parent 94e8d59dde
commit 4a730f6dd5
2 changed files with 5 additions and 1 deletions

View file

@ -59,6 +59,7 @@ void PolyRenderer::RenderView(player_t *player, DCanvas *target)
using namespace swrenderer; using namespace swrenderer;
RenderTarget = target; RenderTarget = target;
RenderToCanvas = false;
int width = SCREENWIDTH; int width = SCREENWIDTH;
int height = SCREENHEIGHT; int height = SCREENHEIGHT;
float trueratio; float trueratio;
@ -77,6 +78,7 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
viewwidth = width; viewwidth = width;
RenderTarget = canvas; RenderTarget = canvas;
RenderToCanvas = true;
R_SetWindow(Viewpoint, Viewwindow, 12, width, height, height, true); R_SetWindow(Viewpoint, Viewwindow, 12, width, height, height, true);
//viewport->SetViewport(&Thread, width, height, Viewwindow.WidescreenRatio); //viewport->SetViewport(&Thread, width, height, Viewwindow.WidescreenRatio);
viewwindowx = x; viewwindowx = x;
@ -88,6 +90,7 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
DrawerThreads::WaitForWorkers(); DrawerThreads::WaitForWorkers();
RenderTarget = screen->GetCanvas(); RenderTarget = screen->GetCanvas();
RenderToCanvas = false;
R_ExecuteSetViewSize(Viewpoint, Viewwindow); R_ExecuteSetViewSize(Viewpoint, Viewwindow);
float trueratio; float trueratio;
ActiveRatio(width, height, &trueratio); ActiveRatio(width, height, &trueratio);
@ -154,7 +157,7 @@ void PolyRenderer::SetSceneViewport()
{ {
using namespace swrenderer; using namespace swrenderer;
if (RenderTarget == screen->GetCanvas()) // Rendering to screen if (!RenderToCanvas) // Rendering to screen
{ {
int height; int height;
if (screenblocks >= 10) if (screenblocks >= 10)

View file

@ -57,6 +57,7 @@ public:
PolyRenderThreads Threads; PolyRenderThreads Threads;
DCanvas *RenderTarget = nullptr; DCanvas *RenderTarget = nullptr;
bool RenderToCanvas = false;
FViewWindow Viewwindow; FViewWindow Viewwindow;
FRenderViewpoint Viewpoint; FRenderViewpoint Viewpoint;
PolyLightVisibility Light; PolyLightVisibility Light;