- fixed: for sectors that have to be drawn per subsector the render state was not applied. resulting in random garbage.

This commit is contained in:
Christoph Oelckers 2018-10-29 17:52:44 +01:00
parent f7446160bb
commit 47ae42d636

View file

@ -198,6 +198,7 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
else
{
int index = iboindex;
bool applied = false;
for (int i = 0; i < sector->subsectorcount; i++)
{
subsector_t * sub = sector->subsectors[i];
@ -205,7 +206,8 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
if (di->ss_renderflags[sub->Index()] & renderflags)
{
state.DrawIndexed(DT_Triangles, index, (sub->numlines - 2) * 3, false);
state.DrawIndexed(DT_Triangles, index, (sub->numlines - 2) * 3, !applied);
applied = true;
flatvertices += sub->numlines;
flatprimitives++;
}
@ -285,6 +287,13 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
//==========================================================================
void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
{
#ifdef _DEBUG
if (sector->sectornum == gl_breaksec)
{
int a = 0;
}
#endif
int rel = getExtraLight();
state.SetNormal(plane.plane.Normal().X, plane.plane.Normal().Z, plane.plane.Normal().Y);