Fix render to texture

This commit is contained in:
Magnus Norddahl 2016-11-23 21:10:19 +01:00
parent 2e7c512891
commit 91d180bec6

View file

@ -66,6 +66,8 @@ void RenderPolyScene::ClearBuffers()
}
void RenderPolyScene::SetSceneViewport()
{
if (RenderTarget == screen) // Rendering to screen
{
int height;
if (screenblocks >= 10)
@ -76,6 +78,11 @@ void RenderPolyScene::SetSceneViewport()
int bottom = SCREENHEIGHT - (height + viewwindowy - ((height - viewheight) / 2));
PolyTriangleDrawer::set_viewport(viewwindowx, SCREENHEIGHT - bottom - height, viewwidth, height, RenderTarget);
}
else // Rendering to camera texture
{
PolyTriangleDrawer::set_viewport(0, 0, RenderTarget->GetWidth(), RenderTarget->GetHeight(), RenderTarget);
}
}
void RenderPolyScene::SetupPerspectiveMatrix()
{