- updated GL renderer.

This commit is contained in:
Christoph Oelckers 2016-04-02 23:17:16 +02:00
commit af78937a15
22 changed files with 238 additions and 306 deletions

View file

@ -506,7 +506,7 @@ void FDrawInfo::HandleMissingTextures()
HandledSubsectors.Clear();
validcount++;
if (MissingUpperTextures[i].planez > viewz)
if (MissingUpperTextures[i].planez > FLOAT2FIXED(ViewPos.Z))
{
// close the hole only if all neighboring sectors are an exact height match
// Otherwise just fill in the missing textures.
@ -578,7 +578,7 @@ void FDrawInfo::HandleMissingTextures()
HandledSubsectors.Clear();
validcount++;
if (MissingLowerTextures[i].planez < viewz)
if (MissingLowerTextures[i].planez < FLOAT2FIXED(ViewPos.Z))
{
// close the hole only if all neighboring sectors are an exact height match
// Otherwise just fill in the missing textures.
@ -668,7 +668,7 @@ void FDrawInfo::DrawUnhandledMissingTextures()
// already done!
if (seg->linedef->validcount==validcount) continue; // already done
seg->linedef->validcount=validcount;
if (seg->frontsector->GetPlaneTexZ(sector_t::ceiling) < viewz) continue; // out of sight
if (seg->frontsector->GetPlaneTexZF(sector_t::ceiling) < ViewPos.Z) continue; // out of sight
//if (seg->frontsector->ceilingpic==skyflatnum) continue;
// FIXME: The check for degenerate subsectors should be more precise
@ -692,7 +692,7 @@ void FDrawInfo::DrawUnhandledMissingTextures()
if (seg->linedef->validcount==validcount) continue; // already done
seg->linedef->validcount=validcount;
if (!(sectorrenderflags[seg->backsector->sectornum] & SSRF_RENDERFLOOR)) continue;
if (seg->frontsector->GetPlaneTexZ(sector_t::floor) > viewz) continue; // out of sight
if (seg->frontsector->GetPlaneTexZF(sector_t::floor) > ViewPos.Z) continue; // out of sight
if (seg->backsector->transdoor) continue;
if (seg->backsector->GetTexture(sector_t::floor)==skyflatnum) continue;
if (seg->backsector->portals[sector_t::floor] != NULL) continue;
@ -793,17 +793,17 @@ bool FDrawInfo::CollectSubsectorsFloor(subsector_t * sub, sector_t * anchor)
// We must collect any subsector that either is connected to this one with a miniseg
// or has the same visplane.
// We must not collect any subsector that has the anchor's visplane!
if (!(sub->flags & SSECF_DEGENERATE))
if (!(sub->flags & SSECF_DEGENERATE))
{
// Is not being rendered so don't bother.
if (!(ss_renderflags[DWORD(sub-subsectors)]&SSRF_PROCESSED)) return true;
if (!(ss_renderflags[DWORD(sub - subsectors)] & SSRF_PROCESSED)) return true;
if (sub->render_sector->GetTexture(sector_t::floor) != anchor->GetTexture(sector_t::floor) ||
sub->render_sector->GetPlaneTexZ(sector_t::floor)!=anchor->GetPlaneTexZ(sector_t::floor) ||
sub->render_sector->GetFloorLight() != anchor->GetFloorLight())
sub->render_sector->GetPlaneTexZF(sector_t::floor) != anchor->GetPlaneTexZF(sector_t::floor) ||
sub->render_sector->GetFloorLight() != anchor->GetFloorLight())
{
if (sub==viewsubsector && viewz<anchor->GetPlaneTexZ(sector_t::floor)) inview=true;
HandledSubsectors.Push (sub);
if (sub == viewsubsector && ViewPos.Z < anchor->GetPlaneTexZF(sector_t::floor)) inview = true;
HandledSubsectors.Push(sub);
}
}
@ -952,7 +952,7 @@ void FDrawInfo::HandleHackedSubsectors()
totalssms.Reset();
totalssms.Clock();
viewsubsector = R_PointInSubsector(viewx, viewy);
viewsubsector = R_PointInSubsector(ViewPos);
// Each subsector may only be processed once in this loop!
validcount++;