diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 52e64171e..9597ebef9 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -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); diff --git a/source/core/rendering/scene/hw_drawlistadd.cpp b/source/core/rendering/scene/hw_drawlistadd.cpp index e70e0e04d..7caad9fa2 100644 --- a/source/core/rendering/scene/hw_drawlistadd.cpp +++ b/source/core/rendering/scene/hw_drawlistadd.cpp @@ -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;