- move r_utility globals into r_viewpoint and r_viewwindow

- change r_utility functions to only work on FRenderViewpoint and FViewWindow
This commit is contained in:
Magnus Norddahl 2017-03-11 23:28:07 +01:00
commit 0c9014b984
75 changed files with 817 additions and 839 deletions

View file

@ -80,7 +80,7 @@ namespace swrenderer
{
if (!plane.isSlope())
{
return Project(plane.Zat0() - ViewPos.Z, wallc);
return Project(plane.Zat0() - r_viewpoint.Pos.Z, wallc);
}
else
{
@ -96,7 +96,7 @@ namespace swrenderer
x -= frac * (x - curline->v1->fX());
y -= frac * (y - curline->v1->fY());
}
z1 = plane.ZatPoint(x, y) - ViewPos.Z;
z1 = plane.ZatPoint(x, y) - r_viewpoint.Pos.Z;
if (wallc->sx2 > wallc->sx1 + 1)
{
@ -108,7 +108,7 @@ namespace swrenderer
x += frac * (curline->v2->fX() - x);
y += frac * (curline->v2->fY() - y);
}
z2 = plane.ZatPoint(x, y) - ViewPos.Z;
z2 = plane.ZatPoint(x, y) - r_viewpoint.Pos.Z;
}
else
{
@ -125,7 +125,7 @@ namespace swrenderer
x += frac * (curline->v2->fX() - x);
y += frac * (curline->v2->fY() - y);
}
z1 = plane.ZatPoint(x, y) - ViewPos.Z;
z1 = plane.ZatPoint(x, y) - r_viewpoint.Pos.Z;
if (wallc->sx2 > wallc->sx1 + 1)
{
@ -137,7 +137,7 @@ namespace swrenderer
x -= frac * (x - curline->v1->fX());
y -= frac * (y - curline->v1->fY());
}
z2 = plane.ZatPoint(x, y) - ViewPos.Z;
z2 = plane.ZatPoint(x, y) - r_viewpoint.Pos.Z;
}
else
{