mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 04:51:41 +00:00
- the sections are now being used as the smallest element to draw flat planes.
This also removes one piece of code that was used to cope with the missing clip planes on old ATI cards, so support for those will most likely have to be dropped in the near future.
This commit is contained in:
parent
50bd9c3594
commit
375dd7e28f
5 changed files with 12 additions and 35 deletions
|
@ -256,11 +256,6 @@ public:
|
|||
VPUniforms.mClipHeight = 0;
|
||||
}
|
||||
|
||||
bool ClipLineShouldBeActive()
|
||||
{
|
||||
return (screen->hwcaps & RFL_NO_CLIP_PLANES) && VPUniforms.mClipLine.X > -1000000.f;
|
||||
}
|
||||
|
||||
HWPortal * FindPortal(const void * src);
|
||||
void RenderBSPNode(void *node);
|
||||
void RenderBSP(void *node);
|
||||
|
|
|
@ -182,8 +182,6 @@ void GLFlat::SetupLights(HWDrawInfo *di, FLightNode * node, FDynLightData &light
|
|||
|
||||
void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
||||
{
|
||||
auto vcount = sector->ibocount;
|
||||
|
||||
if (level.HasDynamicLights && screen->BuffersArePersistent())
|
||||
{
|
||||
SetupLights(di, sector->lighthead, lightdata, sector->PortalGroup);
|
||||
|
@ -191,34 +189,13 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
|||
state.SetLightIndex(dynlightindex);
|
||||
|
||||
|
||||
if (vcount > 0 && !di->ClipLineShouldBeActive())
|
||||
{
|
||||
state.DrawIndexed(DT_Triangles, iboindex, vcount);
|
||||
flatvertices += vcount;
|
||||
state.DrawIndexed(DT_Triangles, iboindex + section->vertexindex, section->vertexcount);
|
||||
flatvertices += section->vertexcount;
|
||||
flatprimitives++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
int index = iboindex;
|
||||
bool applied = false;
|
||||
for (int i = 0; i < sector->subsectorcount; i++)
|
||||
{
|
||||
subsector_t * sub = sector->subsectors[i];
|
||||
if (sub->numlines <= 2) continue;
|
||||
|
||||
if (di->ss_renderflags[sub->Index()] & renderflags)
|
||||
{
|
||||
state.DrawIndexed(DT_Triangles, index, (sub->numlines - 2) * 3, !applied);
|
||||
applied = true;
|
||||
flatvertices += sub->numlines;
|
||||
flatprimitives++;
|
||||
}
|
||||
index += (sub->numlines - 2) * 3;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
#if 0
|
||||
//Temporarily disabled until the render hack code can be redone and refactored into its own draw elements
|
||||
if (!(renderflags&SSRF_RENDER3DPLANES))
|
||||
{
|
||||
// Draw the subsectors assigned to it due to missing textures
|
||||
|
@ -282,6 +259,7 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -1297,7 +1297,6 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
|
|||
{
|
||||
subsector_t *sub = HandledSubsectors[j];
|
||||
ss_renderflags[sub->Index()] &= ~SSRF_RENDERCEILING;
|
||||
sub->sector->ibocount = -1; // cannot render this sector in one go.
|
||||
|
||||
if (sub->portalcoverage[sector_t::ceiling].subsectors == NULL)
|
||||
{
|
||||
|
@ -1343,7 +1342,6 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
|
|||
{
|
||||
subsector_t *sub = HandledSubsectors[j];
|
||||
ss_renderflags[sub->Index()] &= ~SSRF_RENDERFLOOR;
|
||||
sub->sector->ibocount = -1; // cannot render this sector in one go.
|
||||
|
||||
if (sub->portalcoverage[sector_t::floor].subsectors == NULL)
|
||||
{
|
||||
|
|
|
@ -96,6 +96,11 @@ FSkyVertexBuffer::FSkyVertexBuffer()
|
|||
mVertexBuffer->SetData(mVertices.Size() * sizeof(FSkyVertex), &mVertices[0], true);
|
||||
}
|
||||
|
||||
FSkyVertexBuffer::~FSkyVertexBuffer()
|
||||
{
|
||||
delete mVertexBuffer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
public:
|
||||
|
||||
FSkyVertexBuffer();
|
||||
~FSkyVertexBuffer();
|
||||
void SetupMatrices(FMaterial *tex, float x_offset, float y_offset, bool mirror, int mode, VSMatrix &modelmatrix, VSMatrix &textureMatrix);
|
||||
std::pair<IVertexBuffer *, IIndexBuffer *> GetBufferObjects() const
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue