- replaced all direct access to vertex coordinates with wrapper functions.

So that code replacement can be done piece by piece and not all at once.
This commit is contained in:
Christoph Oelckers 2016-03-29 10:07:06 +02:00
commit c7ae4688a3
26 changed files with 328 additions and 299 deletions

View file

@ -404,8 +404,8 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
// sectors at the same time.
if (back && !r_fakingunderwater && curline->frontsector->heightsec == NULL)
{
if (rw_frontcz1 <= s->floorplane.ZatPoint (curline->v1->x, curline->v1->y) &&
rw_frontcz2 <= s->floorplane.ZatPoint (curline->v2->x, curline->v2->y))
if (rw_frontcz1 <= s->floorplane.ZatPoint (curline->v1->fixX(), curline->v1->fixY()) &&
rw_frontcz2 <= s->floorplane.ZatPoint (curline->v2->fixX(), curline->v2->fixY()))
{
// Check that the window is actually visible
for (int z = WallC.sx1; z < WallC.sx2; ++z)
@ -529,10 +529,10 @@ void R_AddLine (seg_t *line)
// [RH] Color if not texturing line
dc_color = (((int)(line - segs) * 8) + 4) & 255;
tx1 = line->v1->x - viewx;
tx2 = line->v2->x - viewx;
ty1 = line->v1->y - viewy;
ty2 = line->v2->y - viewy;
tx1 = line->v1->fixX() - viewx;
tx2 = line->v2->fixX() - viewx;
ty1 = line->v1->fixY() - viewy;
ty2 = line->v2->fixY() - viewy;
// Reject lines not facing viewer
if (DMulScale32 (ty1, tx1-tx2, tx1, ty2-ty1) >= 0)
@ -573,17 +573,17 @@ void R_AddLine (seg_t *line)
{
swapvalues (v1, v2);
}
WallT.InitFromLine(v1->x - viewx, v1->y - viewy, v2->x - viewx, v2->y - viewy);
WallT.InitFromLine(v1->fixX() - viewx, v1->fixY() - viewy, v2->fixX() - viewx, v2->fixY() - viewy);
}
if (!(fake3D & FAKE3D_FAKEBACK))
{
backsector = line->backsector;
}
rw_frontcz1 = frontsector->ceilingplane.ZatPoint (line->v1->x, line->v1->y);
rw_frontfz1 = frontsector->floorplane.ZatPoint (line->v1->x, line->v1->y);
rw_frontcz2 = frontsector->ceilingplane.ZatPoint (line->v2->x, line->v2->y);
rw_frontfz2 = frontsector->floorplane.ZatPoint (line->v2->x, line->v2->y);
rw_frontcz1 = frontsector->ceilingplane.ZatPoint (line->v1->fixX(), line->v1->fixY());
rw_frontfz1 = frontsector->floorplane.ZatPoint (line->v1->fixX(), line->v1->fixY());
rw_frontcz2 = frontsector->ceilingplane.ZatPoint (line->v2->fixX(), line->v2->fixY());
rw_frontfz2 = frontsector->floorplane.ZatPoint (line->v2->fixX(), line->v2->fixY());
rw_mustmarkfloor = rw_mustmarkceiling = false;
rw_havehigh = rw_havelow = false;
@ -602,10 +602,10 @@ void R_AddLine (seg_t *line)
}
doorclosed = 0; // killough 4/16/98
rw_backcz1 = backsector->ceilingplane.ZatPoint (line->v1->x, line->v1->y);
rw_backfz1 = backsector->floorplane.ZatPoint (line->v1->x, line->v1->y);
rw_backcz2 = backsector->ceilingplane.ZatPoint (line->v2->x, line->v2->y);
rw_backfz2 = backsector->floorplane.ZatPoint (line->v2->x, line->v2->y);
rw_backcz1 = backsector->ceilingplane.ZatPoint (line->v1->fixX(), line->v1->fixY());
rw_backfz1 = backsector->floorplane.ZatPoint (line->v1->fixX(), line->v1->fixY());
rw_backcz2 = backsector->ceilingplane.ZatPoint (line->v2->fixX(), line->v2->fixY());
rw_backfz2 = backsector->floorplane.ZatPoint (line->v2->fixX(), line->v2->fixY());
// Cannot make these walls solid, because it can result in
// sprite clipping problems for sprites near the wall