- renamed the flag bits for sector_t::MoreFlags, so that they are easier to distinguish from sector_t::Flags.

- precalculate if a sector's floor and ceiling plane overlap. This avoids rechecking this for each single call of hw_FakeFlat.
- vertices must be marked dirty every time they change after map setup. That means that ChangePlaneTexZ must do this as well, because it cannot rely on interpolation taking care of it.
- Having a 'dirty' argument for SetPlaneTexZ's ZScript version makes no sense. If the value changes from the script side the vertices must always be marked to be recalculated.
This commit is contained in:
Christoph Oelckers 2018-05-01 11:29:29 +02:00
commit 9bdb0f2e49
19 changed files with 143 additions and 116 deletions

View file

@ -131,7 +131,7 @@ void RenderPolyScene::RenderSectors()
void RenderPolyScene::RenderSubsector(PolyRenderThread *thread, subsector_t *sub, uint32_t subsectorDepth)
{
sector_t *frontsector = sub->sector;
frontsector->MoreFlags |= SECF_DRAWN;
frontsector->MoreFlags |= SECMF_DRAWN;
bool mainBSP = sub->polys == nullptr;
@ -234,7 +234,7 @@ void RenderPolyScene::RenderPolySubsector(PolyRenderThread *thread, subsector_t
if (!PolyRenderer::Instance()->DontMapLines && line->linedef)
{
line->linedef->flags |= ML_MAPPED;
sub->flags |= SSECF_DRAWN;
sub->flags |= SSECMF_DRAWN;
}
RenderPolyWall::RenderLine(thread, line, frontsector, subsectorDepth, CurrentViewpoint->StencilValue, thread->TranslucentObjects, thread->LinePortals, CurrentViewpoint->LinePortalsStart, CurrentViewpoint->PortalEnterLine);
@ -302,7 +302,7 @@ void RenderPolyScene::RenderLine(PolyRenderThread *thread, subsector_t *sub, seg
if (!PolyRenderer::Instance()->DontMapLines && line->linedef)
{
line->linedef->flags |= ML_MAPPED;
sub->flags |= SSECF_DRAWN;
sub->flags |= SSECMF_DRAWN;
}
// Render 3D floor sides
@ -425,7 +425,7 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
sector_t *heightsec = PolyRenderer::Instance()->Viewpoint.sector->heightsec;
bool underwater = (heightsec && heightsec->floorplane.PointOnSide(PolyRenderer::Instance()->Viewpoint.Pos) <= 0);
bool doorunderwater = false;
int diffTex = (s->MoreFlags & SECF_CLIPFAKEPLANES);
int diffTex = (s->MoreFlags & SECMF_CLIPFAKEPLANES);
// Replace sector being drawn with a copy to be hacked
tempsec = *sec;
@ -437,12 +437,12 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
{
tempsec.SetTexture(sector_t::floor, s->GetTexture(sector_t::floor), false);
}
else if (s->MoreFlags & SECF_FAKEFLOORONLY)
else if (s->MoreFlags & SECMF_FAKEFLOORONLY)
{
if (underwater)
{
tempsec.Colormap = s->Colormap;
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
if (!(s->MoreFlags & SECMF_NOFAKELIGHT))
{
tempsec.lightlevel = s->lightlevel;
@ -462,7 +462,7 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
tempsec.floorplane = s->floorplane;
}
if (!(s->MoreFlags & SECF_FAKEFLOORONLY))
if (!(s->MoreFlags & SECMF_FAKEFLOORONLY))
{
if (diffTex)
{
@ -513,7 +513,7 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
tempsec.planes[sector_t::ceiling].xform = s->planes[sector_t::ceiling].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
if (!(s->MoreFlags & SECMF_NOFAKELIGHT))
{
tempsec.lightlevel = s->lightlevel;
@ -522,7 +522,7 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
}
FakeSide = PolyWaterFakeSide::BelowFloor;
}
else if (heightsec && heightsec->ceilingplane.PointOnSide(PolyRenderer::Instance()->Viewpoint.Pos) <= 0 && orgceilz > refceilz && !(s->MoreFlags & SECF_FAKEFLOORONLY))
else if (heightsec && heightsec->ceilingplane.PointOnSide(PolyRenderer::Instance()->Viewpoint.Pos) <= 0 && orgceilz > refceilz && !(s->MoreFlags & SECMF_FAKEFLOORONLY))
{
// Above-ceiling hack
tempsec.ceilingplane = s->ceilingplane;
@ -542,7 +542,7 @@ PolyTransferHeights::PolyTransferHeights(subsector_t *sub) : Subsector(sub)
tempsec.planes[sector_t::floor].xform = s->planes[sector_t::floor].xform;
}
if (!(s->MoreFlags & SECF_NOFAKELIGHT))
if (!(s->MoreFlags & SECMF_NOFAKELIGHT))
{
tempsec.lightlevel = s->lightlevel;