- fixed some wall sprite flickering issues.

This commit is contained in:
Christoph Oelckers 2021-03-27 15:24:09 +01:00
parent e7d73fd8e7
commit 0da33096c6
2 changed files with 3 additions and 3 deletions

View file

@ -437,11 +437,12 @@ void HWDrawInfo::RenderScene(FRenderState &state)
drawlists[GLDL_MASKEDWALLSV].SortWallsVert(this);
drawlists[GLDL_MASKEDWALLSH].SortWallsHorz(this);
state.SetDepthBias(-1, -128);
// these lists are only wall and floor sprites - often attached to walls and floors - so they need to be offset from the plane they may be attached to.
drawlists[GLDL_MASKEDWALLSS].DrawWalls(this, state, false);
// Each list must draw both its passes before the next one to ensure proper depth buffer contents.
state.SetDepthBias(-1, -128);
state.SetDepthMask(false);
drawlists[GLDL_MASKEDWALLSV].DrawWalls(this, state, false);
state.SetDepthMask(true);

View file

@ -47,10 +47,9 @@ void HWDrawInfo::AddWall(HWWall *wall)
}
else
{
bool masked = wall->type != RENDERWALL_M2S ? false : (wall->texture && wall->texture->isMasked());
int list;
if (!masked) list = GLDL_PLAINWALLS;
if (wall->type != RENDERWALL_M2S) list = GLDL_PLAINWALLS;
else if (sprite == nullptr) list = GLDL_MASKEDWALLS;
else if (wall->glseg.x1 == wall->glseg.x2) list = GLDL_MASKEDWALLSV;
else if (wall->glseg.y1 == wall->glseg.y2) list = GLDL_MASKEDWALLSH;