From fba5b872be4efb795f3503b90a3838732cabf7e8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 19 Jun 2018 10:31:25 +0200 Subject: [PATCH] - reduced number of references to r_viewpoint in hw_flats --- src/hwrenderer/scene/hw_flats.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hwrenderer/scene/hw_flats.cpp b/src/hwrenderer/scene/hw_flats.cpp index 27e31843f..d4e01fa9a 100644 --- a/src/hwrenderer/scene/hw_flats.cpp +++ b/src/hwrenderer/scene/hw_flats.cpp @@ -263,6 +263,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) dynlightindex = -1; uint8_t &srf = di->sectorrenderflags[sector->sectornum]; + auto &vp = r_viewpoint; // // @@ -271,7 +272,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) // // // - if (frontsector->floorplane.ZatPoint(r_viewpoint.Pos) <= r_viewpoint.Pos.Z) + if (frontsector->floorplane.ZatPoint(vp.Pos) <= vp.Pos.Z) { // process the original floor first. @@ -331,7 +332,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) // // // - if (frontsector->ceilingplane.ZatPoint(r_viewpoint.Pos) >= r_viewpoint.Pos.Z) + if (frontsector->ceilingplane.ZatPoint(vp.Pos) >= vp.Pos.Z) { // process the original ceiling first. @@ -422,7 +423,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) double ff_top = rover->top.plane->ZatPoint(sector->centerspot); if (ff_top < lastceilingheight) { - if (r_viewpoint.Pos.Z <= rover->top.plane->ZatPoint(r_viewpoint.Pos)) + if (vp.Pos.Z <= rover->top.plane->ZatPoint(vp.Pos)) { SetFrom3DFloor(rover, true, !!(rover->flags&FF_FOG)); Colormap.FadeColor = frontsector->Colormap.FadeColor; @@ -436,7 +437,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) double ff_bottom = rover->bottom.plane->ZatPoint(sector->centerspot); if (ff_bottom < lastceilingheight) { - if (r_viewpoint.Pos.Z <= rover->bottom.plane->ZatPoint(r_viewpoint.Pos)) + if (vp.Pos.Z <= rover->bottom.plane->ZatPoint(vp.Pos)) { SetFrom3DFloor(rover, false, !(rover->flags&FF_FOG)); Colormap.FadeColor = frontsector->Colormap.FadeColor; @@ -462,7 +463,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) double ff_bottom = rover->bottom.plane->ZatPoint(sector->centerspot); if (ff_bottom > lastfloorheight || (rover->flags&FF_FIX)) { - if (r_viewpoint.Pos.Z >= rover->bottom.plane->ZatPoint(r_viewpoint.Pos)) + if (vp.Pos.Z >= rover->bottom.plane->ZatPoint(vp.Pos)) { SetFrom3DFloor(rover, false, !(rover->flags&FF_FOG)); Colormap.FadeColor = frontsector->Colormap.FadeColor; @@ -483,7 +484,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector) double ff_top = rover->top.plane->ZatPoint(sector->centerspot); if (ff_top > lastfloorheight) { - if (r_viewpoint.Pos.Z >= rover->top.plane->ZatPoint(r_viewpoint.Pos)) + if (vp.Pos.Z >= rover->top.plane->ZatPoint(vp.Pos)) { SetFrom3DFloor(rover, true, !!(rover->flags&FF_FOG)); Colormap.FadeColor = frontsector->Colormap.FadeColor;