mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- 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:
parent
07649fd31a
commit
84a55667d9
3 changed files with 20 additions and 58 deletions
|
@ -118,46 +118,31 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool istrans)
|
||||||
flat->SetupLights(this, flat->sector->lighthead, lightdata, flat->sector->PortalGroup);
|
flat->SetupLights(this, flat->sector->lighthead, lightdata, flat->sector->PortalGroup);
|
||||||
}
|
}
|
||||||
gl_RenderState.ApplyLightIndex(flat->dynlightindex);
|
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.Clock();
|
drawcalls.Unclock();
|
||||||
glDrawElements(GL_TRIANGLES, vcount, GL_UNSIGNED_INT, GLRenderer->mVBO->GetIndexPointer() + iboindex);
|
flatvertices += vcount;
|
||||||
drawcalls.Unclock();
|
flatprimitives++;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw the subsectors belonging to this sector
|
int index = iboindex;
|
||||||
for (int i=0; i<flat->sector->subsectorcount; i++)
|
for (int i = 0; i < flat->sector->subsectorcount; i++)
|
||||||
{
|
{
|
||||||
subsector_t * sub = flat->sector->subsectors[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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,14 +269,7 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
|
||||||
|
|
||||||
alpha = rover->alpha/255.0f;
|
alpha = rover->alpha/255.0f;
|
||||||
renderstyle = rover->flags&FF_ADDITIVETRANS? STYLE_Add : STYLE_Translucent;
|
renderstyle = rover->flags&FF_ADDITIVETRANS? STYLE_Add : STYLE_Translucent;
|
||||||
if (plane.model->VBOHeightcheck(plane.isceiling))
|
iboindex = plane.vindex;
|
||||||
{
|
|
||||||
iboindex = plane.vindex;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iboindex = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -339,14 +332,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
|
|
||||||
if (alpha != 0.f && frontsector->GetTexture(sector_t::floor) != skyflatnum)
|
if (alpha != 0.f && frontsector->GetTexture(sector_t::floor) != skyflatnum)
|
||||||
{
|
{
|
||||||
if (frontsector->VBOHeightcheck(sector_t::floor))
|
iboindex = frontsector->iboindex[sector_t::floor];
|
||||||
{
|
|
||||||
iboindex = frontsector->iboindex[sector_t::floor];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iboindex = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ceiling = false;
|
ceiling = false;
|
||||||
renderflags = SSRF_RENDERFLOOR;
|
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 (alpha != 0.f && frontsector->GetTexture(sector_t::ceiling) != skyflatnum)
|
||||||
{
|
{
|
||||||
if (frontsector->VBOHeightcheck(sector_t::ceiling))
|
iboindex = frontsector->iboindex[sector_t::ceiling];
|
||||||
{
|
|
||||||
iboindex = frontsector->iboindex[sector_t::ceiling];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iboindex = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ceiling = true;
|
ceiling = true;
|
||||||
renderflags = SSRF_RENDERCEILING;
|
renderflags = SSRF_RENDERCEILING;
|
||||||
|
|
||||||
|
|
|
@ -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.
|
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; }
|
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]; }
|
FSectorPortalGroup *GetPortalGroup(int plane) { return portals[plane]; }
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
Loading…
Reference in a new issue