- removed more old code from flat renderer.

VBOHeightCheck was from early development when interpolation was not reflected by the vertex buffer.

# Conflicts:
#	src/gl/scene/gl_flats.cpp
This commit is contained in:
Christoph Oelckers 2018-08-14 00:11:59 +02:00
parent 07649fd31a
commit 84a55667d9
3 changed files with 20 additions and 58 deletions

View file

@ -118,46 +118,31 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool istrans)
flat->SetupLights(this, flat->sector->lighthead, lightdata, flat->sector->PortalGroup);
}
gl_RenderState.ApplyLightIndex(flat->dynlightindex);
if (iboindex >= 0)
if (vcount > 0 && !ClipLineShouldBeActive())
{
if (vcount > 0 && !ClipLineShouldBeActive())
{
drawcalls.Clock();
glDrawElements(GL_TRIANGLES, vcount, GL_UNSIGNED_INT, GLRenderer->mVBO->GetIndexPointer() + iboindex);
drawcalls.Unclock();
flatvertices += vcount;
flatprimitives++;
}
else
{
int index = iboindex;
for (int i = 0; i < flat->sector->subsectorcount; i++)
{
subsector_t * sub = flat->sector->subsectors[i];
if (sub->numlines <= 2) continue;
if (ss_renderflags[sub->Index()] & flat->renderflags || istrans)
{
drawcalls.Clock();
glDrawElements(GL_TRIANGLES, (sub->numlines - 2) * 3, GL_UNSIGNED_INT, GLRenderer->mVBO->GetIndexPointer() + index);
drawcalls.Unclock();
flatvertices += sub->numlines;
flatprimitives++;
}
index += (sub->numlines - 2) * 3;
}
}
drawcalls.Clock();
glDrawElements(GL_TRIANGLES, vcount, GL_UNSIGNED_INT, GLRenderer->mVBO->GetIndexPointer() + iboindex);
drawcalls.Unclock();
flatvertices += vcount;
flatprimitives++;
}
else
{
// Draw the subsectors belonging to this sector
for (int i=0; i<flat->sector->subsectorcount; i++)
int index = iboindex;
for (int i = 0; i < flat->sector->subsectorcount; i++)
{
subsector_t * sub = flat->sector->subsectors[i];
if (ss_renderflags[sub->Index()]& flat->renderflags || istrans)
if (sub->numlines <= 2) continue;
if (ss_renderflags[sub->Index()] & flat->renderflags || istrans)
{
DrawSubsector(flat, sub);
drawcalls.Clock();
glDrawElements(GL_TRIANGLES, (sub->numlines - 2) * 3, GL_UNSIGNED_INT, GLRenderer->mVBO->GetIndexPointer() + index);
drawcalls.Unclock();
flatvertices += sub->numlines;
flatprimitives++;
}
index += (sub->numlines - 2) * 3;
}
}

View file

@ -269,14 +269,7 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
alpha = rover->alpha/255.0f;
renderstyle = rover->flags&FF_ADDITIVETRANS? STYLE_Add : STYLE_Translucent;
if (plane.model->VBOHeightcheck(plane.isceiling))
{
iboindex = plane.vindex;
}
else
{
iboindex = -1;
}
iboindex = plane.vindex;
}
//==========================================================================
@ -339,14 +332,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
if (alpha != 0.f && frontsector->GetTexture(sector_t::floor) != skyflatnum)
{
if (frontsector->VBOHeightcheck(sector_t::floor))
{
iboindex = frontsector->iboindex[sector_t::floor];
}
else
{
iboindex = -1;
}
iboindex = frontsector->iboindex[sector_t::floor];
ceiling = false;
renderflags = SSRF_RENDERFLOOR;
@ -399,15 +385,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
if (alpha != 0.f && frontsector->GetTexture(sector_t::ceiling) != skyflatnum)
{
if (frontsector->VBOHeightcheck(sector_t::ceiling))
{
iboindex = frontsector->iboindex[sector_t::ceiling];
}
else
{
iboindex = -1;
}
iboindex = frontsector->iboindex[sector_t::ceiling];
ceiling = true;
renderflags = SSRF_RENDERCEILING;

View file

@ -1092,7 +1092,6 @@ public:
int ibocount; // number of indices per plane (identical for all planes.) If this is -1 the index buffer is not in use.
float GetReflect(int pos) { return gl_plane_reflection_i? reflect[pos] : 0; }
bool VBOHeightcheck(int pos) const { return vboheight[pos] == GetPlaneTexZ(pos); }
FSectorPortalGroup *GetPortalGroup(int plane) { return portals[plane]; }
enum