- enable the depth buffer

- support vid_scalefactor
This commit is contained in:
Magnus Norddahl 2019-05-22 17:56:29 +02:00
commit d724b623d1
5 changed files with 65 additions and 4 deletions

View file

@ -105,6 +105,7 @@ void PolyFrameBuffer::CheckCanvas()
mCanvas.reset(new DCanvas(0, 0, true));
mCanvas->Resize(GetWidth(), GetHeight(), false);
PolyTriangleDrawer::ResizeBuffers(mCanvas.get());
PolyTriangleDrawer::SetViewport(GetDrawCommands(), 0, 0, mCanvas->GetWidth(), mCanvas->GetHeight(), mCanvas.get());
}
}
@ -141,7 +142,7 @@ void PolyFrameBuffer::Update()
DrawerThreads::WaitForWorkers();
mFrameMemory.Clear();
if (mCanvas && GetClientWidth() == mCanvas->GetWidth() && GetClientHeight() == mCanvas->GetHeight())
if (mCanvas)
{
I_PresentPolyImage(mCanvas->GetWidth(), mCanvas->GetHeight(), mCanvas->GetPixels());
}

View file

@ -66,6 +66,7 @@ bool PolyRenderState::SetDepthClamp(bool on)
void PolyRenderState::SetDepthMask(bool on)
{
args.SetWriteDepth(on);
}
void PolyRenderState::SetDepthFunc(int func)
@ -94,6 +95,12 @@ void PolyRenderState::EnableClipDistance(int num, bool state)
void PolyRenderState::Clear(int targets)
{
//if (targets & CT_Color)
// PolyTriangleDrawer::ClearColor(GetPolyFrameBuffer()->GetDrawCommands());
if (targets & CT_Depth)
PolyTriangleDrawer::ClearDepth(GetPolyFrameBuffer()->GetDrawCommands(), 0.0f);
if (targets & CT_Stencil)
PolyTriangleDrawer::ClearStencil(GetPolyFrameBuffer()->GetDrawCommands(), 0);
}
void PolyRenderState::EnableStencil(bool on)
@ -110,6 +117,7 @@ void PolyRenderState::SetViewport(int x, int y, int w, int h)
void PolyRenderState::EnableDepthTest(bool on)
{
args.SetDepthTest(on);
}
void PolyRenderState::EnableMultisampling(bool on)
@ -129,9 +137,7 @@ void PolyRenderState::Apply()
drawcalls.Clock();
args.SetStencilTest(false);
args.SetDepthTest(false);
args.SetWriteStencil(false);
args.SetWriteDepth(false);
args.SetNoColormap();
args.SetColor(MAKEARGB(