- small optimization

This commit is contained in:
Christoph Oelckers 2018-06-19 10:33:59 +02:00
parent fba5b872be
commit 12ad0caec0

View file

@ -154,8 +154,9 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref
} }
else if (allowreflect && sector->GetReflect(plane) > 0) else if (allowreflect && sector->GetReflect(plane) > 0)
{ {
if ((plane == sector_t::ceiling && r_viewpoint.Pos.Z > sector->ceilingplane.fD()) || auto vpz = r_viewpoint.Pos.Z;
(plane == sector_t::floor && r_viewpoint.Pos.Z < -sector->floorplane.fD())) return; if ((plane == sector_t::ceiling && vpz > sector->ceilingplane.fD()) ||
(plane == sector_t::floor && vpz < -sector->floorplane.fD())) return;
ptype = PORTALTYPE_PLANEMIRROR; ptype = PORTALTYPE_PLANEMIRROR;
planemirror = plane == sector_t::ceiling ? &sector->ceilingplane : &sector->floorplane; planemirror = plane == sector_t::ceiling ? &sector->ceilingplane : &sector->floorplane;
} }