- reduced number of references to r_viewpoint in hw_flats

This commit is contained in:
Christoph Oelckers 2018-06-19 10:31:25 +02:00
parent 3eb4b137f3
commit fba5b872be

View file

@ -263,6 +263,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
dynlightindex = -1; dynlightindex = -1;
uint8_t &srf = di->sectorrenderflags[sector->sectornum]; 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. // 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. // 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); double ff_top = rover->top.plane->ZatPoint(sector->centerspot);
if (ff_top < lastceilingheight) 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)); SetFrom3DFloor(rover, true, !!(rover->flags&FF_FOG));
Colormap.FadeColor = frontsector->Colormap.FadeColor; 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); double ff_bottom = rover->bottom.plane->ZatPoint(sector->centerspot);
if (ff_bottom < lastceilingheight) 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)); SetFrom3DFloor(rover, false, !(rover->flags&FF_FOG));
Colormap.FadeColor = frontsector->Colormap.FadeColor; 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); double ff_bottom = rover->bottom.plane->ZatPoint(sector->centerspot);
if (ff_bottom > lastfloorheight || (rover->flags&FF_FIX)) 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)); SetFrom3DFloor(rover, false, !(rover->flags&FF_FOG));
Colormap.FadeColor = frontsector->Colormap.FadeColor; 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); double ff_top = rover->top.plane->ZatPoint(sector->centerspot);
if (ff_top > lastfloorheight) 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)); SetFrom3DFloor(rover, true, !!(rover->flags&FF_FOG));
Colormap.FadeColor = frontsector->Colormap.FadeColor; Colormap.FadeColor = frontsector->Colormap.FadeColor;