From ae7053ee985faf6e51c21600e13d5c4d7c94fcce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 19 Jun 2018 10:40:50 +0200 Subject: [PATCH] - another small optimization --- src/hwrenderer/scene/hw_walls.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index f8ed6d30d..3c676f71d 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -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); 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)) - zbottom[1] = zbottom[0] = r_viewpoint.Pos.Z; + if (vpz > fs->GetPlaneTexZ(sector_t::floor)) + zbottom[1] = zbottom[0] = vpz; 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]; } - 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); if (fs->GetTexture(sector_t::floor) == skyflatnum)