From 12ad0caec058f8ebaa46b53d8f8782993cf63079 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 19 Jun 2018 10:33:59 +0200 Subject: [PATCH] - small optimization --- src/hwrenderer/scene/hw_sky.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hwrenderer/scene/hw_sky.cpp b/src/hwrenderer/scene/hw_sky.cpp index 24bd48e936..666aeecdea 100644 --- a/src/hwrenderer/scene/hw_sky.cpp +++ b/src/hwrenderer/scene/hw_sky.cpp @@ -154,8 +154,9 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref } else if (allowreflect && sector->GetReflect(plane) > 0) { - if ((plane == sector_t::ceiling && r_viewpoint.Pos.Z > sector->ceilingplane.fD()) || - (plane == sector_t::floor && r_viewpoint.Pos.Z < -sector->floorplane.fD())) return; + auto vpz = r_viewpoint.Pos.Z; + if ((plane == sector_t::ceiling && vpz > sector->ceilingplane.fD()) || + (plane == sector_t::floor && vpz < -sector->floorplane.fD())) return; ptype = PORTALTYPE_PLANEMIRROR; planemirror = plane == sector_t::ceiling ? §or->ceilingplane : §or->floorplane; }