- another small optimization

This commit is contained in:
Christoph Oelckers 2018-06-19 10:40:50 +02:00
parent 12ad0caec0
commit ae7053ee98

View file

@ -444,10 +444,11 @@ bool GLWall::DoHorizon(HWDrawInfo *di, seg_t * seg,sector_t * fs, vertex_t * v1,
ztop[1] = ztop[0] = fs->GetPlaneTexZ(sector_t::ceiling); ztop[1] = ztop[0] = fs->GetPlaneTexZ(sector_t::ceiling);
zbottom[1] = zbottom[0] = fs->GetPlaneTexZ(sector_t::floor); zbottom[1] = zbottom[0] = fs->GetPlaneTexZ(sector_t::floor);
if (r_viewpoint.Pos.Z < fs->GetPlaneTexZ(sector_t::ceiling)) auto vpz = r_viewpoint.Pos.Z;
if (vpz < fs->GetPlaneTexZ(sector_t::ceiling))
{ {
if (r_viewpoint.Pos.Z > fs->GetPlaneTexZ(sector_t::floor)) if (vpz > fs->GetPlaneTexZ(sector_t::floor))
zbottom[1] = zbottom[0] = r_viewpoint.Pos.Z; zbottom[1] = zbottom[0] = vpz;
if (fs->GetTexture(sector_t::ceiling) == skyflatnum) if (fs->GetTexture(sector_t::ceiling) == skyflatnum)
{ {
@ -475,7 +476,7 @@ bool GLWall::DoHorizon(HWDrawInfo *di, seg_t * seg,sector_t * fs, vertex_t * v1,
ztop[1] = ztop[0] = zbottom[0]; ztop[1] = ztop[0] = zbottom[0];
} }
if (r_viewpoint.Pos.Z > fs->GetPlaneTexZ(sector_t::floor)) if (vpz > fs->GetPlaneTexZ(sector_t::floor))
{ {
zbottom[1] = zbottom[0] = fs->GetPlaneTexZ(sector_t::floor); zbottom[1] = zbottom[0] = fs->GetPlaneTexZ(sector_t::floor);
if (fs->GetTexture(sector_t::floor) == skyflatnum) if (fs->GetTexture(sector_t::floor) == skyflatnum)