-use an access function for reading wall positions so that we have a non-modifiable value wherever this is possible.

This commit is contained in:
Christoph Oelckers 2022-01-27 17:41:10 +01:00
parent 89ef81da55
commit f44736a5b6
53 changed files with 435 additions and 433 deletions

View file

@ -118,8 +118,8 @@ int clipinsidebox(vec2_t *vect, int wallnum, int walldist)
auto const wal1 = &wall[wallnum]; auto const wal1 = &wall[wallnum];
auto const wal2 = wal1->point2Wall(); auto const wal2 = wal1->point2Wall();
vec2_t const v1 = { wal1->wall_int_pos.X + walldist - vect->X, wal1->wall_int_pos.Y + walldist - vect->Y }; vec2_t const v1 = { wal1->wall_int_pos().X + walldist - vect->X, wal1->wall_int_pos().Y + walldist - vect->Y };
vec2_t v2 = { wal2->wall_int_pos.X + walldist - vect->X, wal2->wall_int_pos.Y + walldist - vect->Y }; vec2_t v2 = { wal2->wall_int_pos().X + walldist - vect->X, wal2->wall_int_pos().Y + walldist - vect->Y };
if (((v1.X < 0) && (v2.X < 0)) || ((v1.Y < 0) && (v2.Y < 0)) || ((v1.X >= r) && (v2.X >= r)) || ((v1.Y >= r) && (v2.Y >= r))) if (((v1.X < 0) && (v2.X < 0)) || ((v1.Y < 0) && (v2.Y < 0)) || ((v1.X >= r) && (v2.X >= r)) || ((v1.Y >= r) && (v2.Y >= r)))
return 0; return 0;
@ -512,12 +512,12 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
{ {
auto const wal2 = wal->point2Wall(); auto const wal2 = wal->point2Wall();
if ((wal->wall_int_pos.X < clipMin.X && wal2->wall_int_pos.X < clipMin.X) || (wal->wall_int_pos.X > clipMax.X && wal2->wall_int_pos.X > clipMax.X) || if ((wal->wall_int_pos().X < clipMin.X && wal2->wall_int_pos().X < clipMin.X) || (wal->wall_int_pos().X > clipMax.X && wal2->wall_int_pos().X > clipMax.X) ||
(wal->wall_int_pos.Y < clipMin.Y && wal2->wall_int_pos.Y < clipMin.Y) || (wal->wall_int_pos.Y > clipMax.Y && wal2->wall_int_pos.Y > clipMax.Y)) (wal->wall_int_pos().Y < clipMin.Y && wal2->wall_int_pos().Y < clipMin.Y) || (wal->wall_int_pos().Y > clipMax.Y && wal2->wall_int_pos().Y > clipMax.Y))
continue; continue;
vec2_t p1 = wal->wall_int_pos; vec2_t p1 = wal->wall_int_pos();
vec2_t p2 = wal2->wall_int_pos; vec2_t p2 = wal2->wall_int_pos();
vec2_t d = { p2.X-p1.X, p2.Y-p1.Y }; vec2_t d = { p2.X-p1.X, p2.Y-p1.Y };
if (d.X * (pos->Y-p1.Y) < (pos->X-p1.X) * d.Y) if (d.X * (pos->Y-p1.Y) < (pos->X-p1.X) * d.Y)
@ -974,9 +974,9 @@ int pushmove_(vec3_t *const vect, int *const sectnum,
else else
{ {
//Find closest point on wall (dax, day) to (vect->x, vect->y) //Find closest point on wall (dax, day) to (vect->x, vect->y)
int32_t dax = wal->point2Wall()->wall_int_pos.X-wal->wall_int_pos.X; int32_t dax = wal->point2Wall()->wall_int_pos().X-wal->wall_int_pos().X;
int32_t day = wal->point2Wall()->wall_int_pos.Y-wal->wall_int_pos.Y; int32_t day = wal->point2Wall()->wall_int_pos().Y-wal->wall_int_pos().Y;
int32_t daz = dax*((vect->X)-wal->wall_int_pos.X) + day*((vect->Y)-wal->wall_int_pos.Y); int32_t daz = dax*((vect->X)-wal->wall_int_pos().X) + day*((vect->Y)-wal->wall_int_pos().Y);
int32_t t; int32_t t;
if (daz <= 0) if (daz <= 0)
t = 0; t = 0;
@ -985,8 +985,8 @@ int pushmove_(vec3_t *const vect, int *const sectnum,
daz2 = dax*dax+day*day; daz2 = dax*dax+day*day;
if (daz >= daz2) t = (1<<30); else t = DivScale(daz, daz2, 30); if (daz >= daz2) t = (1<<30); else t = DivScale(daz, daz2, 30);
} }
dax = wal->wall_int_pos.X + MulScale(dax, t, 30); dax = wal->wall_int_pos().X + MulScale(dax, t, 30);
day = wal->wall_int_pos.Y + MulScale(day, t, 30); day = wal->wall_int_pos().Y + MulScale(day, t, 30);
closest = { dax, day }; closest = { dax, day };
} }
@ -996,7 +996,7 @@ int pushmove_(vec3_t *const vect, int *const sectnum,
if (j != 0) if (j != 0)
{ {
j = getangle(wal->point2Wall()->wall_int_pos.X-wal->wall_int_pos.X, wal->point2Wall()->wall_int_pos.Y-wal->wall_int_pos.Y); j = getangle(wal->point2Wall()->wall_int_pos().X-wal->wall_int_pos().X, wal->point2Wall()->wall_int_pos().Y-wal->wall_int_pos().Y);
int32_t dx = -bsin(j, -11); int32_t dx = -bsin(j, -11);
int32_t dy = bcos(j, -11); int32_t dy = bcos(j, -11);
int bad2 = 16; int bad2 = 16;
@ -1073,8 +1073,8 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
if (wal.twoSided()) if (wal.twoSided())
{ {
auto nextsect = wal.nextSector(); auto nextsect = wal.nextSector();
vec2_t const v1 = wal.wall_int_pos; vec2_t const v1 = wal.wall_int_pos();
vec2_t const v2 = wal.point2Wall()->wall_int_pos; vec2_t const v2 = wal.point2Wall()->wall_int_pos();
if ((v1.X < xmin && (v2.X < xmin)) || (v1.X > xmax && v2.X > xmax) || if ((v1.X < xmin && (v2.X < xmin)) || (v1.X > xmax && v2.X > xmax) ||
(v1.Y < ymin && (v2.Y < ymin)) || (v1.Y > ymax && v2.Y > ymax)) (v1.Y < ymin && (v2.Y < ymin)) || (v1.Y > ymax && v2.Y > ymax))
@ -1289,7 +1289,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase
{ {
auto const wal = sec->firstWall(); auto const wal = sec->firstWall();
auto const wal2 = wal->point2Wall(); auto const wal2 = wal->point2Wall();
int32_t j, dax=wal2->wall_int_pos.X-wal->wall_int_pos.X, day=wal2->wall_int_pos.Y-wal->wall_int_pos.Y; int32_t j, dax=wal2->wall_int_pos().X-wal->wall_int_pos().X, day=wal2->wall_int_pos().Y-wal->wall_int_pos().Y;
i = ksqrt(compat_maybe_truncate_to_int32(uhypsq(dax,day))); if (i == 0) return 1; //continue; i = ksqrt(compat_maybe_truncate_to_int32(uhypsq(dax,day))); if (i == 0) return 1; //continue;
i = DivScale(heinum,i, 15); i = DivScale(heinum,i, 15);
@ -1298,7 +1298,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase
j = (vz<<8)-DMulScale(dax,vy,-day,vx, 15); j = (vz<<8)-DMulScale(dax,vy,-day,vx, 15);
if (j != 0) if (j != 0)
{ {
i = ((z - sv->Z)<<8)+DMulScale(dax,sv->Y-wal->wall_int_pos.Y,-day,sv->X-wal->wall_int_pos.X, 15); i = ((z - sv->Z)<<8)+DMulScale(dax,sv->Y-wal->wall_int_pos().Y,-day,sv->X-wal->wall_int_pos().X, 15);
if (((i^j) >= 0) && ((abs(i)>>1) < abs(j))) if (((i^j) >= 0) && ((abs(i)>>1) < abs(j)))
{ {
i = DivScale(i,j, 30); i = DivScale(i,j, 30);
@ -1370,7 +1370,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
auto const nextsect = wal->nextSector(); auto const nextsect = wal->nextSector();
x1 = wal->wall_int_pos.X; y1 = wal->wall_int_pos.Y; x2 = wal2->wall_int_pos.X; y2 = wal2->wall_int_pos.Y; x1 = wal->wall_int_pos().X; y1 = wal->wall_int_pos().Y; x2 = wal2->wall_int_pos().X; y2 = wal2->wall_int_pos().Y;
if (compat_maybe_truncate_to_int32((coord_t)(x1-sv->X)*(y2-sv->Y)) if (compat_maybe_truncate_to_int32((coord_t)(x1-sv->X)*(y2-sv->Y))
< compat_maybe_truncate_to_int32((coord_t)(x2-sv->X)*(y1-sv->Y))) continue; < compat_maybe_truncate_to_int32((coord_t)(x2-sv->X)*(y1-sv->Y))) continue;

View file

@ -53,8 +53,8 @@ static int16_t radarang[1280];
// adapted from build.c // adapted from build.c
static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, vec2_t *const closest) static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, vec2_t *const closest)
{ {
vec2_t const w = wall[dawall].wall_int_pos; vec2_t const w = wall[dawall].wall_int_pos();
vec2_t const w2 = wall[dawall].point2Wall()->wall_int_pos; vec2_t const w2 = wall[dawall].point2Wall()->wall_int_pos();
vec2_t const d = { w2.X - w.X, w2.Y - w.Y }; vec2_t const d = { w2.X - w.X, w2.Y - w.Y };
int64_t i = d.X * ((int64_t)p.X - w.X) + d.Y * ((int64_t)p.Y - w.Y); int64_t i = d.X * ((int64_t)p.X - w.X) + d.Y * ((int64_t)p.Y - w.Y);
@ -298,8 +298,8 @@ int32_t inside(int32_t x, int32_t y, const sectortype* sect)
vec2_t xy = { x, y }; vec2_t xy = { x, y };
for(auto& wal : wallsofsector(sect)) for(auto& wal : wallsofsector(sect))
{ {
vec2_t v1 = wal.wall_int_pos - xy; vec2_t v1 = wal.wall_int_pos() - xy;
vec2_t v2 = wal.point2Wall()->wall_int_pos - xy; vec2_t v2 = wal.point2Wall()->wall_int_pos() - xy;
// If their signs differ[*], ... // If their signs differ[*], ...
// //
@ -415,8 +415,8 @@ int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, se
for (cnt=sec->wallnum,wal=sec->firstWall(); cnt>0; cnt--,wal++) for (cnt=sec->wallnum,wal=sec->firstWall(); cnt>0; cnt--,wal++)
{ {
auto const wal2 = wal->point2Wall(); auto const wal2 = wal->point2Wall();
const int32_t x31 = wal->wall_int_pos.X-x1, x34 = wal->wall_int_pos.X-wal2->wall_int_pos.X; const int32_t x31 = wal->wall_int_pos().X-x1, x34 = wal->wall_int_pos().X-wal2->wall_int_pos().X;
const int32_t y31 = wal->wall_int_pos.Y-y1, y34 = wal->wall_int_pos.Y-wal2->wall_int_pos.Y; const int32_t y31 = wal->wall_int_pos().Y-y1, y34 = wal->wall_int_pos().Y-wal2->wall_int_pos().Y;
int32_t x, y, z, t, bot; int32_t x, y, z, t, bot;
int32_t cfz[2]; int32_t cfz[2];
@ -484,7 +484,7 @@ void neartag(const vec3_t& sv, sectortype* sect, int ange, HitInfoBase& result,
auto const wal2 = wal->point2Wall(); auto const wal2 = wal->point2Wall();
const auto nextsect = wal->nextSector(); const auto nextsect = wal->nextSector();
const int32_t x1 = wal->wall_int_pos.X, y1 = wal->wall_int_pos.Y, x2 = wal2->wall_int_pos.X, y2 = wal2->wall_int_pos.Y; const int32_t x1 = wal->wall_int_pos().X, y1 = wal->wall_int_pos().Y, x2 = wal2->wall_int_pos().X, y2 = wal2->wall_int_pos().Y;
int32_t intx, inty, intz, good = 0; int32_t intx, inty, intz, good = 0;
if (wal->twoSided()) if (wal->twoSided())

View file

@ -1043,8 +1043,8 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0
FVector2 const fxy = { xy.X*r, xy.Y*r }; FVector2 const fxy = { xy.X*r, xy.Y*r };
ft[0] = ((float)(globalposx - sec->firstWall()->wall_int_pos.X)) * fxy.X + ((float)(globalposy - sec->firstWall()->wall_int_pos.Y)) * fxy.Y; ft[0] = ((float)(globalposx - sec->firstWall()->wall_int_pos().X)) * fxy.X + ((float)(globalposy - sec->firstWall()->wall_int_pos().Y)) * fxy.Y;
ft[1] = ((float)(globalposy - sec->firstWall()->wall_int_pos.Y)) * fxy.X - ((float)(globalposx - sec->firstWall()->wall_int_pos.X)) * fxy.Y; ft[1] = ((float)(globalposy - sec->firstWall()->wall_int_pos().Y)) * fxy.X - ((float)(globalposx - sec->firstWall()->wall_int_pos().X)) * fxy.Y;
ft[2] = fcosglobalang * fxy.X + fsinglobalang * fxy.Y; ft[2] = fcosglobalang * fxy.X + fsinglobalang * fxy.Y;
ft[3] = fsinglobalang * fxy.X - fcosglobalang * fxy.Y; ft[3] = fsinglobalang * fxy.X - fcosglobalang * fxy.Y;
@ -1243,8 +1243,8 @@ static inline int32_t testvisiblemost(float const x0, float const x1)
static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32_t dawall, vec2_t * const n) static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32_t dawall, vec2_t * const n)
{ {
vec2_t const w = { wall[dawall].wall_int_pos.X, wall[dawall].wall_int_pos.Y }; vec2_t const w = { wall[dawall].wall_int_pos().X, wall[dawall].wall_int_pos().Y };
vec2_t const d = { POINT2(dawall).wall_int_pos.X - w.X, POINT2(dawall).wall_int_pos.Y - w.Y }; vec2_t const d = { POINT2(dawall).wall_int_pos().X - w.X, POINT2(dawall).wall_int_pos().Y - w.Y };
int64_t i = d.X * ((int64_t)pos->X - w.X) + d.Y * ((int64_t)pos->Y - w.Y); int64_t i = d.X * ((int64_t)pos->X - w.X) + d.Y * ((int64_t)pos->Y - w.Y);
if (d.X == 0 && d.Y == 0) if (d.X == 0 && d.Y == 0)
@ -1511,13 +1511,13 @@ static void polymost_drawalls(int32_t const bunch)
auto const nextsec = nextsectnum>=0 ? &sector[nextsectnum] : NULL; auto const nextsec = nextsectnum>=0 ? &sector[nextsectnum] : NULL;
//Offset&Rotate 3D coordinates to screen 3D space //Offset&Rotate 3D coordinates to screen 3D space
FVector2 walpos = { (float)(wal->wall_int_pos.X-globalposx), (float)(wal->wall_int_pos.Y-globalposy) }; FVector2 walpos = { (float)(wal->wall_int_pos().X-globalposx), (float)(wal->wall_int_pos().Y-globalposy) };
FVector2 p0 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 }; FVector2 p0 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 };
FVector2 const op0 = p0; FVector2 const op0 = p0;
walpos = { (float)(wal2->wall_int_pos.X - globalposx), walpos = { (float)(wal2->wall_int_pos().X - globalposx),
(float)(wal2->wall_int_pos.Y - globalposy) }; (float)(wal2->wall_int_pos().Y - globalposy) };
FVector2 p1 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 }; FVector2 p1 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 };
@ -1531,26 +1531,26 @@ static void polymost_drawalls(int32_t const bunch)
if (p1.Y < SCISDIST) continue; if (p1.Y < SCISDIST) continue;
t0 = (SCISDIST-p0.Y)/(p1.Y-p0.Y); t0 = (SCISDIST-p0.Y)/(p1.Y-p0.Y);
p0 = { (p1.X-p0.X)*t0+p0.X, SCISDIST }; p0 = { (p1.X-p0.X)*t0+p0.X, SCISDIST };
n0 = { (wal2->wall_int_pos.X-wal->wall_int_pos.X)*t0+wal->wall_int_pos.X, n0 = { (wal2->wall_int_pos().X-wal->wall_int_pos().X)*t0+wal->wall_int_pos().X,
(wal2->wall_int_pos.Y-wal->wall_int_pos.Y)*t0+wal->wall_int_pos.Y }; (wal2->wall_int_pos().Y-wal->wall_int_pos().Y)*t0+wal->wall_int_pos().Y };
} }
else else
{ {
t0 = 0.f; t0 = 0.f;
n0 = { (float)wal->wall_int_pos.X, (float)wal->wall_int_pos.Y }; n0 = { (float)wal->wall_int_pos().X, (float)wal->wall_int_pos().Y };
} }
if (p1.Y < SCISDIST) if (p1.Y < SCISDIST)
{ {
t1 = (SCISDIST-op0.Y)/(p1.Y-op0.Y); t1 = (SCISDIST-op0.Y)/(p1.Y-op0.Y);
p1 = { (p1.X-op0.X)*t1+op0.X, SCISDIST }; p1 = { (p1.X-op0.X)*t1+op0.X, SCISDIST };
n1 = { (wal2->wall_int_pos.X-wal->wall_int_pos.X)*t1+wal->wall_int_pos.X, n1 = { (wal2->wall_int_pos().X-wal->wall_int_pos().X)*t1+wal->wall_int_pos().X,
(wal2->wall_int_pos.Y-wal->wall_int_pos.Y)*t1+wal->wall_int_pos.Y }; (wal2->wall_int_pos().Y-wal->wall_int_pos().Y)*t1+wal->wall_int_pos().Y };
} }
else else
{ {
t1 = 1.f; t1 = 1.f;
n1 = { (float)wal2->wall_int_pos.X, (float)wal2->wall_int_pos.Y }; n1 = { (float)wal2->wall_int_pos().X, (float)wal2->wall_int_pos().Y };
} }
float ryp0 = 1.f/p0.Y, ryp1 = 1.f/p1.Y; float ryp0 = 1.f/p0.Y, ryp1 = 1.f/p1.Y;
@ -1828,10 +1828,10 @@ static void polymost_drawalls(int32_t const bunch)
// //
int32_t wallfront(int32_t l1, int32_t l2) int32_t wallfront(int32_t l1, int32_t l2)
{ {
vec2_t const l1vect = wall[thewall[l1]].wall_int_pos; vec2_t const l1vect = wall[thewall[l1]].wall_int_pos();
vec2_t const l1p2vect = wall[thewall[l1]].point2Wall()->wall_int_pos; vec2_t const l1p2vect = wall[thewall[l1]].point2Wall()->wall_int_pos();
vec2_t const l2vect = wall[thewall[l2]].wall_int_pos; vec2_t const l2vect = wall[thewall[l2]].wall_int_pos();
vec2_t const l2p2vect = wall[thewall[l2]].point2Wall()->wall_int_pos; vec2_t const l2p2vect = wall[thewall[l2]].point2Wall()->wall_int_pos();
vec2_t d = { l1p2vect.X - l1vect.X, l1p2vect.Y - l1vect.Y }; vec2_t d = { l1p2vect.X - l1vect.X, l1p2vect.Y - l1vect.Y };
int32_t t1 = DMulScale(l2vect.X - l1vect.X, d.Y, -d.X, l2vect.Y - l1vect.Y, 2); //p1(l2) vs. l1 int32_t t1 = DMulScale(l2vect.X - l1vect.X, d.Y, -d.X, l2vect.Y - l1vect.Y, 2); //p1(l2) vs. l1
int32_t t2 = DMulScale(l2p2vect.X - l1vect.X, d.Y, -d.X, l2p2vect.Y - l1vect.Y, 2); //p2(l2) vs. l1 int32_t t2 = DMulScale(l2p2vect.X - l1vect.X, d.Y, -d.X, l2p2vect.Y - l1vect.Y, 2); //p2(l2) vs. l1
@ -1935,8 +1935,8 @@ void polymost_scansector(int32_t sectnum)
{ {
auto const wal2 = wal->point2Wall(); auto const wal2 = wal->point2Wall();
DVector2 const fp1 = { double(wal->wall_int_pos.X - globalposx), double(wal->wall_int_pos.Y - globalposy) }; DVector2 const fp1 = { double(wal->wall_int_pos().X - globalposx), double(wal->wall_int_pos().Y - globalposy) };
DVector2 const fp2 = { double(wal2->wall_int_pos.X - globalposx), double(wal2->wall_int_pos.Y - globalposy) }; DVector2 const fp2 = { double(wal2->wall_int_pos().X - globalposx), double(wal2->wall_int_pos().Y - globalposy) };
int const nextsectnum = wal->nextsector; //Scan close sectors int const nextsectnum = wal->nextsector; //Scan close sectors
@ -2337,10 +2337,10 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex)
globalshade = (int32_t)wal->shade; globalshade = (int32_t)wal->shade;
globalfloorpal = globalpal = (int32_t)((uint8_t)wal->pal); globalfloorpal = globalpal = (int32_t)((uint8_t)wal->pal);
FVector2 s0 = { (float)(wal->wall_int_pos.X-globalposx), (float)(wal->wall_int_pos.Y-globalposy) }; FVector2 s0 = { (float)(wal->wall_int_pos().X-globalposx), (float)(wal->wall_int_pos().Y-globalposy) };
FVector2 p0 = { s0.Y*gcosang - s0.X*gsinang, s0.X*gcosang2 + s0.Y*gsinang2 }; FVector2 p0 = { s0.Y*gcosang - s0.X*gsinang, s0.X*gcosang2 + s0.Y*gsinang2 };
FVector2 s1 = { (float)(wal2->wall_int_pos.X-globalposx), (float)(wal2->wall_int_pos.Y-globalposy) }; FVector2 s1 = { (float)(wal2->wall_int_pos().X-globalposx), (float)(wal2->wall_int_pos().Y-globalposy) };
FVector2 p1 = { s1.Y*gcosang - s1.X*gsinang, s1.X*gcosang2 + s1.Y*gsinang2 }; FVector2 p1 = { s1.Y*gcosang - s1.X*gsinang, s1.X*gcosang2 + s1.Y*gsinang2 };
if ((p0.Y < SCISDIST) && (p1.Y < SCISDIST)) return; if ((p0.Y < SCISDIST) && (p1.Y < SCISDIST)) return;
@ -2364,13 +2364,13 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex)
p1 = { (p1.X - op0.X) * t1 + op0.X, SCISDIST }; p1 = { (p1.X - op0.X) * t1 + op0.X, SCISDIST };
} }
int32_t m0 = (int32_t)((wal2->wall_int_pos.X - wal->wall_int_pos.X) * t0 + wal->wall_int_pos.X); int32_t m0 = (int32_t)((wal2->wall_int_pos().X - wal->wall_int_pos().X) * t0 + wal->wall_int_pos().X);
int32_t m1 = (int32_t)((wal2->wall_int_pos.Y - wal->wall_int_pos.Y) * t0 + wal->wall_int_pos.Y); int32_t m1 = (int32_t)((wal2->wall_int_pos().Y - wal->wall_int_pos().Y) * t0 + wal->wall_int_pos().Y);
int32_t cz[4], fz[4]; int32_t cz[4], fz[4];
getzsofslopeptr(sec, m0, m1, &cz[0], &fz[0]); getzsofslopeptr(sec, m0, m1, &cz[0], &fz[0]);
getzsofslopeptr(wal->nextSector(), m0, m1, &cz[1], &fz[1]); getzsofslopeptr(wal->nextSector(), m0, m1, &cz[1], &fz[1]);
m0 = (int32_t)((wal2->wall_int_pos.X - wal->wall_int_pos.X) * t1 + wal->wall_int_pos.X); m0 = (int32_t)((wal2->wall_int_pos().X - wal->wall_int_pos().X) * t1 + wal->wall_int_pos().X);
m1 = (int32_t)((wal2->wall_int_pos.Y - wal->wall_int_pos.Y) * t1 + wal->wall_int_pos.Y); m1 = (int32_t)((wal2->wall_int_pos().Y - wal->wall_int_pos().Y) * t1 + wal->wall_int_pos().Y);
getzsofslopeptr(sec, m0, m1, &cz[2], &fz[2]); getzsofslopeptr(sec, m0, m1, &cz[2], &fz[2]);
getzsofslopeptr(wal->nextSector(), m0, m1, &cz[3], &fz[3]); getzsofslopeptr(wal->nextSector(), m0, m1, &cz[3], &fz[3]);
@ -2911,12 +2911,12 @@ void polymost_drawsprite(int32_t snum)
{ {
vec2_t v = { /*Blrintf(vf.x)*/(int)vf.X, /*Blrintf(vf.y)*/(int)vf.Y }; vec2_t v = { /*Blrintf(vf.x)*/(int)vf.X, /*Blrintf(vf.y)*/(int)vf.Y };
if (walldist <= 2 || ((pos.X - v.X) + (pos.X + v.X)) == (wall[w].wall_int_pos.X + POINT2(w).wall_int_pos.X) || if (walldist <= 2 || ((pos.X - v.X) + (pos.X + v.X)) == (wall[w].wall_int_pos().X + POINT2(w).wall_int_pos().X) ||
((pos.Y - v.Y) + (pos.Y + v.Y)) == (wall[w].wall_int_pos.Y + POINT2(w).wall_int_pos.Y) || ((pos.Y - v.Y) + (pos.Y + v.Y)) == (wall[w].wall_int_pos().Y + POINT2(w).wall_int_pos().Y) ||
polymost_lintersect(pos.X - v.X, pos.Y - v.Y, pos.X + v.X, pos.Y + v.Y, wall[w].wall_int_pos.X, wall[w].wall_int_pos.Y, polymost_lintersect(pos.X - v.X, pos.Y - v.Y, pos.X + v.X, pos.Y + v.Y, wall[w].wall_int_pos().X, wall[w].wall_int_pos().Y,
POINT2(w).wall_int_pos.X, POINT2(w).wall_int_pos.Y)) POINT2(w).wall_int_pos().X, POINT2(w).wall_int_pos().Y))
{ {
int32_t const ang = getangle(wall[w].wall_int_pos.X - POINT2(w).wall_int_pos.X, wall[w].wall_int_pos.Y - POINT2(w).wall_int_pos.Y); int32_t const ang = getangle(wall[w].wall_int_pos().X - POINT2(w).wall_int_pos().X, wall[w].wall_int_pos().Y - POINT2(w).wall_int_pos().Y);
float const foffs = TSPR_OFFSET(tspr); float const foffs = TSPR_OFFSET(tspr);
DVector2 const offs = { -bsinf(ang, -6) * foffs, bcosf(ang, -6) * foffs }; DVector2 const offs = { -bsinf(ang, -6) * foffs, bcosf(ang, -6) * foffs };
@ -3281,8 +3281,8 @@ static_assert((int)RS_YFLIP == (int)HUDFLAG_FLIPPED);
void renderPrepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, fixed_t dahoriz, int16_t dawall, void renderPrepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, fixed_t dahoriz, int16_t dawall,
int32_t* tposx, int32_t* tposy, fixed_t* tang) int32_t* tposx, int32_t* tposy, fixed_t* tang)
{ {
const int32_t x = wall[dawall].wall_int_pos.X, dx = wall[dawall].point2Wall()->wall_int_pos.X - x; const int32_t x = wall[dawall].wall_int_pos().X, dx = wall[dawall].point2Wall()->wall_int_pos().X - x;
const int32_t y = wall[dawall].wall_int_pos.Y, dy = wall[dawall].point2Wall()->wall_int_pos.Y - y; const int32_t y = wall[dawall].wall_int_pos().Y, dy = wall[dawall].point2Wall()->wall_int_pos().Y - y;
const int32_t j = dx * dx + dy * dy; const int32_t j = dx * dx + dy * dy;
if (j == 0) if (j == 0)
@ -3658,8 +3658,8 @@ void renderDrawMasks(void)
maskwallcnt--; maskwallcnt--;
FVector2 dot = { (float)wall[w].wall_int_pos.X, (float)wall[w].wall_int_pos.Y }; FVector2 dot = { (float)wall[w].wall_int_pos().X, (float)wall[w].wall_int_pos().Y };
FVector2 dot2 = { (float)wall[w].point2Wall()->wall_int_pos.X, (float)wall[w].point2Wall()->wall_int_pos.Y }; FVector2 dot2 = { (float)wall[w].point2Wall()->wall_int_pos().X, (float)wall[w].point2Wall()->wall_int_pos().Y };
FVector2 middle = { (dot.X + dot2.X) * .5f, (dot.Y + dot2.Y) * .5f }; FVector2 middle = { (dot.X + dot2.X) * .5f, (dot.Y + dot2.Y) * .5f };
_equation maskeq = equation(dot.X, dot.Y, dot2.X, dot2.Y); _equation maskeq = equation(dot.X, dot.Y, dot2.X, dot2.Y);

View file

@ -170,10 +170,10 @@ static void CalcMapBounds()
for(auto& wal : wall) for(auto& wal : wall)
{ {
// get map min and max coordinates // get map min and max coordinates
if (wal.wall_int_pos.X < x_min_bound) x_min_bound = wal.wall_int_pos.X; if (wal.wall_int_pos().X < x_min_bound) x_min_bound = wal.wall_int_pos().X;
if (wal.wall_int_pos.Y < y_min_bound) y_min_bound = wal.wall_int_pos.Y; if (wal.wall_int_pos().Y < y_min_bound) y_min_bound = wal.wall_int_pos().Y;
if (wal.wall_int_pos.X > x_max_bound) x_max_bound = wal.wall_int_pos.X; if (wal.wall_int_pos().X > x_max_bound) x_max_bound = wal.wall_int_pos().X;
if (wal.wall_int_pos.Y > y_max_bound) y_max_bound = wal.wall_int_pos.Y; if (wal.wall_int_pos().Y > y_max_bound) y_max_bound = wal.wall_int_pos().Y;
} }
} }
@ -434,14 +434,14 @@ void drawredlines(int cposx, int cposy, int czoom, int cang)
if (ShowRedLine(wallnum(&wal), i)) if (ShowRedLine(wallnum(&wal), i))
{ {
int ox = wal.wall_int_pos.X - cposx; int ox = wal.wall_int_pos().X - cposx;
int oy = wal.wall_int_pos.Y - cposy; int oy = wal.wall_int_pos().Y - cposy;
int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
auto wal2 = wal.point2Wall(); auto wal2 = wal.point2Wall();
ox = wal2->wall_int_pos.X - cposx; ox = wal2->wall_int_pos().X - cposx;
oy = wal2->wall_int_pos.Y - cposy; oy = wal2->wall_int_pos().Y - cposy;
int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
@ -476,15 +476,15 @@ static void drawwhitelines(int cposx, int cposy, int czoom, int cang)
if (isSWALL() && !gFullMap && !show2dwall[wallnum(&wal)]) if (isSWALL() && !gFullMap && !show2dwall[wallnum(&wal)])
continue; continue;
int ox = wal.wall_int_pos.X - cposx; int ox = wal.wall_int_pos().X - cposx;
int oy = wal.wall_int_pos.Y - cposy; int oy = wal.wall_int_pos().Y - cposy;
int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
int k = wal.point2; int k = wal.point2;
auto wal2 = &wall[k]; auto wal2 = &wall[k];
ox = wal2->wall_int_pos.X - cposx; ox = wal2->wall_int_pos().X - cposx;
oy = wal2->wall_int_pos.Y - cposy; oy = wal2->wall_int_pos().Y - cposy;
int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);

View file

@ -67,8 +67,8 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
{ {
// Push you a little bit off the wall // Push you a little bit off the wall
*psect = hitinfo.hitSector; *psect = hitinfo.hitSector;
daang = bvectangbam(hitinfo.hitWall->point2Wall()->wall_int_pos.X - hitinfo.hitWall->wall_int_pos.X, daang = bvectangbam(hitinfo.hitWall->point2Wall()->wall_int_pos().X - hitinfo.hitWall->wall_int_pos().X,
hitinfo.hitWall->point2Wall()->wall_int_pos.Y - hitinfo.hitWall->wall_int_pos.Y); hitinfo.hitWall->point2Wall()->wall_int_pos().Y - hitinfo.hitWall->wall_int_pos().Y);
newdist = nx * daang.bsin() + ny * -daang.bcos(); newdist = nx * daang.bsin() + ny * -daang.bcos();
if (abs(nx) > abs(ny)) if (abs(nx) > abs(ny))
@ -170,7 +170,7 @@ void calcSlope(const sectortype* sec, float xpos, float ypos, float* pceilz, flo
int len = wal->Length(); int len = wal->Length();
if (len != 0) if (len != 0)
{ {
float fac = (wal->deltax() * (float(ypos - wal->wall_int_pos.Y)) - wal->deltay() * (float(xpos - wal->wall_int_pos.X))) * (1.f / 256.f) / len; float fac = (wal->deltax() * (float(ypos - wal->wall_int_pos().Y)) - wal->deltay() * (float(xpos - wal->wall_int_pos().X))) * (1.f / 256.f) / len;
if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * fac); if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * fac);
if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * fac); if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * fac);
} }
@ -228,7 +228,7 @@ int getslopeval(sectortype* sect, int x, int y, int z, int basez)
{ {
auto wal = sect->firstWall(); auto wal = sect->firstWall();
auto delta = wal->delta(); auto delta = wal->delta();
int i = (y - wal->wall_int_pos.Y) * delta.X - (x - wal->wall_int_pos.X) * delta.Y; int i = (y - wal->wall_int_pos().Y) * delta.X - (x - wal->wall_int_pos().X) * delta.Y;
return i == 0? 0 : Scale((z - basez) << 8, wal->Length(), i); return i == 0? 0 : Scale((z - basez) << 8, wal->Length(), i);
} }

View file

@ -185,32 +185,32 @@ inline double RenderY(int y)
inline double WallStartX(int wallnum) inline double WallStartX(int wallnum)
{ {
return wall[wallnum].wall_int_pos.X * (1 / 16.); return wall[wallnum].wall_int_pos().X * (1 / 16.);
} }
inline double WallStartY(int wallnum) inline double WallStartY(int wallnum)
{ {
return wall[wallnum].wall_int_pos.Y * (1 / -16.); return wall[wallnum].wall_int_pos().Y * (1 / -16.);
} }
inline double WallEndX(int wallnum) inline double WallEndX(int wallnum)
{ {
return wall[wallnum].point2Wall()->wall_int_pos.X * (1 / 16.); return wall[wallnum].point2Wall()->wall_int_pos().X * (1 / 16.);
} }
inline double WallEndY(int wallnum) inline double WallEndY(int wallnum)
{ {
return wall[wallnum].point2Wall()->wall_int_pos.Y * (1 / -16.); return wall[wallnum].point2Wall()->wall_int_pos().Y * (1 / -16.);
} }
inline double WallStartX(const walltype* wallnum) inline double WallStartX(const walltype* wallnum)
{ {
return wallnum->wall_int_pos.X * (1 / 16.); return wallnum->wall_int_pos().X * (1 / 16.);
} }
inline double WallStartY(const walltype* wallnum) inline double WallStartY(const walltype* wallnum)
{ {
return wallnum->wall_int_pos.Y * (1 / -16.); return wallnum->wall_int_pos().Y * (1 / -16.);
} }
inline DVector2 WallStart(const walltype* wallnum) inline DVector2 WallStart(const walltype* wallnum)
@ -220,12 +220,12 @@ inline DVector2 WallStart(const walltype* wallnum)
inline double WallEndX(const walltype* wallnum) inline double WallEndX(const walltype* wallnum)
{ {
return wallnum->point2Wall()->wall_int_pos.X * (1 / 16.); return wallnum->point2Wall()->wall_int_pos().X * (1 / 16.);
} }
inline double WallEndY(const walltype* wallnum) inline double WallEndY(const walltype* wallnum)
{ {
return wallnum->point2Wall()->wall_int_pos.Y * (1 / -16.); return wallnum->point2Wall()->wall_int_pos().Y * (1 / -16.);
} }
inline DVector2 WallEnd(const walltype* wallnum) inline DVector2 WallEnd(const walltype* wallnum)
@ -308,8 +308,8 @@ inline int I_GetBuildTime()
inline int32_t getangle(walltype* wal) inline int32_t getangle(walltype* wal)
{ {
return getangle( return getangle(
wal->point2Wall()->wall_int_pos.X - wal->wall_int_pos.X, wal->point2Wall()->wall_int_pos().X - wal->wall_int_pos().X,
wal->point2Wall()->wall_int_pos.Y - wal->wall_int_pos.Y); wal->point2Wall()->wall_int_pos().Y - wal->wall_int_pos().Y);
} }
inline TArrayView<walltype> wallsofsector(const sectortype* sec) inline TArrayView<walltype> wallsofsector(const sectortype* sec)
@ -342,10 +342,10 @@ inline double SquareDist(double lx1, double ly1, double lx2, double ly2)
inline DVector2 NearestPointLine(double px, double py, const walltype* wal) inline DVector2 NearestPointLine(double px, double py, const walltype* wal)
{ {
double lx1 = wal->wall_int_pos.X; double lx1 = wal->wall_int_pos().X;
double ly1 = wal->wall_int_pos.Y; double ly1 = wal->wall_int_pos().Y;
double lx2 = wal->point2Wall()->wall_int_pos.X; double lx2 = wal->point2Wall()->wall_int_pos().X;
double ly2 = wal->point2Wall()->wall_int_pos.Y; double ly2 = wal->point2Wall()->wall_int_pos().Y;
double wall_length = SquareDist(lx1, ly1, lx2, ly2); double wall_length = SquareDist(lx1, ly1, lx2, ly2);
@ -359,10 +359,10 @@ inline DVector2 NearestPointLine(double px, double py, const walltype* wal)
inline double SquareDistToWall(double px, double py, const walltype* wal, DVector2* point = nullptr) inline double SquareDistToWall(double px, double py, const walltype* wal, DVector2* point = nullptr)
{ {
double lx1 = wal->wall_int_pos.X; double lx1 = wal->wall_int_pos().X;
double ly1 = wal->wall_int_pos.Y; double ly1 = wal->wall_int_pos().Y;
double lx2 = wal->point2Wall()->wall_int_pos.X; double lx2 = wal->point2Wall()->wall_int_pos().X;
double ly2 = wal->point2Wall()->wall_int_pos.Y; double ly2 = wal->point2Wall()->wall_int_pos().Y;
double wall_length = SquareDist(lx1, ly1, lx2, ly2); double wall_length = SquareDist(lx1, ly1, lx2, ly2);

View file

@ -50,8 +50,8 @@ double Get(int index, DCoreActor* actor, int type)
case Interp_Sect_CeilingPanX: return sector[index].ceilingxpan_; case Interp_Sect_CeilingPanX: return sector[index].ceilingxpan_;
case Interp_Sect_CeilingPanY: return sector[index].ceilingypan_; case Interp_Sect_CeilingPanY: return sector[index].ceilingypan_;
case Interp_Wall_X: return wall[index].wall_int_pos.X; case Interp_Wall_X: return wall[index].wall_int_pos().X;
case Interp_Wall_Y: return wall[index].wall_int_pos.Y; case Interp_Wall_Y: return wall[index].wall_int_pos().Y;
case Interp_Wall_PanX: return wall[index].xpan_; case Interp_Wall_PanX: return wall[index].xpan_;
case Interp_Wall_PanY: return wall[index].ypan_; case Interp_Wall_PanY: return wall[index].ypan_;
@ -74,8 +74,8 @@ void Set(int index, DCoreActor* actor, int type, double val)
case Interp_Sect_CeilingPanX: sector[index].ceilingxpan_ = float(val); break; case Interp_Sect_CeilingPanX: sector[index].ceilingxpan_ = float(val); break;
case Interp_Sect_CeilingPanY: sector[index].ceilingypan_ = float(val); break; case Interp_Sect_CeilingPanY: sector[index].ceilingypan_ = float(val); break;
case Interp_Wall_X: old = wall[index].wall_int_pos.X; wall[index].wall_int_pos.X = xs_CRoundToInt(val); if (wall[index].wall_int_pos.X != old) wall[index].moved(); break; case Interp_Wall_X: old = wall[index].wall_int_pos().X; wall[index].__wall_int_pos.X = xs_CRoundToInt(val); if (wall[index].wall_int_pos().X != old) wall[index].moved(); break;
case Interp_Wall_Y: old = wall[index].wall_int_pos.Y; wall[index].wall_int_pos.Y = xs_CRoundToInt(val); if (wall[index].wall_int_pos.Y != old) wall[index].moved(); break; case Interp_Wall_Y: old = wall[index].wall_int_pos().Y; wall[index].__wall_int_pos.Y = xs_CRoundToInt(val); if (wall[index].wall_int_pos().Y != old) wall[index].moved(); break;
case Interp_Wall_PanX: wall[index].xpan_ = float(val); break; case Interp_Wall_PanX: wall[index].xpan_ = float(val); break;
case Interp_Wall_PanY: wall[index].ypan_ = float(val); break; case Interp_Wall_PanY: wall[index].ypan_ = float(val); break;

View file

@ -178,8 +178,8 @@ static void ReadSectorV5(FileReader& fr, sectortype& sect)
static void ReadWallV7(FileReader& fr, walltype& wall) static void ReadWallV7(FileReader& fr, walltype& wall)
{ {
wall.wall_int_pos.X = fr.ReadInt32(); wall.__wall_int_pos.X = fr.ReadInt32();
wall.wall_int_pos.Y = fr.ReadInt32(); wall.__wall_int_pos.Y = fr.ReadInt32();
wall.point2 = fr.ReadInt16(); wall.point2 = fr.ReadInt16();
wall.nextwall = fr.ReadInt16(); wall.nextwall = fr.ReadInt16();
wall.nextsector = fr.ReadInt16(); wall.nextsector = fr.ReadInt16();
@ -199,8 +199,8 @@ static void ReadWallV7(FileReader& fr, walltype& wall)
static void ReadWallV6(FileReader& fr, walltype& wall) static void ReadWallV6(FileReader& fr, walltype& wall)
{ {
wall.wall_int_pos.X = fr.ReadInt32(); wall.__wall_int_pos.X = fr.ReadInt32();
wall.wall_int_pos.Y = fr.ReadInt32(); wall.__wall_int_pos.Y = fr.ReadInt32();
wall.point2 = fr.ReadInt16(); wall.point2 = fr.ReadInt16();
wall.nextsector = fr.ReadInt16(); wall.nextsector = fr.ReadInt16();
wall.nextwall = fr.ReadInt16(); wall.nextwall = fr.ReadInt16();
@ -220,8 +220,8 @@ static void ReadWallV6(FileReader& fr, walltype& wall)
static void ReadWallV5(FileReader& fr, walltype& wall) static void ReadWallV5(FileReader& fr, walltype& wall)
{ {
wall.wall_int_pos.X = fr.ReadInt32(); wall.__wall_int_pos.X = fr.ReadInt32();
wall.wall_int_pos.Y = fr.ReadInt32(); wall.__wall_int_pos.Y = fr.ReadInt32();
wall.point2 = fr.ReadInt16(); wall.point2 = fr.ReadInt16();
wall.picnum = fr.ReadInt16(); wall.picnum = fr.ReadInt16();
wall.overpicnum = fr.ReadInt16(); wall.overpicnum = fr.ReadInt16();
@ -649,8 +649,8 @@ static void P_LoadBloodMapWalls(uint8_t* data, size_t len, TArray<walltype>& lwa
// only copy what we need to draw the map preview. // only copy what we need to draw the map preview.
auto pWall = &lwalls[i]; auto pWall = &lwalls[i];
pWall->wall_int_pos.X = LittleLong(load.x); pWall->__wall_int_pos.X = LittleLong(load.x);
pWall->wall_int_pos.Y = LittleLong(load.y); pWall->__wall_int_pos.Y = LittleLong(load.y);
pWall->point2 = LittleShort(load.point2); pWall->point2 = LittleShort(load.point2);
pWall->nextwall = LittleShort(load.nextwall); pWall->nextwall = LittleShort(load.nextwall);
pWall->nextsector = LittleShort(load.nextsector); pWall->nextsector = LittleShort(load.nextsector);

View file

@ -358,7 +358,9 @@ struct sectortype
struct walltype struct walltype
{ {
vec2_t wall_int_pos; vec2_t __wall_int_pos;
const vec2_t wall_int_pos() const { return __wall_int_pos; }
int32_t point2; int32_t point2;
int32_t nextwall; int32_t nextwall;
@ -404,10 +406,10 @@ struct walltype
walltype* nextWall() const; walltype* nextWall() const;
walltype* lastWall(bool fast = true) const; walltype* lastWall(bool fast = true) const;
walltype* point2Wall() const; walltype* point2Wall() const;
vec2_t delta() const { return point2Wall()->wall_int_pos - wall_int_pos; } vec2_t delta() const { return point2Wall()->wall_int_pos() - wall_int_pos(); }
vec2_t center() const { return(point2Wall()->wall_int_pos + wall_int_pos) / 2; } vec2_t center() const { return(point2Wall()->wall_int_pos() + wall_int_pos()) / 2; }
int deltax() const { return point2Wall()->wall_int_pos.X - wall_int_pos.X; } int deltax() const { return point2Wall()->wall_int_pos().X - wall_int_pos().X; }
int deltay() const { return point2Wall()->wall_int_pos.Y - wall_int_pos.Y; } int deltay() const { return point2Wall()->wall_int_pos().Y - wall_int_pos().Y; }
bool twoSided() const { return nextsector >= 0; } bool twoSided() const { return nextsector >= 0; }
int Length(); int Length();
void calcLength(); // this is deliberately not inlined and stored in a file where it can't be found at compile time. void calcLength(); // this is deliberately not inlined and stored in a file where it can't be found at compile time.
@ -549,8 +551,8 @@ inline void walltype::moved()
inline void walltype::move(int newx, int newy) inline void walltype::move(int newx, int newy)
{ {
wall_int_pos.X = newx; __wall_int_pos.X = newx;
wall_int_pos.Y = newy; __wall_int_pos.Y = newy;
lengthflags = 3; lengthflags = 3;
sectorp()->dirty = EDirty::AllDirty; sectorp()->dirty = EDirty::AllDirty;
} }

View file

@ -219,10 +219,10 @@ DEFINE_ACTION_FUNCTION(_UserMapMenu, DrawPreview)
int minx = INT_MAX, miny = INT_MAX, maxx = INT_MIN, maxy = INT_MIN; int minx = INT_MAX, miny = INT_MAX, maxx = INT_MIN, maxy = INT_MIN;
for (auto& wal : entry->walls) for (auto& wal : entry->walls)
{ {
if (wal.wall_int_pos.X < minx) minx = wal.wall_int_pos.X; if (wal.wall_int_pos().X < minx) minx = wal.wall_int_pos().X;
if (wal.wall_int_pos.X > maxx) maxx = wal.wall_int_pos.X; if (wal.wall_int_pos().X > maxx) maxx = wal.wall_int_pos().X;
if (wal.wall_int_pos.Y < miny) miny = wal.wall_int_pos.Y; if (wal.wall_int_pos().Y < miny) miny = wal.wall_int_pos().Y;
if (wal.wall_int_pos.Y > maxy) maxy = wal.wall_int_pos.Y; if (wal.wall_int_pos().Y > maxy) maxy = wal.wall_int_pos().Y;
} }
float scalex = float(width) / (maxx - minx); float scalex = float(width) / (maxx - minx);
float scaley = float(height) / (maxy - miny); float scaley = float(height) / (maxy - miny);
@ -238,16 +238,16 @@ DEFINE_ACTION_FUNCTION(_UserMapMenu, DrawPreview)
{ {
if (wal.nextwall < 0) continue; if (wal.nextwall < 0) continue;
auto point2 = &entry->walls[wal.point2]; auto point2 = &entry->walls[wal.point2];
twod->AddLine(dcenterx + (wal.wall_int_pos.X - centerx) * scale, dcentery + (wal.wall_int_pos.Y - centery) * scale, twod->AddLine(dcenterx + (wal.wall_int_pos().X - centerx) * scale, dcentery + (wal.wall_int_pos().Y - centery) * scale,
dcenterx + (point2->wall_int_pos.X - centerx) * scale, dcentery + (point2->wall_int_pos.Y - centery) * scale, dcenterx + (point2->wall_int_pos().X - centerx) * scale, dcentery + (point2->wall_int_pos().Y - centery) * scale,
-1, -1, INT_MAX, INT_MAX, 0xff808080); -1, -1, INT_MAX, INT_MAX, 0xff808080);
} }
for (auto& wal : entry->walls) for (auto& wal : entry->walls)
{ {
if (wal.nextwall >= 0) continue; if (wal.nextwall >= 0) continue;
auto point2 = &entry->walls[wal.point2]; auto point2 = &entry->walls[wal.point2];
twod->AddLine(dcenterx + (wal.wall_int_pos.X - centerx) * scale, dcentery + (wal.wall_int_pos.Y - centery) * scale, twod->AddLine(dcenterx + (wal.wall_int_pos().X - centerx) * scale, dcentery + (wal.wall_int_pos().Y - centery) * scale,
dcenterx + (point2->wall_int_pos.X - centerx) * scale, dcentery + (point2->wall_int_pos.Y - centery) * scale, dcenterx + (point2->wall_int_pos().X - centerx) * scale, dcentery + (point2->wall_int_pos().Y - centery) * scale,
-1, -1, INT_MAX, INT_MAX, 0xffffffff); -1, -1, INT_MAX, INT_MAX, 0xffffffff);
} }
return 0; return 0;

View file

@ -190,7 +190,7 @@ int GetWindingOrder(TArray<int>& poly)
int i = 0; int i = 0;
for (auto& index : poly) for (auto& index : poly)
{ {
points[i++] = wall[index].wall_int_pos; points[i++] = wall[index].wall_int_pos();
} }
StripLoop(points); StripLoop(points);
if (points.Size() == 0) return 1; // Sector has no dimension. We must accept this as valid here. if (points.Size() == 0) return 1; // Sector has no dimension. We must accept this as valid here.
@ -246,7 +246,7 @@ static void CollectLoops(TArray<loopcollect>& sectors)
{ {
// quick check for the only known cause of this in proper maps: // quick check for the only known cause of this in proper maps:
// RRRA E1L3 and SW $yamato have a wall duplicate where the duplicate's index is the original's + 1. These can just be deleted here and be ignored. // RRRA E1L3 and SW $yamato have a wall duplicate where the duplicate's index is the original's + 1. These can just be deleted here and be ignored.
if (ww > 1 && wall[ww-1].wall_int_pos.X == wall[ww-2].wall_int_pos.X && wall[ww-1].wall_int_pos.Y == wall[ww-2].wall_int_pos.Y && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww) if (ww > 1 && wall[ww-1].wall_int_pos().X == wall[ww-2].wall_int_pos().X && wall[ww-1].wall_int_pos().Y == wall[ww-2].wall_int_pos().Y && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww)
{ {
thisloop.Clear(); thisloop.Clear();
break; break;
@ -297,7 +297,7 @@ static void CollectLoops(TArray<loopcollect>& sectors)
static int insideLoop(int vertex, TArray<int>& loop) static int insideLoop(int vertex, TArray<int>& loop)
{ {
auto pt = wall[vertex].wall_int_pos; auto pt = wall[vertex].wall_int_pos();
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
// to reliably detect walls where vertices lie directly on outer walls, we must test the wall's center as well. // to reliably detect walls where vertices lie directly on outer walls, we must test the wall's center as well.
@ -307,8 +307,8 @@ static int insideLoop(int vertex, TArray<int>& loop)
for (unsigned ii = 0; ii < loop.Size() - 1; ii++) for (unsigned ii = 0; ii < loop.Size() - 1; ii++)
{ {
auto& wal = wall[loop[ii]]; auto& wal = wall[loop[ii]];
auto& pt1 = wal.wall_int_pos; const auto pt1 = wal.wall_int_pos();
auto& pt2 = wal.point2Wall()->wall_int_pos; const auto pt2 = wal.point2Wall()->wall_int_pos();
if ((pt1.Y >pt.Y) != (pt2.Y > pt.Y)) // skip if both are on the same side. if ((pt1.Y >pt.Y) != (pt2.Y > pt.Y)) // skip if both are on the same side.
{ {

View file

@ -19,8 +19,8 @@ struct SectionLine
int wall; int wall;
int partner; int partner;
vec2_t v1() const { return ::wall[startpoint].wall_int_pos; } vec2_t v1() const { return ::wall[startpoint].wall_int_pos(); }
vec2_t v2() const { return ::wall[endpoint].wall_int_pos; } vec2_t v2() const { return ::wall[endpoint].wall_int_pos(); }
walltype* wallp() const { return &::wall[wall]; } walltype* wallp() const { return &::wall[wall]; }
SectionLine* partnerLine() const; SectionLine* partnerLine() const;

View file

@ -162,7 +162,7 @@ void vertex_t::RecalcVertexHeights()
{ {
float heights[2]; float heights[2];
auto point = wall[masterwall].wall_int_pos; auto point = wall[masterwall].wall_int_pos();
PlanesAtPoint(&sector[sect], point.X, point.Y, &heights[0], &heights[1]); PlanesAtPoint(&sector[sect], point.X, point.Y, &heights[0], &heights[1]);
for(auto height : heights) for(auto height : heights)
{ {

View file

@ -72,7 +72,7 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b
for (auto& w : wall) for (auto& w : wall)
{ {
// Precalculate the clip angles to avoid doing this repeatedly during level traversal. // Precalculate the clip angles to avoid doing this repeatedly during level traversal.
auto vv = w.wall_int_pos - view; auto vv = w.wall_int_pos() - view;
w.clipangle = bvectangbam(vv.X, vv.Y); w.clipangle = bvectangbam(vv.X, vv.Y);
} }
memset(sectionstartang.Data(), -1, sectionstartang.Size() * sizeof(sectionstartang[0])); memset(sectionstartang.Data(), -1, sectionstartang.Size() * sizeof(sectionstartang[0]));
@ -168,11 +168,11 @@ bool BunchDrawer::CheckClip(walltype* wal, float* topclip, float* bottomclip)
// Mirrors and horizons always block the view // Mirrors and horizons always block the view
//if (linedef->special==Line_Mirror || linedef->special==Line_Horizon) return true; //if (linedef->special==Line_Mirror || linedef->special==Line_Horizon) return true;
PlanesAtPoint(frontsector, wal->wall_int_pos.X, wal->wall_int_pos.Y, &fs_ceilingheight1, &fs_floorheight1); PlanesAtPoint(frontsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &fs_ceilingheight1, &fs_floorheight1);
PlanesAtPoint(frontsector, pt2->wall_int_pos.X, pt2->wall_int_pos.Y, &fs_ceilingheight2, &fs_floorheight2); PlanesAtPoint(frontsector, pt2->wall_int_pos().X, pt2->wall_int_pos().Y, &fs_ceilingheight2, &fs_floorheight2);
PlanesAtPoint(backsector, wal->wall_int_pos.X, wal->wall_int_pos.Y, &bs_ceilingheight1, &bs_floorheight1); PlanesAtPoint(backsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &bs_ceilingheight1, &bs_floorheight1);
PlanesAtPoint(backsector, pt2->wall_int_pos.X, pt2->wall_int_pos.Y, &bs_ceilingheight2, &bs_floorheight2); PlanesAtPoint(backsector, pt2->wall_int_pos().X, pt2->wall_int_pos().Y, &bs_ceilingheight2, &bs_floorheight2);
*bottomclip = max(min(bs_floorheight1, bs_floorheight2), min(fs_floorheight1, fs_floorheight2)); *bottomclip = max(min(bs_floorheight1, bs_floorheight2), min(fs_floorheight1, fs_floorheight2));

View file

@ -415,8 +415,8 @@ void HWDrawInfo::CreateScene(bool portal)
for (auto w = 0; w < sect->wallnum; w++) for (auto w = 0; w < sect->wallnum; w++)
{ {
auto wal = sect->firstWall() + w; auto wal = sect->firstWall() + w;
wal->wall_int_pos.X += eff.geox[i]; wal->__wall_int_pos.X += eff.geox[i];
wal->wall_int_pos.Y += eff.geoy[i]; wal->__wall_int_pos.Y += eff.geoy[i];
} }
sect->dirty = EDirty::AllDirty; sect->dirty = EDirty::AllDirty;
if (eff.geosector[i] == drawsectp) drawsectp = eff.geosectorwarp[i]; if (eff.geosector[i] == drawsectp) drawsectp = eff.geosectorwarp[i];
@ -434,8 +434,8 @@ void HWDrawInfo::CreateScene(bool portal)
for (auto w = 0; w < sect->wallnum; w++) for (auto w = 0; w < sect->wallnum; w++)
{ {
auto wal = sect->firstWall() + w; auto wal = sect->firstWall() + w;
wal->wall_int_pos.X -= eff.geox[i]; wal->__wall_int_pos.X -= eff.geox[i];
wal->wall_int_pos.Y -= eff.geoy[i]; wal->__wall_int_pos.Y -= eff.geoy[i];
} }
} }
@ -447,8 +447,8 @@ void HWDrawInfo::CreateScene(bool portal)
for (auto w = 0; w < sect->wallnum; w++) for (auto w = 0; w < sect->wallnum; w++)
{ {
auto wal = sect->firstWall() + w; auto wal = sect->firstWall() + w;
wal->wall_int_pos.X += eff.geox2[i]; wal->__wall_int_pos.X += eff.geox2[i];
wal->wall_int_pos.Y += eff.geoy2[i]; wal->__wall_int_pos.Y += eff.geoy2[i];
} }
sect->dirty = EDirty::AllDirty; sect->dirty = EDirty::AllDirty;
if (eff.geosector[i] == orgdrawsectp) drawsectp = eff.geosectorwarp2[i]; if (eff.geosector[i] == orgdrawsectp) drawsectp = eff.geosectorwarp2[i];
@ -465,8 +465,8 @@ void HWDrawInfo::CreateScene(bool portal)
for (auto w = 0; w < sect->wallnum; w++) for (auto w = 0; w < sect->wallnum; w++)
{ {
auto wal = sect->firstWall() + w; auto wal = sect->firstWall() + w;
wal->wall_int_pos.X -= eff.geox2[i]; wal->__wall_int_pos.X -= eff.geox2[i];
wal->wall_int_pos.Y -= eff.geoy2[i]; wal->__wall_int_pos.Y -= eff.geoy2[i];
} }
} }
ingeo = false; ingeo = false;

View file

@ -524,10 +524,10 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe
di->mClipPortal = this; di->mClipPortal = this;
int x = line->wall_int_pos.X; int x = line->wall_int_pos().X;
int y = line->wall_int_pos.Y; int y = line->wall_int_pos().Y;
int dx = line->point2Wall()->wall_int_pos.X - x; int dx = line->point2Wall()->wall_int_pos().X - x;
int dy = line->point2Wall()->wall_int_pos.Y - y; int dy = line->point2Wall()->wall_int_pos().Y - y;
// this can overflow so use 64 bit math. // this can overflow so use 64 bit math.
const int64_t j = int64_t(dx) * dx + int64_t(dy) * dy; const int64_t j = int64_t(dx) * dx + int64_t(dy) * dy;
@ -565,8 +565,8 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe
ClearClipper(di, clipper); ClearClipper(di, clipper);
auto startan = bvectangbam(line->wall_int_pos.X - newx, line->wall_int_pos.Y - newy); auto startan = bvectangbam(line->wall_int_pos().X - newx, line->wall_int_pos().Y - newy);
auto endan = bvectangbam(line->point2Wall()->wall_int_pos.X - newx, line->point2Wall()->wall_int_pos.Y - newy); auto endan = bvectangbam(line->point2Wall()->wall_int_pos().X - newx, line->point2Wall()->wall_int_pos().Y - newy);
clipper->RestrictVisibleRange(endan, startan); // we check the line from the backside so angles are reversed. clipper->RestrictVisibleRange(endan, startan); // we check the line from the backside so angles are reversed.
return true; return true;
} }
@ -635,8 +635,8 @@ bool HWLineToLinePortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *cl
ClearClipper(di, clipper); ClearClipper(di, clipper);
auto startan = bvectangbam(origin->wall_int_pos.X - origx, origin->wall_int_pos.Y - origy); auto startan = bvectangbam(origin->wall_int_pos().X - origx, origin->wall_int_pos().Y - origy);
auto endan = bvectangbam(origin->point2Wall()->wall_int_pos.X - origx, origin->point2Wall()->wall_int_pos.Y - origy); auto endan = bvectangbam(origin->point2Wall()->wall_int_pos().X - origx, origin->point2Wall()->wall_int_pos().Y - origy);
clipper->RestrictVisibleRange(startan, endan); clipper->RestrictVisibleRange(startan, endan);
return true; return true;
} }
@ -687,8 +687,8 @@ bool HWLineToSpritePortal::Setup(HWDrawInfo* di, FRenderState& rstate, Clipper*
ClearClipper(di, clipper); ClearClipper(di, clipper);
auto startan = bvectangbam(origin->wall_int_pos.X - origx, origin->wall_int_pos.Y - origy); auto startan = bvectangbam(origin->wall_int_pos().X - origx, origin->wall_int_pos().Y - origy);
auto endan = bvectangbam(origin->point2Wall()->wall_int_pos.X - origx, origin->point2Wall()->wall_int_pos.Y - origy); auto endan = bvectangbam(origin->point2Wall()->wall_int_pos().X - origx, origin->point2Wall()->wall_int_pos().Y - origy);
clipper->RestrictVisibleRange(startan, endan); clipper->RestrictVisibleRange(startan, endan);
return true; return true;
} }

View file

@ -71,7 +71,7 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
// In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector. // In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector.
if (d.X == 0) if (d.X == 0)
{ {
double newdist = fabs(tspr->pos.X - wal.wall_int_pos.X); double newdist = fabs(tspr->pos.X - wal.wall_int_pos().X);
if (newdist < maxorthdist) if (newdist < maxorthdist)
{ {
maxorthdist = newdist; maxorthdist = newdist;
@ -80,7 +80,7 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
} }
else if (d.Y == 0) else if (d.Y == 0)
{ {
double newdist = fabs(tspr->pos.Y - wal.wall_int_pos.Y); double newdist = fabs(tspr->pos.Y - wal.wall_int_pos().Y);
if (newdist < maxorthdist) if (newdist < maxorthdist)
{ {
maxorthdist = newdist; maxorthdist = newdist;
@ -914,8 +914,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
FVector2 v1(WallStartX(wal), WallStartY(wal)); FVector2 v1(WallStartX(wal), WallStartY(wal));
FVector2 v2(WallEndX(wal), WallEndY(wal)); FVector2 v2(WallEndX(wal), WallEndY(wal));
PlanesAtPoint(frontsector, wal->wall_int_pos.X, wal->wall_int_pos.Y, &fch1, &ffh1); PlanesAtPoint(frontsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &fch1, &ffh1);
PlanesAtPoint(frontsector, p2wall->wall_int_pos.X, p2wall->wall_int_pos.Y, &fch2, &ffh2); PlanesAtPoint(frontsector, p2wall->wall_int_pos().X, p2wall->wall_int_pos().Y, &fch2, &ffh2);
#ifdef _DEBUG #ifdef _DEBUG
@ -1008,8 +1008,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
float bfh2; float bfh2;
float bch1; float bch1;
float bch2; float bch2;
PlanesAtPoint(backsector, wal->wall_int_pos.X, wal->wall_int_pos.Y, &bch1, &bfh1); PlanesAtPoint(backsector, wal->wall_int_pos().X, wal->wall_int_pos().Y, &bch1, &bfh1);
PlanesAtPoint(backsector, p2wall->wall_int_pos.X, p2wall->wall_int_pos.Y, &bch2, &bfh2); PlanesAtPoint(backsector, p2wall->wall_int_pos().X, p2wall->wall_int_pos().Y, &bch2, &bfh2);
SkyTop(di, wal, frontsector, backsector, v1, v2, fch1, fch2); SkyTop(di, wal, frontsector, backsector, v1, v2, fch1, fch2);
SkyBottom(di, wal, frontsector, backsector, v1, v2, ffh1, ffh2); SkyBottom(di, wal, frontsector, backsector, v1, v2, ffh1, ffh2);

View file

@ -606,8 +606,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, walltype &c, walltype
{ {
if (arc.BeginObject(key)) if (arc.BeginObject(key))
{ {
arc("x", c.wall_int_pos.X, def->wall_int_pos.X) arc("x", c.__wall_int_pos.X, def->__wall_int_pos.X)
("y", c.wall_int_pos.Y, def->wall_int_pos.Y) ("y", c.__wall_int_pos.Y, def->__wall_int_pos.Y)
("point2", c.point2, def->point2) ("point2", c.point2, def->point2)
("nextwall", c.nextwall, def->nextwall) ("nextwall", c.nextwall, def->nextwall)
("nextsector", c.nextsector, def->nextsector) ("nextsector", c.nextsector, def->nextsector)

View file

@ -63,8 +63,8 @@ static FVector3 CalcNormal(sectortype* sector, int plane)
pt[0] = { (float)WallStartX(wal), 0.f, (float)WallStartY(wal)}; pt[0] = { (float)WallStartX(wal), 0.f, (float)WallStartY(wal)};
pt[1] = { (float)WallStartX(wal2), 0.f, (float)WallStartY(wal2)}; pt[1] = { (float)WallStartX(wal2), 0.f, (float)WallStartY(wal2)};
PlanesAtPoint(sector, wal->wall_int_pos.X, wal->wall_int_pos.Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Y); PlanesAtPoint(sector, wal->wall_int_pos().X, wal->wall_int_pos().Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Y);
PlanesAtPoint(sector, wal2->wall_int_pos.X, wal2->wall_int_pos.Y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Y); PlanesAtPoint(sector, wal2->wall_int_pos().X, wal2->wall_int_pos().Y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Y);
if (pt[0].X == pt[1].X) if (pt[0].X == pt[1].X)
{ {
@ -118,10 +118,10 @@ public:
offset = off; offset = off;
auto firstwall = sec->firstWall(); auto firstwall = sec->firstWall();
ix1 = firstwall->wall_int_pos.X; ix1 = firstwall->wall_int_pos().X;
iy1 = firstwall->wall_int_pos.Y; iy1 = firstwall->wall_int_pos().Y;
ix2 = firstwall->point2Wall()->wall_int_pos.X; ix2 = firstwall->point2Wall()->wall_int_pos().X;
iy2 = firstwall->point2Wall()->wall_int_pos.Y; iy2 = firstwall->point2Wall()->wall_int_pos().Y;
if (plane == 0) if (plane == 0)
{ {
@ -363,8 +363,8 @@ bool SectionGeometry::ValidateSection(Section* section, int plane)
((sec->floorstat ^ compare->floorstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 && ((sec->floorstat ^ compare->floorstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 &&
sec->floorxpan_ == compare->floorxpan_ && sec->floorxpan_ == compare->floorxpan_ &&
sec->floorypan_ == compare->floorypan_ && sec->floorypan_ == compare->floorypan_ &&
sec->firstWall()->wall_int_pos == sdata.poscompare[0] && sec->firstWall()->wall_int_pos() == sdata.poscompare[0] &&
sec->firstWall()->point2Wall()->wall_int_pos == sdata.poscompare2[0] && sec->firstWall()->point2Wall()->wall_int_pos() == sdata.poscompare2[0] &&
!(section->dirty & EDirty::FloorDirty) && sdata.planes[plane].vertices.Size() ) return true; !(section->dirty & EDirty::FloorDirty) && sdata.planes[plane].vertices.Size() ) return true;
section->dirty &= ~EDirty::FloorDirty; section->dirty &= ~EDirty::FloorDirty;
@ -376,15 +376,15 @@ bool SectionGeometry::ValidateSection(Section* section, int plane)
((sec->ceilingstat ^ compare->ceilingstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 && ((sec->ceilingstat ^ compare->ceilingstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 &&
sec->ceilingxpan_ == compare->ceilingxpan_ && sec->ceilingxpan_ == compare->ceilingxpan_ &&
sec->ceilingypan_ == compare->ceilingypan_ && sec->ceilingypan_ == compare->ceilingypan_ &&
sec->firstWall()->wall_int_pos == sdata.poscompare[1] && sec->firstWall()->wall_int_pos() == sdata.poscompare[1] &&
sec->firstWall()->point2Wall()->wall_int_pos == sdata.poscompare2[1] && sec->firstWall()->point2Wall()->wall_int_pos() == sdata.poscompare2[1] &&
!(section->dirty & EDirty::CeilingDirty) && sdata.planes[1].vertices.Size()) return true; !(section->dirty & EDirty::CeilingDirty) && sdata.planes[1].vertices.Size()) return true;
section->dirty &= ~EDirty::CeilingDirty; section->dirty &= ~EDirty::CeilingDirty;
} }
compare->copy(sec); compare->copy(sec);
sdata.poscompare[plane] = sec->firstWall()->wall_int_pos; sdata.poscompare[plane] = sec->firstWall()->wall_int_pos();
sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->wall_int_pos; sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->wall_int_pos();
return false; return false;
} }

View file

@ -220,21 +220,21 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int
pWall->nextsector = mirrorsector; pWall->nextsector = mirrorsector;
wallarr[mirrorwall[0]].nextwall = nWall; wallarr[mirrorwall[0]].nextwall = nWall;
wallarr[mirrorwall[0]].nextsector = nSector; wallarr[mirrorwall[0]].nextsector = nSector;
wallarr[mirrorwall[0]].wall_int_pos.X = pWall->point2Wall()->wall_int_pos.X; wallarr[mirrorwall[0]].__wall_int_pos.X = pWall->point2Wall()->wall_int_pos().X;
wallarr[mirrorwall[0]].wall_int_pos.Y = pWall->point2Wall()->wall_int_pos.Y; wallarr[mirrorwall[0]].__wall_int_pos.Y = pWall->point2Wall()->wall_int_pos().Y;
wallarr[mirrorwall[1]].wall_int_pos.X = pWall->wall_int_pos.X; wallarr[mirrorwall[1]].__wall_int_pos.X = pWall->wall_int_pos().X;
wallarr[mirrorwall[1]].wall_int_pos.Y = pWall->wall_int_pos.Y; wallarr[mirrorwall[1]].__wall_int_pos.Y = pWall->wall_int_pos().Y;
wallarr[mirrorwall[2]].wall_int_pos.X = wallarr[mirrorwall[1]].wall_int_pos.X + (wallarr[mirrorwall[1]].wall_int_pos.X - wallarr[mirrorwall[0]].wall_int_pos.X) * 16; wallarr[mirrorwall[2]].__wall_int_pos.X = wallarr[mirrorwall[1]].wall_int_pos().X + (wallarr[mirrorwall[1]].wall_int_pos().X - wallarr[mirrorwall[0]].wall_int_pos().X) * 16;
wallarr[mirrorwall[2]].wall_int_pos.Y = wallarr[mirrorwall[1]].wall_int_pos.Y + (wallarr[mirrorwall[1]].wall_int_pos.Y - wallarr[mirrorwall[0]].wall_int_pos.Y) * 16; wallarr[mirrorwall[2]].__wall_int_pos.Y = wallarr[mirrorwall[1]].wall_int_pos().Y + (wallarr[mirrorwall[1]].wall_int_pos().Y - wallarr[mirrorwall[0]].wall_int_pos().Y) * 16;
wallarr[mirrorwall[3]].wall_int_pos.X = wallarr[mirrorwall[0]].wall_int_pos.X + (wallarr[mirrorwall[0]].wall_int_pos.X - wallarr[mirrorwall[1]].wall_int_pos.X) * 16; wallarr[mirrorwall[3]].__wall_int_pos.X = wallarr[mirrorwall[0]].wall_int_pos().X + (wallarr[mirrorwall[0]].wall_int_pos().X - wallarr[mirrorwall[1]].wall_int_pos().X) * 16;
wallarr[mirrorwall[3]].wall_int_pos.Y = wallarr[mirrorwall[0]].wall_int_pos.Y + (wallarr[mirrorwall[0]].wall_int_pos.Y - wallarr[mirrorwall[1]].wall_int_pos.Y) * 16; wallarr[mirrorwall[3]].__wall_int_pos.Y = wallarr[mirrorwall[0]].wall_int_pos().Y + (wallarr[mirrorwall[0]].wall_int_pos().Y - wallarr[mirrorwall[1]].wall_int_pos().Y) * 16;
sector.Data()[mirrorsector].setfloorz(sector[nSector].floorz, true); sector.Data()[mirrorsector].setfloorz(sector[nSector].floorz, true);
sector.Data()[mirrorsector].setceilingz(sector[nSector].ceilingz, true); sector.Data()[mirrorsector].setceilingz(sector[nSector].ceilingz, true);
int cx, cy, ca; int cx, cy, ca;
if (pWall->type == kWallStack) if (pWall->type == kWallStack)
{ {
cx = x - (wall[pWall->hitag].wall_int_pos.X - pWall->point2Wall()->wall_int_pos.X); cx = x - (wall[pWall->hitag].wall_int_pos().X - pWall->point2Wall()->wall_int_pos().X);
cy = y - (wall[pWall->hitag].wall_int_pos.Y - pWall->point2Wall()->wall_int_pos.Y); cy = y - (wall[pWall->hitag].wall_int_pos().Y - pWall->point2Wall()->wall_int_pos().Y);
ca = a; ca = a;
} }
else else

View file

@ -2616,7 +2616,7 @@ int actFloorBounceVector(int* x, int* y, int* z, sectortype* pSector, int a5)
} }
walltype* pWall = pSector->firstWall(); walltype* pWall = pSector->firstWall();
walltype* pWall2 = pWall->point2Wall(); walltype* pWall2 = pWall->point2Wall();
int angle = getangle(pWall2->wall_int_pos.X - pWall->wall_int_pos.X, pWall2->wall_int_pos.Y - pWall->wall_int_pos.Y) + 512; int angle = getangle(pWall2->wall_int_pos().X - pWall->wall_int_pos().X, pWall2->wall_int_pos().Y - pWall->wall_int_pos().Y) + 512;
int t2 = pSector->floorheinum << 4; int t2 = pSector->floorheinum << 4;
int t3 = approxDist(-0x10000, t2); int t3 = approxDist(-0x10000, t2);
int t4 = DivScale(-0x10000, t3, 16); int t4 = DivScale(-0x10000, t3, 16);

View file

@ -392,8 +392,8 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
{ {
dbCrypt((char*)&load, sizeof(walltypedisk), (gMapRev * sizeof(sectortypedisk)) | 0x7474614d); dbCrypt((char*)&load, sizeof(walltypedisk), (gMapRev * sizeof(sectortypedisk)) | 0x7474614d);
} }
pWall->wall_int_pos.X = LittleLong(load.x); pWall->__wall_int_pos.X = LittleLong(load.x);
pWall->wall_int_pos.Y = LittleLong(load.y); pWall->__wall_int_pos.Y = LittleLong(load.y);
pWall->point2 = LittleShort(load.point2); pWall->point2 = LittleShort(load.point2);
pWall->nextwall = LittleShort(load.nextwall); pWall->nextwall = LittleShort(load.nextwall);
pWall->nextsector = LittleShort(load.nextsector); pWall->nextsector = LittleShort(load.nextsector);

View file

@ -177,10 +177,10 @@ bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, i
bool CheckProximityWall(walltype* pWall, int x, int y, int nDist) bool CheckProximityWall(walltype* pWall, int x, int y, int nDist)
{ {
int x1 = pWall->wall_int_pos.X; int x1 = pWall->wall_int_pos().X;
int y1 = pWall->wall_int_pos.Y; int y1 = pWall->wall_int_pos().Y;
int x2 = pWall->point2Wall()->wall_int_pos.X; int x2 = pWall->point2Wall()->wall_int_pos().X;
int y2 = pWall->point2Wall()->wall_int_pos.Y; int y2 = pWall->point2Wall()->wall_int_pos().Y;
nDist <<= 4; nDist <<= 4;
if (x1 < x2) if (x1 < x2)
{ {
@ -539,12 +539,12 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
nOfs = (nOfs * pWall->yrepeat) / 8; nOfs = (nOfs * pWall->yrepeat) / 8;
nOfs += int((nSizY * pWall->ypan_) / 256); nOfs += int((nSizY * pWall->ypan_) / 256);
int nLength = approxDist(pWall->wall_int_pos.X - pWall->point2Wall()->wall_int_pos.X, pWall->wall_int_pos.Y - pWall->point2Wall()->wall_int_pos.Y); int nLength = approxDist(pWall->wall_int_pos().X - pWall->point2Wall()->wall_int_pos().X, pWall->wall_int_pos().Y - pWall->point2Wall()->wall_int_pos().Y);
int nHOffset; int nHOffset;
if (pWall->cstat & CSTAT_WALL_XFLIP) if (pWall->cstat & CSTAT_WALL_XFLIP)
nHOffset = approxDist(gHitInfo.hitpos.X - pWall->point2Wall()->wall_int_pos.X, gHitInfo.hitpos.Y - pWall->point2Wall()->wall_int_pos.Y); nHOffset = approxDist(gHitInfo.hitpos.X - pWall->point2Wall()->wall_int_pos().X, gHitInfo.hitpos.Y - pWall->point2Wall()->wall_int_pos().Y);
else else
nHOffset = approxDist(gHitInfo.hitpos.X - pWall->wall_int_pos.X, gHitInfo.hitpos.Y - pWall->wall_int_pos.Y); nHOffset = approxDist(gHitInfo.hitpos.X - pWall->wall_int_pos().X, gHitInfo.hitpos.Y - pWall->wall_int_pos().Y);
nHOffset = pWall->xpan() + ((nHOffset * pWall->xrepeat) << 3) / nLength; nHOffset = pWall->xpan() + ((nHOffset * pWall->xrepeat) << 3) / nLength;
nHOffset %= nSizX; nHOffset %= nSizX;

View file

@ -457,7 +457,7 @@ void GibFX(walltype* pWall, GIBFX* pGFX, int a3, int a4, int a5, int a6, CGibVel
int r1 = Random(a6); int r1 = Random(a6);
int r2 = Random(a5); int r2 = Random(a5);
int r3 = Random(a4); int r3 = Random(a4);
auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->wall_int_pos.X + r3, pWall->wall_int_pos.Y + r2, a3 + r1, 0); auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->wall_int_pos().X + r3, pWall->wall_int_pos().Y + r2, a3 + r1, 0);
if (pGib) if (pGib)
{ {
if (pGFX->at1 < 0) if (pGFX->at1 < 0)
@ -490,8 +490,8 @@ void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity* pVel)
assert(nGibType >= 0 && nGibType < kGibMax); assert(nGibType >= 0 && nGibType < kGibMax);
int cx, cy, cz, wx, wy, wz; int cx, cy, cz, wx, wy, wz;
cx = (pWall->wall_int_pos.X + pWall->point2Wall()->wall_int_pos.X) >> 1; cx = (pWall->wall_int_pos().X + pWall->point2Wall()->wall_int_pos().X) >> 1;
cy = (pWall->wall_int_pos.Y + pWall->point2Wall()->wall_int_pos.Y) >> 1; cy = (pWall->wall_int_pos().Y + pWall->point2Wall()->wall_int_pos().Y) >> 1;
auto pSector = pWall->sectorp(); auto pSector = pWall->sectorp();
int32_t ceilZ, floorZ; int32_t ceilZ, floorZ;
getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ); getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ);
@ -501,8 +501,8 @@ void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity* pVel)
ceilZ = ClipLow(ceilZ, ceilZ2); ceilZ = ClipLow(ceilZ, ceilZ2);
floorZ = ClipHigh(floorZ, floorZ2); floorZ = ClipHigh(floorZ, floorZ2);
wz = floorZ - ceilZ; wz = floorZ - ceilZ;
wx = pWall->point2Wall()->wall_int_pos.X - pWall->wall_int_pos.X; wx = pWall->point2Wall()->wall_int_pos().X - pWall->wall_int_pos().X;
wy = pWall->point2Wall()->wall_int_pos.Y - pWall->wall_int_pos.Y; wy = pWall->point2Wall()->wall_int_pos().Y - pWall->wall_int_pos().Y;
cz = (ceilZ + floorZ) >> 1; cz = (ceilZ + floorZ) >> 1;
GIBLIST* pGib = &gibList[nGibType]; GIBLIST* pGib = &gibList[nGibType];

View file

@ -3479,8 +3479,8 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector
if (sourceactor->xspr.data4 > 0) if (sourceactor->xspr.data4 > 0)
{ {
int cx, cy, cz; int cx, cy, cz;
cx = (pWall->wall_int_pos.X + pWall->point2Wall()->wall_int_pos.X) >> 1; cx = (pWall->wall_int_pos().X + pWall->point2Wall()->wall_int_pos().X) >> 1;
cy = (pWall->wall_int_pos.Y + pWall->point2Wall()->wall_int_pos.Y) >> 1; cy = (pWall->wall_int_pos().Y + pWall->point2Wall()->wall_int_pos().Y) >> 1;
auto pMySector = pWall->sectorp(); auto pMySector = pWall->sectorp();
int32_t ceilZ, floorZ; int32_t ceilZ, floorZ;
getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ); getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ);

View file

@ -2096,8 +2096,8 @@ void AlignSlopes(void)
{ {
auto pNextSector = pWall->nextSector(); auto pNextSector = pWall->nextSector();
int x = (pWall->wall_int_pos.X + pWall2->wall_int_pos.X) / 2; int x = (pWall->wall_int_pos().X + pWall2->wall_int_pos().X) / 2;
int y = (pWall->wall_int_pos.Y + pWall2->wall_int_pos.Y) / 2; int y = (pWall->wall_int_pos().Y + pWall2->wall_int_pos().Y) / 2;
viewInterpolateSector(&sect); viewInterpolateSector(&sect);
alignflorslope(&sect, x, y, getflorzofslopeptr(pNextSector, x, y)); alignflorslope(&sect, x, y, getflorzofslopeptr(pNextSector, x, y));
alignceilslope(&sect, x, y, getceilzofslopeptr(pNextSector, x, y)); alignceilslope(&sect, x, y, getceilzofslopeptr(pNextSector, x, y));
@ -2172,8 +2172,8 @@ void trInit(TArray<DBloodActor*>& actors)
gBusy.Clear(); gBusy.Clear();
for (auto& wal : wall) for (auto& wal : wall)
{ {
wal.baseWall.X = wal.wall_int_pos.X; wal.baseWall.X = wal.wall_int_pos().X;
wal.baseWall.Y = wal.wall_int_pos.Y; wal.baseWall.Y = wal.wall_int_pos().Y;
} }
for (auto actor : actors) for (auto actor : actors)
{ {
@ -2224,8 +2224,8 @@ void trInit(TArray<DBloodActor*>& actors)
TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, pSector->type == kSectorSlide); TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, pSector->type == kSectorSlide);
for (auto& wal : wallsofsector(pSector)) for (auto& wal : wallsofsector(pSector))
{ {
wal.baseWall.X = wal.wall_int_pos.X; wal.baseWall.X = wal.wall_int_pos().X;
wal.baseWall.Y = wal.wall_int_pos.Y; wal.baseWall.Y = wal.wall_int_pos().Y;
} }
BloodSectIterator it(pSector); BloodSectIterator it(pSector);
while (auto actor = it.Next()) while (auto actor = it.Next())
@ -2243,8 +2243,8 @@ void trInit(TArray<DBloodActor*>& actors)
TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, 0, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, pSector->type == kSectorRotate); TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, 0, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, pSector->type == kSectorRotate);
for (auto& wal : wallsofsector(pSector)) for (auto& wal : wallsofsector(pSector))
{ {
wal.baseWall.X = wal.wall_int_pos.X; wal.baseWall.X = wal.wall_int_pos().X;
wal.baseWall.Y = wal.wall_int_pos.Y; wal.baseWall.Y = wal.wall_int_pos().Y;
} }
BloodSectIterator it(pSector); BloodSectIterator it(pSector);
while (auto actor = it.Next()) while (auto actor = it.Next())

View file

@ -164,7 +164,7 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
int dst = 0x7fffffff, i = 0; int dst = 0x7fffffff, i = 0;
for (int k = 0; k < mirrorcnt; k++) for (int k = 0; k < mirrorcnt; k++)
{ {
int j = abs(mirrorwall[k]->wall_int_pos.X - cposx) + abs(mirrorwall[k]->wall_int_pos.Y - cposy); int j = abs(mirrorwall[k]->wall_int_pos().X - cposx) + abs(mirrorwall[k]->wall_int_pos().Y - cposy);
if (j < dst) dst = j, i = k; if (j < dst) dst = j, i = k;
} }

View file

@ -4189,8 +4189,8 @@ void handle_se20(DDukeActor* actor)
} }
auto& wal = actor->temp_walls; auto& wal = actor->temp_walls;
dragpoint(wal[0], wal[0]->wall_int_pos.X + x, wal[0]->wall_int_pos.Y + l); dragpoint(wal[0], wal[0]->wall_int_pos().X + x, wal[0]->wall_int_pos().Y + l);
dragpoint(wal[1], wal[1]->wall_int_pos.X + x, wal[1]->wall_int_pos.Y + l); dragpoint(wal[1], wal[1]->wall_int_pos().X + x, wal[1]->wall_int_pos().Y + l);
for (int p = connecthead; p >= 0; p = connectpoint2[p]) for (int p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].cursector == actor->sector() && ps[p].on_ground) if (ps[p].cursector == actor->sector() && ps[p].on_ground)

View file

@ -270,13 +270,13 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
if (((dasectp->ceilingz - actor->spr.pos.Z) >> 8) < r) if (((dasectp->ceilingz - actor->spr.pos.Z) >> 8) < r)
{ {
auto wal = dasectp->firstWall(); auto wal = dasectp->firstWall();
int d = abs(wal->wall_int_pos.X - actor->spr.pos.X) + abs(wal->wall_int_pos.Y - actor->spr.pos.Y); int d = abs(wal->wall_int_pos().X - actor->spr.pos.X) + abs(wal->wall_int_pos().Y - actor->spr.pos.Y);
if (d < r) if (d < r)
fi.checkhitceiling(dasectp); fi.checkhitceiling(dasectp);
else else
{ {
auto thirdpoint = wal->point2Wall()->point2Wall(); auto thirdpoint = wal->point2Wall()->point2Wall();
d = abs(thirdpoint->wall_int_pos.X - actor->spr.pos.X) + abs(thirdpoint->wall_int_pos.Y - actor->spr.pos.Y); d = abs(thirdpoint->wall_int_pos().X - actor->spr.pos.X) + abs(thirdpoint->wall_int_pos().Y - actor->spr.pos.Y);
if (d < r) if (d < r)
fi.checkhitceiling(dasectp); fi.checkhitceiling(dasectp);
} }
@ -284,18 +284,18 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
for (auto& wal : wallsofsector(dasectp)) for (auto& wal : wallsofsector(dasectp))
{ {
if ((abs(wal.wall_int_pos.X - actor->spr.pos.X) + abs(wal.wall_int_pos.Y - actor->spr.pos.Y)) < r) if ((abs(wal.wall_int_pos().X - actor->spr.pos.X) + abs(wal.wall_int_pos().Y - actor->spr.pos.Y)) < r)
{ {
if (wal.twoSided()) if (wal.twoSided())
{ {
search.Add(wal.nextSector()); search.Add(wal.nextSector());
} }
int x1 = (((wal.wall_int_pos.X + wal.point2Wall()->wall_int_pos.X) >> 1) + actor->spr.pos.X) >> 1; int x1 = (((wal.wall_int_pos().X + wal.point2Wall()->wall_int_pos().X) >> 1) + actor->spr.pos.X) >> 1;
int y1 = (((wal.wall_int_pos.Y + wal.point2Wall()->wall_int_pos.Y) >> 1) + actor->spr.pos.Y) >> 1; int y1 = (((wal.wall_int_pos().Y + wal.point2Wall()->wall_int_pos().Y) >> 1) + actor->spr.pos.Y) >> 1;
sectortype* sect = wal.sectorp(); sectortype* sect = wal.sectorp();
updatesector(x1, y1, &sect); updatesector(x1, y1, &sect);
if (sect && cansee(x1, y1, actor->spr.pos.Z, sect, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector())) if (sect && cansee(x1, y1, actor->spr.pos.Z, sect, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector()))
fi.checkhitwall(actor, &wal, wal.wall_int_pos.X, wal.wall_int_pos.Y, actor->spr.pos.Z, actor->spr.picnum); fi.checkhitwall(actor, &wal, wal.wall_int_pos().X, wal.wall_int_pos().Y, actor->spr.pos.Z, actor->spr.picnum);
} }
} }
} }
@ -3502,7 +3502,7 @@ void moveeffectors_d(void) //STATNUM 3
auto sc = act->sector(); auto sc = act->sector();
if (sc->wallnum != 4) continue; if (sc->wallnum != 4) continue;
auto wal = sc->firstWall() + 2; auto wal = sc->firstWall() + 2;
alignflorslope(act->sector(), wal->wall_int_pos.X, wal->wall_int_pos.Y, wal->nextSector()->floorz); alignflorslope(act->sector(), wal->wall_int_pos().X, wal->wall_int_pos().Y, wal->nextSector()->floorz);
} }
} }

View file

@ -287,8 +287,8 @@ void dojaildoor(void)
{ {
for (auto& wal : wallsofsector(sectp)) for (auto& wal : wallsofsector(sectp))
{ {
int x = wal.wall_int_pos.X; int x = wal.wall_int_pos().X;
int y = wal.wall_int_pos.Y; int y = wal.wall_int_pos().Y;
switch (jaildoordir[i]) switch (jaildoordir[i])
{ {
case 10: case 10:
@ -339,24 +339,24 @@ void dojaildoor(void)
switch (jaildoordir[i]) switch (jaildoordir[i])
{ {
default: // make case of bad parameters well defined. default: // make case of bad parameters well defined.
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 10: case 10:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y + speed; y = wal.wall_int_pos().Y + speed;
break; break;
case 20: case 20:
x = wal.wall_int_pos.X - speed; x = wal.wall_int_pos().X - speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 30: case 30:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y - speed; y = wal.wall_int_pos().Y - speed;
break; break;
case 40: case 40:
x = wal.wall_int_pos.X + speed; x = wal.wall_int_pos().X + speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
} }
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
@ -421,24 +421,24 @@ void moveminecart(void)
switch (minecartdir[i]) switch (minecartdir[i])
{ {
default: // make case of bad parameters well defined. default: // make case of bad parameters well defined.
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 10: case 10:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y + speed; y = wal.wall_int_pos().Y + speed;
break; break;
case 20: case 20:
x = wal.wall_int_pos.X - speed; x = wal.wall_int_pos().X - speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 30: case 30:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y - speed; y = wal.wall_int_pos().Y - speed;
break; break;
case 40: case 40:
x = wal.wall_int_pos.X + speed; x = wal.wall_int_pos().X + speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
} }
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
@ -475,24 +475,24 @@ void moveminecart(void)
switch (minecartdir[i]) switch (minecartdir[i])
{ {
default: // make case of bad parameters well defined. default: // make case of bad parameters well defined.
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 10: case 10:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y + speed; y = wal.wall_int_pos().Y + speed;
break; break;
case 20: case 20:
x = wal.wall_int_pos.X - speed; x = wal.wall_int_pos().X - speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
case 30: case 30:
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y - speed; y = wal.wall_int_pos().Y - speed;
break; break;
case 40: case 40:
x = wal.wall_int_pos.X + speed; x = wal.wall_int_pos().X + speed;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
break; break;
} }
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
@ -504,8 +504,8 @@ void moveminecart(void)
min_x = min_y = 0x20000; min_x = min_y = 0x20000;
for (auto& wal : wallsofsector(csect)) for (auto& wal : wallsofsector(csect))
{ {
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
if (x > max_x) if (x > max_x)
max_x = x; max_x = x;
if (y > max_y) if (y > max_y)

View file

@ -228,13 +228,13 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
if (((dasectp->ceilingz - actor->spr.pos.Z) >> 8) < r) if (((dasectp->ceilingz - actor->spr.pos.Z) >> 8) < r)
{ {
auto wal = dasectp->firstWall(); auto wal = dasectp->firstWall();
int d = abs(wal->wall_int_pos.X - actor->spr.pos.X) + abs(wal->wall_int_pos.Y - actor->spr.pos.Y); int d = abs(wal->wall_int_pos().X - actor->spr.pos.X) + abs(wal->wall_int_pos().Y - actor->spr.pos.Y);
if (d < r) if (d < r)
fi.checkhitceiling(dasectp); fi.checkhitceiling(dasectp);
else else
{ {
auto thirdpoint = wal->point2Wall()->point2Wall(); auto thirdpoint = wal->point2Wall()->point2Wall();
d = abs(thirdpoint->wall_int_pos.X - actor->spr.pos.X) + abs(thirdpoint->wall_int_pos.Y - actor->spr.pos.Y); d = abs(thirdpoint->wall_int_pos().X - actor->spr.pos.X) + abs(thirdpoint->wall_int_pos().Y - actor->spr.pos.Y);
if (d < r) if (d < r)
fi.checkhitceiling(dasectp); fi.checkhitceiling(dasectp);
} }
@ -242,18 +242,18 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
for (auto& wal : wallsofsector(dasectp)) for (auto& wal : wallsofsector(dasectp))
{ {
if ((abs(wal.wall_int_pos.X - actor->spr.pos.X) + abs(wal.wall_int_pos.Y - actor->spr.pos.Y)) < r) if ((abs(wal.wall_int_pos().X - actor->spr.pos.X) + abs(wal.wall_int_pos().Y - actor->spr.pos.Y)) < r)
{ {
if (wal.twoSided()) if (wal.twoSided())
{ {
search.Add(wal.nextSector()); search.Add(wal.nextSector());
} }
int x1 = (((wal.wall_int_pos.X + wal.point2Wall()->wall_int_pos.X) >> 1) + actor->spr.pos.X) >> 1; int x1 = (((wal.wall_int_pos().X + wal.point2Wall()->wall_int_pos().X) >> 1) + actor->spr.pos.X) >> 1;
int y1 = (((wal.wall_int_pos.Y + wal.point2Wall()->wall_int_pos.Y) >> 1) + actor->spr.pos.Y) >> 1; int y1 = (((wal.wall_int_pos().Y + wal.point2Wall()->wall_int_pos().Y) >> 1) + actor->spr.pos.Y) >> 1;
auto sect = wal.sectorp(); auto sect = wal.sectorp();
updatesector(x1, y1, &sect); updatesector(x1, y1, &sect);
if (sect != nullptr && cansee(x1, y1, actor->spr.pos.Z, sect, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector())) if (sect != nullptr && cansee(x1, y1, actor->spr.pos.Z, sect, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector()))
fi.checkhitwall(actor, &wal, wal.wall_int_pos.X, wal.wall_int_pos.Y, actor->spr.pos.Z, actor->spr.picnum); fi.checkhitwall(actor, &wal, wal.wall_int_pos().X, wal.wall_int_pos().Y, actor->spr.pos.Z, actor->spr.picnum);
} }
} }
} }
@ -3456,7 +3456,7 @@ void moveeffectors_r(void) //STATNUM 3
auto sc = act->sector(); auto sc = act->sector();
if (sc->wallnum != 4) continue; if (sc->wallnum != 4) continue;
auto wal = sc->firstWall() + 2; auto wal = sc->firstWall() + 2;
alignflorslope(act->sector(), wal->wall_int_pos.X, wal->wall_int_pos.Y, wal->nextSector()->floorz); alignflorslope(act->sector(), wal->wall_int_pos().X, wal->wall_int_pos().Y, wal->nextSector()->floorz);
} }
} }

View file

@ -964,10 +964,10 @@ void DoWall(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, i
switch (lLabelID) switch (lLabelID)
{ {
case WALL_X: case WALL_X:
if (!bSet) SetGameVarID(lVar2, wallp->wall_int_pos.X, sActor, sPlayer); if (!bSet) SetGameVarID(lVar2, wallp->wall_int_pos().X, sActor, sPlayer);
break; break;
case WALL_Y: case WALL_Y:
if (bSet) SetGameVarID(lVar2, wallp->wall_int_pos.Y, sActor, sPlayer); if (bSet) SetGameVarID(lVar2, wallp->wall_int_pos().Y, sActor, sPlayer);
break; break;
case WALL_POINT2: case WALL_POINT2:
if (!bSet) SetGameVarID(lVar2, wallp->point2, sActor, sPlayer); if (!bSet) SetGameVarID(lVar2, wallp->point2, sActor, sPlayer);

View file

@ -715,8 +715,8 @@ void prelevel_common(int g)
if (sectp->lotag == -1) if (sectp->lotag == -1)
{ {
ps[0].exit.X = sectp->firstWall()->wall_int_pos.X; ps[0].exit.X = sectp->firstWall()->wall_int_pos().X;
ps[0].exit.Y = sectp->firstWall()->wall_int_pos.Y; ps[0].exit.Y = sectp->firstWall()->wall_int_pos().Y;
continue; continue;
} }
} }

View file

@ -288,10 +288,10 @@ int* animateptr(int type, int index, bool write)
return sector[index].ceilingzptr(!write); return sector[index].ceilingzptr(!write);
case anim_vertexx: case anim_vertexx:
if (write) wall[index].moved(); if (write) wall[index].moved();
return &wall[index].wall_int_pos.X; return &wall[index].__wall_int_pos.X;
case anim_vertexy: case anim_vertexy:
if (write) wall[index].moved(); if (write) wall[index].moved();
return &wall[index].wall_int_pos.Y; return &wall[index].__wall_int_pos.Y;
default: default:
assert(false); assert(false);
return &scratch; return &scratch;
@ -506,8 +506,8 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
dax = 0L, day = 0L; dax = 0L, day = 0L;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : wallsofsector(sptr))
{ {
dax += wal.wall_int_pos.X; dax += wal.wall_int_pos().X;
day += wal.wall_int_pos.Y; day += wal.wall_int_pos().Y;
} }
dax /= sptr->wallnum; dax /= sptr->wallnum;
day /= sptr->wallnum; day /= sptr->wallnum;
@ -517,7 +517,7 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
wallfind[0] = nullptr; wallfind[0] = nullptr;
wallfind[1] = nullptr; wallfind[1] = nullptr;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : wallsofsector(sptr))
if ((wal.wall_int_pos.X == dax) || (wal.wall_int_pos.Y == day)) if ((wal.wall_int_pos().X == dax) || (wal.wall_int_pos().Y == day))
{ {
if (wallfind[0] == nullptr) if (wallfind[0] == nullptr)
wallfind[0] = &wal; wallfind[0] = &wal;
@ -533,33 +533,33 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
auto prevwall = wal - 1; auto prevwall = wal - 1;
if (prevwall < sptr->firstWall()) prevwall += sptr->wallnum; if (prevwall < sptr->firstWall()) prevwall += sptr->wallnum;
if ((wal->wall_int_pos.X == dax) && (wal->wall_int_pos.Y == day)) if ((wal->wall_int_pos().X == dax) && (wal->wall_int_pos().Y == day))
{ {
dax2 = ((prevwall->wall_int_pos.X + wal->point2Wall()->wall_int_pos.X) >> 1) - wal->wall_int_pos.X; dax2 = ((prevwall->wall_int_pos().X + wal->point2Wall()->wall_int_pos().X) >> 1) - wal->wall_int_pos().X;
day2 = ((prevwall->wall_int_pos.Y + wal->point2Wall()->wall_int_pos.Y) >> 1) - wal->wall_int_pos.Y; day2 = ((prevwall->wall_int_pos().Y + wal->point2Wall()->wall_int_pos().Y) >> 1) - wal->wall_int_pos().Y;
if (dax2 != 0) if (dax2 != 0)
{ {
dax2 = wal->point2Wall()->point2Wall()->wall_int_pos.X; dax2 = wal->point2Wall()->point2Wall()->wall_int_pos().X;
dax2 -= wal->point2Wall()->wall_int_pos.X; dax2 -= wal->point2Wall()->wall_int_pos().X;
setanimation(sptr, anim_vertexx, wal, wal->wall_int_pos.X + dax2, sp); setanimation(sptr, anim_vertexx, wal, wal->wall_int_pos().X + dax2, sp);
setanimation(sptr, anim_vertexx, prevwall, prevwall->wall_int_pos.X + dax2, sp); setanimation(sptr, anim_vertexx, prevwall, prevwall->wall_int_pos().X + dax2, sp);
setanimation(sptr, anim_vertexx, wal->point2Wall(), wal->point2Wall()->wall_int_pos.X + dax2, sp); setanimation(sptr, anim_vertexx, wal->point2Wall(), wal->point2Wall()->wall_int_pos().X + dax2, sp);
callsound(sptr, actor); callsound(sptr, actor);
} }
else if (day2 != 0) else if (day2 != 0)
{ {
day2 = wal->point2Wall()->point2Wall()->wall_int_pos.Y; day2 = wal->point2Wall()->point2Wall()->wall_int_pos().Y;
day2 -= wal->point2Wall()->wall_int_pos.Y; day2 -= wal->point2Wall()->wall_int_pos().Y;
setanimation(sptr, anim_vertexy, wal, wal->wall_int_pos.Y + day2, sp); setanimation(sptr, anim_vertexy, wal, wal->wall_int_pos().Y + day2, sp);
setanimation(sptr, anim_vertexy, prevwall, prevwall->wall_int_pos.Y + day2, sp); setanimation(sptr, anim_vertexy, prevwall, prevwall->wall_int_pos().Y + day2, sp);
setanimation(sptr, anim_vertexy, wal->point2Wall(), wal->point2Wall()->wall_int_pos.Y + day2, sp); setanimation(sptr, anim_vertexy, wal->point2Wall(), wal->point2Wall()->wall_int_pos().Y + day2, sp);
callsound(sptr, actor); callsound(sptr, actor);
} }
} }
else else
{ {
dax2 = ((prevwall->wall_int_pos.X + wal->point2Wall()->wall_int_pos.X) >> 1) - wal->wall_int_pos.X; dax2 = ((prevwall->wall_int_pos().X + wal->point2Wall()->wall_int_pos().X) >> 1) - wal->wall_int_pos().X;
day2 = ((prevwall->wall_int_pos.Y + wal->point2Wall()->wall_int_pos.Y) >> 1) - wal->wall_int_pos.Y; day2 = ((prevwall->wall_int_pos().Y + wal->point2Wall()->wall_int_pos().Y) >> 1) - wal->wall_int_pos().Y;
if (dax2 != 0) if (dax2 != 0)
{ {
setanimation(sptr, anim_vertexx, wal, dax, sp); setanimation(sptr, anim_vertexx, wal, dax, sp);
@ -974,8 +974,8 @@ void operatesectors(sectortype* sptr, DDukeActor *actor)
if (!isRR()) break; if (!isRR()) break;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : wallsofsector(sptr))
{ {
setanimation(sptr, anim_vertexx, &wal, wal.wall_int_pos.X + 1024, 4); setanimation(sptr, anim_vertexx, &wal, wal.wall_int_pos().X + 1024, 4);
if (wal.twoSided()) setanimation(sptr, anim_vertexx, wal.nextWall(), wal.nextWall()->wall_int_pos.X + 1024, 4); if (wal.twoSided()) setanimation(sptr, anim_vertexx, wal.nextWall(), wal.nextWall()->wall_int_pos().X + 1024, 4);
} }
break; break;

View file

@ -250,8 +250,8 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
lotag = wwal->lotag; lotag = wwal->lotag;
if (lotag == 0) return 0; if (lotag == 0) return 0;
hitag = wwal->hitag; hitag = wwal->hitag;
sx = wwal->wall_int_pos.X; sx = wwal->wall_int_pos().X;
sy = wwal->wall_int_pos.Y; sy = wwal->wall_int_pos().Y;
picnum = wwal->picnum; picnum = wwal->picnum;
switchpal = wwal->pal; switchpal = wwal->pal;
} }

View file

@ -369,8 +369,8 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
lotag = wwal->lotag; lotag = wwal->lotag;
if (lotag == 0) return 0; if (lotag == 0) return 0;
hitag = wwal->hitag; hitag = wwal->hitag;
sx = wwal->wall_int_pos.X; sx = wwal->wall_int_pos().X;
sy = wwal->wall_int_pos.Y; sy = wwal->wall_int_pos().Y;
picnum = wwal->picnum; picnum = wwal->picnum;
switchpal = wwal->pal; switchpal = wwal->pal;
} }
@ -946,8 +946,8 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
j = n + 1; j = n + 1;
int x1 = wal->wall_int_pos.X; int x1 = wal->wall_int_pos().X;
int y1 = wal->wall_int_pos.Y; int y1 = wal->wall_int_pos().Y;
auto delta = wal->delta(); auto delta = wal->delta();
@ -2778,8 +2778,8 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
var_cx = 4; var_cx = 4;
for(auto& wal : wallsofsector(nextsect)) for(auto& wal : wallsofsector(nextsect))
{ {
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
if (x > max_x) if (x > max_x)
max_x = x; max_x = x;
if (y > max_y) if (y > max_y)
@ -2828,24 +2828,24 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
S_PlayActorSound(389, ps[snum].GetActor()); S_PlayActorSound(389, ps[snum].GetActor());
for(auto& wal : wallsofsector(nextsect)) for(auto& wal : wallsofsector(nextsect))
{ {
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
switch (wlwal->lotag) switch (wlwal->lotag)
{ {
case 42: case 42:
y = wal.wall_int_pos.Y + var_cx; y = wal.wall_int_pos().Y + var_cx;
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 41: case 41:
x = wal.wall_int_pos.X - var_cx; x = wal.wall_int_pos().X - var_cx;
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 40: case 40:
y = wal.wall_int_pos.Y - var_cx; y = wal.wall_int_pos().Y - var_cx;
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 43: case 43:
x = wal.wall_int_pos.X + var_cx; x = wal.wall_int_pos().X + var_cx;
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
} }
@ -2855,24 +2855,24 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
{ {
for(auto& wal : wallsofsector(nextsect)) for(auto& wal : wallsofsector(nextsect))
{ {
x = wal.wall_int_pos.X; x = wal.wall_int_pos().X;
y = wal.wall_int_pos.Y; y = wal.wall_int_pos().Y;
switch (wlwal->lotag) switch (wlwal->lotag)
{ {
case 42: case 42:
y = wal.wall_int_pos.Y - (var_cx - 2); y = wal.wall_int_pos().Y - (var_cx - 2);
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 41: case 41:
x = wal.wall_int_pos.X + (var_cx - 2); x = wal.wall_int_pos().X + (var_cx - 2);
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 40: case 40:
y = wal.wall_int_pos.Y + (var_cx - 2); y = wal.wall_int_pos().Y + (var_cx - 2);
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
case 43: case 43:
x = wal.wall_int_pos.X - (var_cx - 2); x = wal.wall_int_pos().X - (var_cx - 2);
dragpoint(&wal, x, y); dragpoint(&wal, x, y);
break; break;
} }

View file

@ -784,7 +784,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
for (auto& wal : wallsofsector(sectp)) for (auto& wal : wallsofsector(sectp))
{ {
d = FindDistance2D(actor->spr.pos.vec2 - wal.wall_int_pos); d = FindDistance2D(actor->spr.pos.vec2 - wal.wall_int_pos());
if (d < q) if (d < q)
{ {
q = d; q = d;
@ -798,7 +798,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
for (auto& wal : wallsofsector(sectp)) for (auto& wal : wallsofsector(sectp))
{ {
d = FindDistance2D(actor->spr.pos.vec2 - wal.wall_int_pos); d = FindDistance2D(actor->spr.pos.vec2 - wal.wall_int_pos());
if (d < q && &wal != actor->temp_walls[0]) if (d < q && &wal != actor->temp_walls[0])
{ {
q = d; q = d;
@ -958,12 +958,12 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->temp_data[1] = tempwallptr; actor->temp_data[1] = tempwallptr;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : wallsofsector(sectp))
{ {
msx[tempwallptr] = wal.wall_int_pos.X - actor->spr.pos.X; msx[tempwallptr] = wal.wall_int_pos().X - actor->spr.pos.X;
msy[tempwallptr] = wal.wall_int_pos.Y - actor->spr.pos.Y; msy[tempwallptr] = wal.wall_int_pos().Y - actor->spr.pos.Y;
tempwallptr++; tempwallptr++;
if (tempwallptr > 2047) if (tempwallptr > 2047)
{ {
I_Error("Too many moving sectors at (%d,%d).\n", wal.wall_int_pos.X, wal.wall_int_pos.Y); I_Error("Too many moving sectors at (%d,%d).\n", wal.wall_int_pos().X, wal.wall_int_pos().Y);
} }
} }
if (actor->spr.lotag == SE_30_TWO_WAY_TRAIN || actor->spr.lotag == SE_6_SUBWAY || actor->spr.lotag == SE_14_SUBWAY_CAR || actor->spr.lotag == SE_5_BOSS) if (actor->spr.lotag == SE_30_TWO_WAY_TRAIN || actor->spr.lotag == SE_6_SUBWAY || actor->spr.lotag == SE_14_SUBWAY_CAR || actor->spr.lotag == SE_5_BOSS)
@ -1098,8 +1098,8 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
return; return;
} }
int x1 = wal->wall_int_pos.X; int x1 = wal->wall_int_pos().X;
int y1 = wal->wall_int_pos.Y; int y1 = wal->wall_int_pos().Y;
auto delta = wal->delta() / (n + 1); auto delta = wal->delta() / (n + 1);
x1 -= Sgn(delta.Y); x1 -= Sgn(delta.Y);
@ -1153,8 +1153,8 @@ void ceilingglass(DDukeActor* actor, sectortype* sectp, int n)
for (auto& wal : wallsofsector(sectp)) for (auto& wal : wallsofsector(sectp))
{ {
int x1 = wal.wall_int_pos.X; int x1 = wal.wall_int_pos().X;
int y1 = wal.wall_int_pos.Y; int y1 = wal.wall_int_pos().Y;
auto delta = wal.delta() / (n + 1); auto delta = wal.delta() / (n + 1);
@ -1192,8 +1192,8 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
return; return;
} }
int x1 = wal->wall_int_pos.X; int x1 = wal->wall_int_pos().X;
int y1 = wal->wall_int_pos.Y; int y1 = wal->wall_int_pos().Y;
auto delta = wal->delta() / (n + 1); auto delta = wal->delta() / (n + 1);

View file

@ -215,15 +215,15 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b)
int bestx = 0x7FFFFFF; int bestx = 0x7FFFFFF;
int besty = bestx; int besty = bestx;
int x = wal1.wall_int_pos.X; int x = wal1.wall_int_pos().X;
int y = wal1.wall_int_pos.Y; int y = wal1.wall_int_pos().Y;
walltype* bestwall = nullptr; walltype* bestwall = nullptr;
for(auto& wal2 : wallsofsector(pSectorB)) for(auto& wal2 : wallsofsector(pSectorB))
{ {
int thisx = x - wal2.wall_int_pos.X; int thisx = x - wal2.wall_int_pos().X;
int thisy = y - wal2.wall_int_pos.Y; int thisy = y - wal2.wall_int_pos().Y;
int thisdist = abs(thisx) + abs(thisy); int thisdist = abs(thisx) + abs(thisy);
int bestdist = abs(bestx) + abs(besty); int bestdist = abs(bestx) + abs(besty);
@ -235,7 +235,7 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b)
} }
} }
dragpoint(bestwall, bestwall->wall_int_pos.X + bestx, bestwall->wall_int_pos.Y + besty); dragpoint(bestwall, bestwall->wall_int_pos().X + bestx, bestwall->wall_int_pos().Y + besty);
} }
if (b) { if (b) {

View file

@ -806,8 +806,8 @@ void CreatePushBlock(sectortype* pSector)
for (auto& wal : wallsofsector(pSector)) for (auto& wal : wallsofsector(pSector))
{ {
xSum += wal.wall_int_pos.X; xSum += wal.wall_int_pos().X;
ySum += wal.wall_int_pos.Y; ySum += wal.wall_int_pos().Y;
} }
int xAvg = xSum / pSector->wallnum; int xAvg = xSum / pSector->wallnum;
@ -829,8 +829,8 @@ void CreatePushBlock(sectortype* pSector)
for (auto& wal : wallsofsector(pSector)) for (auto& wal : wallsofsector(pSector))
{ {
uint32_t xDiff = abs(xAvg - wal.wall_int_pos.X); uint32_t xDiff = abs(xAvg - wal.wall_int_pos().X);
uint32_t yDiff = abs(yAvg - wal.wall_int_pos.Y); uint32_t yDiff = abs(yAvg - wal.wall_int_pos().Y);
uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff;
@ -1036,7 +1036,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
for(auto& wal : wallsofsector(pSector)) for(auto& wal : wallsofsector(pSector))
{ {
dragpoint(&wal, xvect + wal.wall_int_pos.X, yvect + wal.wall_int_pos.Y); dragpoint(&wal, xvect + wal.wall_int_pos().X, yvect + wal.wall_int_pos().Y);
} }
pBlockInfo->x += xvect; pBlockInfo->x += xvect;

View file

@ -411,20 +411,20 @@ DExhumedActor* FindWallSprites(sectortype* pSector)
for (auto& wal : wallsofsector(pSector)) for (auto& wal : wallsofsector(pSector))
{ {
if (wal.wall_int_pos.X < var_24) { if (wal.wall_int_pos().X < var_24) {
var_24 = wal.wall_int_pos.X; var_24 = wal.wall_int_pos().X;
} }
if (esi < wal.wall_int_pos.X) { if (esi < wal.wall_int_pos().X) {
esi = wal.wall_int_pos.X; esi = wal.wall_int_pos().X;
} }
if (ecx > wal.wall_int_pos.Y) { if (ecx > wal.wall_int_pos().Y) {
ecx = wal.wall_int_pos.Y; ecx = wal.wall_int_pos().Y;
} }
if (edi < wal.wall_int_pos.Y) { if (edi < wal.wall_int_pos().Y) {
edi = wal.wall_int_pos.Y; edi = wal.wall_int_pos().Y;
} }
} }
@ -986,23 +986,23 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p
SlideData[nSlide].pWall2 = pWall2; SlideData[nSlide].pWall2 = pWall2;
SlideData[nSlide].pWall3 = pWall3; SlideData[nSlide].pWall3 = pWall3;
SlideData[nSlide].x1 = pStartWall->wall_int_pos.X; SlideData[nSlide].x1 = pStartWall->wall_int_pos().X;
SlideData[nSlide].y1 = pStartWall->wall_int_pos.Y; SlideData[nSlide].y1 = pStartWall->wall_int_pos().Y;
SlideData[nSlide].x2 = pWall2->wall_int_pos.X; SlideData[nSlide].x2 = pWall2->wall_int_pos().X;
SlideData[nSlide].y2 = pWall2->wall_int_pos.Y; SlideData[nSlide].y2 = pWall2->wall_int_pos().Y;
SlideData[nSlide].x3 = pWall1->wall_int_pos.X; SlideData[nSlide].x3 = pWall1->wall_int_pos().X;
SlideData[nSlide].y3 = pWall1->wall_int_pos.Y; SlideData[nSlide].y3 = pWall1->wall_int_pos().Y;
SlideData[nSlide].x4 = pWall3->wall_int_pos.X; SlideData[nSlide].x4 = pWall3->wall_int_pos().X;
SlideData[nSlide].y4 = pWall3->wall_int_pos.Y; SlideData[nSlide].y4 = pWall3->wall_int_pos().Y;
SlideData[nSlide].x5 = p2ndLastWall->wall_int_pos.X; SlideData[nSlide].x5 = p2ndLastWall->wall_int_pos().X;
SlideData[nSlide].y5 = p2ndLastWall->wall_int_pos.Y; SlideData[nSlide].y5 = p2ndLastWall->wall_int_pos().Y;
SlideData[nSlide].x6 = pWall4->wall_int_pos.X; SlideData[nSlide].x6 = pWall4->wall_int_pos().X;
SlideData[nSlide].y6 = pWall4->wall_int_pos.Y; SlideData[nSlide].y6 = pWall4->wall_int_pos().Y;
StartInterpolation(pStartWall, Interp_Wall_X); StartInterpolation(pStartWall, Interp_Wall_X);
StartInterpolation(pStartWall, Interp_Wall_Y); StartInterpolation(pStartWall, Interp_Wall_Y);
@ -1021,8 +1021,8 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p
SlideData[nSlide].pActor = pActor; SlideData[nSlide].pActor = pActor;
pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE;
pActor->spr.pos.X = pStartWall->wall_int_pos.X; pActor->spr.pos.X = pStartWall->wall_int_pos().X;
pActor->spr.pos.Y = pStartWall->wall_int_pos.Y; pActor->spr.pos.Y = pStartWall->wall_int_pos().Y;
pActor->spr.pos.Z = pSector->floorz; pActor->spr.pos.Z = pSector->floorz;
pActor->backuppos(); pActor->backuppos();
@ -1074,8 +1074,8 @@ void AISlide::Tick(RunListEvent* ev)
if (cx == 1) if (cx == 1)
{ {
auto pWall = SlideData[nSlide].pWall1; auto pWall = SlideData[nSlide].pWall1;
int x = pWall->wall_int_pos.X; int x = pWall->wall_int_pos().X;
int y = pWall->wall_int_pos.Y; int y = pWall->wall_int_pos().Y;
int nSeekA = LongSeek(&x, SlideData[nSlide].x5, 20, 20); int nSeekA = LongSeek(&x, SlideData[nSlide].x5, 20, 20);
int var_34 = nSeekA; int var_34 = nSeekA;
@ -1098,15 +1098,15 @@ void AISlide::Tick(RunListEvent* ev)
pWall = SlideData[nSlide].pStartWall; pWall = SlideData[nSlide].pStartWall;
y = pWall->wall_int_pos.Y + var_24; y = pWall->wall_int_pos().Y + var_24;
x = pWall->wall_int_pos.X + var_20; x = pWall->wall_int_pos().X + var_20;
dragpoint(SlideData[nSlide].pStartWall, x, y); dragpoint(SlideData[nSlide].pStartWall, x, y);
pWall = SlideData[nSlide].pWall3; pWall = SlideData[nSlide].pWall3;
x = pWall->wall_int_pos.X; x = pWall->wall_int_pos().X;
y = pWall->wall_int_pos.Y; y = pWall->wall_int_pos().Y;
int nSeekC = LongSeek(&x, SlideData[nSlide].x6, 20, 20); int nSeekC = LongSeek(&x, SlideData[nSlide].x6, 20, 20);
int var_30 = nSeekC; int var_30 = nSeekC;
@ -1124,16 +1124,16 @@ void AISlide::Tick(RunListEvent* ev)
pWall = SlideData[nSlide].pWall2; pWall = SlideData[nSlide].pWall2;
x = pWall->wall_int_pos.X + var_20; x = pWall->wall_int_pos().X + var_20;
y = pWall->wall_int_pos.Y + var_24; y = pWall->wall_int_pos().Y + var_24;
dragpoint(SlideData[nSlide].pWall2, x, y); dragpoint(SlideData[nSlide].pWall2, x, y);
} }
else if (cx == 0) // right branch else if (cx == 0) // right branch
{ {
auto pWall = SlideData[nSlide].pStartWall; auto pWall = SlideData[nSlide].pStartWall;
int x = pWall->wall_int_pos.X; int x = pWall->wall_int_pos().X;
int y = pWall->wall_int_pos.Y; int y = pWall->wall_int_pos().Y;
int nSeekA = LongSeek(&x, SlideData[nSlide].x1, 20, 20); int nSeekA = LongSeek(&x, SlideData[nSlide].x1, 20, 20);
int edi = nSeekA; int edi = nSeekA;
@ -1151,15 +1151,15 @@ void AISlide::Tick(RunListEvent* ev)
pWall = SlideData[nSlide].pWall1; pWall = SlideData[nSlide].pWall1;
y = pWall->wall_int_pos.Y + var_28; y = pWall->wall_int_pos().Y + var_28;
x = pWall->wall_int_pos.X + var_1C; x = pWall->wall_int_pos().X + var_1C;
dragpoint(SlideData[nSlide].pWall1, x, y); dragpoint(SlideData[nSlide].pWall1, x, y);
pWall = SlideData[nSlide].pWall2; pWall = SlideData[nSlide].pWall2;
x = pWall->wall_int_pos.X; x = pWall->wall_int_pos().X;
y = pWall->wall_int_pos.Y; y = pWall->wall_int_pos().Y;
int nSeekC = LongSeek(&x, SlideData[nSlide].x2, 20, 20); int nSeekC = LongSeek(&x, SlideData[nSlide].x2, 20, 20);
edi = nSeekC; edi = nSeekC;
@ -1177,8 +1177,8 @@ void AISlide::Tick(RunListEvent* ev)
pWall = SlideData[nSlide].pWall3; pWall = SlideData[nSlide].pWall3;
y = pWall->wall_int_pos.Y + var_28; y = pWall->wall_int_pos().Y + var_28;
x = pWall->wall_int_pos.X + var_1C; x = pWall->wall_int_pos().X + var_1C;
dragpoint(SlideData[nSlide].pWall3, x, y); dragpoint(SlideData[nSlide].pWall3, x, y);
} }
@ -1565,8 +1565,8 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector)
for(auto& wal : wallsofsector(pSector)) for(auto& wal : wallsofsector(pSector))
{ {
x += wal.wall_int_pos.X; x += wal.wall_int_pos().X;
y += wal.wall_int_pos.Y; y += wal.wall_int_pos().Y;
wal.picnum = kClockSymbol16; wal.picnum = kClockSymbol16;
wal.pal = 0; wal.pal = 0;
@ -2510,8 +2510,8 @@ void PostProcess()
if (&sect != &sectj && sectj.Speed && !(sect.Flag & kSectLava)) if (&sect != &sectj && sectj.Speed && !(sect.Flag & kSectLava))
{ {
int xVal = abs(sect.firstWall()->wall_int_pos.X - sectj.firstWall()->wall_int_pos.X); int xVal = abs(sect.firstWall()->wall_int_pos().X - sectj.firstWall()->wall_int_pos().X);
int yVal = abs(sect.firstWall()->wall_int_pos.Y - sectj.firstWall()->wall_int_pos.Y); int yVal = abs(sect.firstWall()->wall_int_pos().Y - sectj.firstWall()->wall_int_pos().Y);
if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20)) if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20))
{ {

View file

@ -675,7 +675,7 @@ void CheckAmbience(sectortype* sect)
walltype* pWall = pSector2->firstWall(); walltype* pWall = pSector2->firstWall();
if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0)) if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0))
{ {
vec3_t v = { pWall->wall_int_pos.X, pWall->wall_int_pos.Y, pSector2->floorz }; vec3_t v = { pWall->wall_int_pos().X, pWall->wall_int_pos().Y, pSector2->floorz };
amb = GetSoundPos(&v); amb = GetSoundPos(&v);
soundEngine->StartSound(SOURCE_Ambient, &amb, nullptr, CHAN_BODY, CHANF_TRANSIENT, sect->Sound + 1, 1.f, ATTN_NORM); soundEngine->StartSound(SOURCE_Ambient, &amb, nullptr, CHAN_BODY, CHANF_TRANSIENT, sect->Sound + 1, 1.f, ATTN_NORM);
return; return;
@ -690,7 +690,7 @@ void CheckAmbience(sectortype* sect)
} }
else else
{ {
vec3_t v = { pWall->wall_int_pos.X, pWall->wall_int_pos.Y, pSector2->floorz }; vec3_t v = { pWall->wall_int_pos().X, pWall->wall_int_pos().Y, pSector2->floorz };
amb = GetSoundPos(&v); amb = GetSoundPos(&v);
} }
return 1; return 1;

View file

@ -290,7 +290,7 @@ void AISWStepOn::TouchFloor(RunListEvent* ev)
if (var_14 != sRunChannels[nChannel].c) if (var_14 != sRunChannels[nChannel].c)
{ {
auto pWall = pSector->firstWall(); auto pWall = pSector->firstWall();
PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->wall_int_pos.X, pWall->wall_int_pos.Y, pSector->floorz); PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->wall_int_pos().X, pWall->wall_int_pos().Y, pSector->floorz);
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
@ -510,7 +510,7 @@ void AISWPressWall::Use(RunListEvent* ev)
auto pWall = SwitchData[nSwitch].pWall; auto pWall = SwitchData[nSwitch].pWall;
auto pSector = SwitchData[nSwitch].pSector; auto pSector = SwitchData[nSwitch].pSector;
PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->wall_int_pos.X, pWall->wall_int_pos.Y, 0, CHANF_LISTENERZ); PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->wall_int_pos().X, pWall->wall_int_pos().Y, 0, CHANF_LISTENERZ);
} }
END_PS_NS END_PS_NS

View file

@ -205,8 +205,8 @@ void JS_DrawMirrors(PLAYER* pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed
if (bIsWallMirror) if (bIsWallMirror)
{ {
j = abs(mirror[cnt].mirrorWall->wall_int_pos.X - tx); j = abs(mirror[cnt].mirrorWall->wall_int_pos().X - tx);
j += abs(mirror[cnt].mirrorWall->wall_int_pos.Y - ty); j += abs(mirror[cnt].mirrorWall->wall_int_pos().Y - ty);
if (j < dist) if (j < dist)
dist = j; dist = j;
} }
@ -233,8 +233,8 @@ void JS_DrawMirrors(PLAYER* pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed
auto wal = mirror[cnt].mirrorWall; auto wal = mirror[cnt].mirrorWall;
// Get wall midpoint for offset in mirror view // Get wall midpoint for offset in mirror view
midx = (wal->wall_int_pos.X + wal->point2Wall()->wall_int_pos.X) / 2; midx = (wal->wall_int_pos().X + wal->point2Wall()->wall_int_pos().X) / 2;
midy = (wal->wall_int_pos.Y + wal->point2Wall()->wall_int_pos.Y) / 2; midy = (wal->wall_int_pos().Y + wal->point2Wall()->wall_int_pos().Y) / 2;
// Finish finding offsets // Finish finding offsets
tdx = abs(midx - tx); tdx = abs(midx - tx);

View file

@ -735,8 +735,8 @@ int WallBreakPosition(walltype* wp, sectortype** sectp, int *x, int *y, int *z,
ASSERT(*sectp); ASSERT(*sectp);
// midpoint of wall // midpoint of wall
*x = (wp->wall_int_pos.X + wp->wall_int_pos.X) >> 1; *x = (wp->wall_int_pos().X + wp->wall_int_pos().X) >> 1;
*y = (wp->wall_int_pos.Y + wp->wall_int_pos.Y) >> 1; *y = (wp->wall_int_pos().Y + wp->wall_int_pos().Y) >> 1;
if (!wp->twoSided()) if (!wp->twoSided())
{ {

View file

@ -97,10 +97,10 @@ static int &getvalue(so_interp::interp_data& element, bool write)
{ {
case soi_wallx: case soi_wallx:
if (write) wall[index].moved(); if (write) wall[index].moved();
return wall[index].wall_int_pos.X; return wall[index].__wall_int_pos.X;
case soi_wally: case soi_wally:
if (write) wall[index].moved(); if (write) wall[index].moved();
return wall[index].wall_int_pos.Y; return wall[index].__wall_int_pos.Y;
case soi_ceil: case soi_ceil:
return *sector[index].ceilingzptr(!write); return *sector[index].ceilingzptr(!write);
case soi_floor: case soi_floor:

View file

@ -334,7 +334,7 @@ void JS_InitMirrors(void)
if (!Found_Cam) if (!Found_Cam)
{ {
Printf("Cound not find the camera view sprite for match %d\n", wal.hitag); Printf("Cound not find the camera view sprite for match %d\n", wal.hitag);
Printf("Map Coordinates: x = %d, y = %d\n", wal.wall_int_pos.X, wal.wall_int_pos.Y); Printf("Map Coordinates: x = %d, y = %d\n", wal.wall_int_pos().X, wal.wall_int_pos().Y);
break; break;
} }
@ -363,7 +363,7 @@ void JS_InitMirrors(void)
{ {
Printf("Did not find drawtotile for camera number %d\n", mirrorcnt); Printf("Did not find drawtotile for camera number %d\n", mirrorcnt);
Printf("wall(%d).hitag == %d\n", wallnum(&wal), wal.hitag); Printf("wall(%d).hitag == %d\n", wallnum(&wal), wal.hitag);
Printf("Map Coordinates: x = %d, y = %d\n", wal.wall_int_pos.X, wal.wall_int_pos.Y); Printf("Map Coordinates: x = %d, y = %d\n", wal.wall_int_pos().X, wal.wall_int_pos().Y);
RESET_BOOL1(mirror[mirrorcnt].cameraActor); RESET_BOOL1(mirror[mirrorcnt].cameraActor);
} }
} }
@ -512,8 +512,8 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio)
if (bIsWallMirror) if (bIsWallMirror)
{ {
j = abs(mirror[cnt].mirrorWall->wall_int_pos.X - tx); j = abs(mirror[cnt].mirrorWall->wall_int_pos().X - tx);
j += abs(mirror[cnt].mirrorWall->wall_int_pos.Y - ty); j += abs(mirror[cnt].mirrorWall->wall_int_pos().Y - ty);
if (j < dist) if (j < dist)
dist = j; dist = j;
} }
@ -538,8 +538,8 @@ void JS_DrawCameras(PLAYER* pp, int tx, int ty, int tz, double smoothratio)
auto wal = mirror[cnt].mirrorWall; auto wal = mirror[cnt].mirrorWall;
// Get wall midpoint for offset in mirror view // Get wall midpoint for offset in mirror view
midx = (wal->wall_int_pos.X + wal->point2Wall()->wall_int_pos.X) / 2; midx = (wal->wall_int_pos().X + wal->point2Wall()->wall_int_pos().X) / 2;
midy = (wal->wall_int_pos.Y + wal->point2Wall()->wall_int_pos.Y) / 2; midy = (wal->wall_int_pos().Y + wal->point2Wall()->wall_int_pos().Y) / 2;
// Finish finding offsets // Finish finding offsets
tdx = abs(midx - tx); tdx = abs(midx - tx);

View file

@ -2573,8 +2573,8 @@ void DoPlayerMoveVehicle(PLAYER* pp)
{ {
if (wal.extra && (wal.extra & (WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY)) == WALLFX_LOOP_OUTER) if (wal.extra && (wal.extra & (WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY)) == WALLFX_LOOP_OUTER)
{ {
x[count] = wal.wall_int_pos.X; x[count] = wal.wall_int_pos().X;
y[count] = wal.wall_int_pos.Y; y[count] = wal.wall_int_pos().Y;
ox[count] = sop->pmid.X - sop->xorig[wallcount]; ox[count] = sop->pmid.X - sop->xorig[wallcount];
oy[count] = sop->pmid.Y - sop->yorig[wallcount]; oy[count] = sop->pmid.Y - sop->yorig[wallcount];

View file

@ -124,7 +124,7 @@ void WallSetupDontMove(void)
{ {
for(auto& wal : wall) for(auto& wal : wall)
{ {
if (wal.wall_int_pos.X < jActor->spr.pos.X && wal.wall_int_pos.X > iActor->spr.pos.X && wal.wall_int_pos.Y < jActor->spr.pos.Y && wal.wall_int_pos.Y > iActor->spr.pos.Y) if (wal.wall_int_pos().X < jActor->spr.pos.X && wal.wall_int_pos().X > iActor->spr.pos.X && wal.wall_int_pos().Y < jActor->spr.pos.Y && wal.wall_int_pos().Y > iActor->spr.pos.Y)
{ {
wal.extra |= WALLFX_DONT_MOVE; wal.extra |= WALLFX_DONT_MOVE;
} }
@ -299,9 +299,9 @@ void WallSetup(void)
wall_num->extra |= WALLFX_DONT_STICK; wall_num->extra |= WALLFX_DONT_STICK;
if (!sw->type) if (!sw->type)
sw->orig_xy = wall_num->wall_int_pos.Y - (sw->range >> 2); sw->orig_xy = wall_num->wall_int_pos().Y - (sw->range >> 2);
else else
sw->orig_xy = wall_num->wall_int_pos.X - (sw->range >> 2); sw->orig_xy = wall_num->wall_int_pos().X - (sw->range >> 2);
sw->sintable_ndx = cnt * (2048 / num_points); sw->sintable_ndx = cnt * (2048 / num_points);
} }
@ -592,8 +592,8 @@ void SectorMidPoint(sectortype* sectp, int *xmid, int *ymid, int *zmid)
for(auto& wal : wallsofsector(sectp)) for(auto& wal : wallsofsector(sectp))
{ {
xsum += wal.wall_int_pos.X; xsum += wal.wall_int_pos().X;
ysum += wal.wall_int_pos.Y; ysum += wal.wall_int_pos().Y;
} }
*xmid = xsum / (sectp->wallnum); *xmid = xsum / (sectp->wallnum);
@ -2381,7 +2381,7 @@ void DoSineWaveFloor(void)
wal = sect->firstWall() + 2; wal = sect->firstWall() + 2;
//Pass (Sector, x, y, z) //Pass (Sector, x, y, z)
alignflorslope(sect,wal->wall_int_pos.X,wal->wall_int_pos.Y, wal->nextSector()->floorz); alignflorslope(sect,wal->wall_int_pos().X,wal->wall_int_pos().Y, wal->nextSector()->floorz);
} }
} }
} }
@ -2406,12 +2406,12 @@ void DoSineWaveWall(void)
if (!sw->type) if (!sw->type)
{ {
New = sw->orig_xy + MulScale(sw->range, bsin(sw->sintable_ndx), 14); New = sw->orig_xy + MulScale(sw->range, bsin(sw->sintable_ndx), 14);
dragpoint(wal, wal->wall_int_pos.X, New); dragpoint(wal, wal->wall_int_pos().X, New);
} }
else else
{ {
New = sw->orig_xy + MulScale(sw->range, bsin(sw->sintable_ndx), 14); New = sw->orig_xy + MulScale(sw->range, bsin(sw->sintable_ndx), 14);
dragpoint(wal, New, wal->wall_int_pos.Y); dragpoint(wal, New, wal->wall_int_pos().Y);
} }
} }
} }

View file

@ -274,17 +274,17 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt)
if (!wal->twoSided()) if (!wal->twoSided())
{ {
// white wall - move 4 points // white wall - move 4 points
wal->move(wal->wall_int_pos.X - amt, wal->wall_int_pos.Y); wal->move(wal->wall_int_pos().X - amt, wal->wall_int_pos().Y);
pwal->move(pwal->wall_int_pos.X - amt, pwal->wall_int_pos.Y); pwal->move(pwal->wall_int_pos().X - amt, pwal->wall_int_pos().Y);
wal->point2Wall()->move(wal->point2Wall()->wall_int_pos.X - amt, wal->point2Wall()->wall_int_pos.Y); wal->point2Wall()->move(wal->point2Wall()->wall_int_pos().X - amt, wal->point2Wall()->wall_int_pos().Y);
auto pwal2 = wal->point2Wall()->point2Wall(); auto pwal2 = wal->point2Wall()->point2Wall();
pwal2->move(pwal2->wall_int_pos.X - amt, pwal2->wall_int_pos.Y); pwal2->move(pwal2->wall_int_pos().X - amt, pwal2->wall_int_pos().Y);
} }
else else
{ {
// red wall - move 2 points // red wall - move 2 points
dragpoint(wal, wal->wall_int_pos.X - amt, wal->wall_int_pos.Y); dragpoint(wal, wal->wall_int_pos().X - amt, wal->wall_int_pos().Y);
dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos.X - amt, wal->point2Wall()->wall_int_pos.Y); dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos().X - amt, wal->point2Wall()->wall_int_pos().Y);
} }
break; break;
@ -299,17 +299,17 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt)
if (!wal->twoSided()) if (!wal->twoSided())
{ {
// white wall - move 4 points // white wall - move 4 points
wal->move(wal->wall_int_pos.X + amt, wal->wall_int_pos.Y); wal->move(wal->wall_int_pos().X + amt, wal->wall_int_pos().Y);
pwal->move(pwal->wall_int_pos.X + amt, pwal->wall_int_pos.Y); pwal->move(pwal->wall_int_pos().X + amt, pwal->wall_int_pos().Y);
wal->point2Wall()->move(wal->point2Wall()->wall_int_pos.X + amt, wal->point2Wall()->wall_int_pos.Y); wal->point2Wall()->move(wal->point2Wall()->wall_int_pos().X + amt, wal->point2Wall()->wall_int_pos().Y);
auto pwal2 = wal->point2Wall()->point2Wall(); auto pwal2 = wal->point2Wall()->point2Wall();
pwal2->move(pwal2->wall_int_pos.X + amt, pwal2->wall_int_pos.Y); pwal2->move(pwal2->wall_int_pos().X + amt, pwal2->wall_int_pos().Y);
} }
else else
{ {
// red wall - move 2 points // red wall - move 2 points
dragpoint(wal, wal->wall_int_pos.X + amt, wal->wall_int_pos.Y); dragpoint(wal, wal->wall_int_pos().X + amt, wal->wall_int_pos().Y);
dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos.X + amt, wal->point2Wall()->wall_int_pos.Y); dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos().X + amt, wal->point2Wall()->wall_int_pos().Y);
} }
break; break;
@ -323,16 +323,16 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt)
if (!wal->twoSided()) if (!wal->twoSided())
{ {
wal->move(wal->wall_int_pos.X, wal->wall_int_pos.Y - amt); wal->move(wal->wall_int_pos().X, wal->wall_int_pos().Y - amt);
pwal->move(pwal->wall_int_pos.X, pwal->wall_int_pos.Y - amt); pwal->move(pwal->wall_int_pos().X, pwal->wall_int_pos().Y - amt);
wal->point2Wall()->move(wal->point2Wall()->wall_int_pos.X, wal->point2Wall()->wall_int_pos.Y - amt); wal->point2Wall()->move(wal->point2Wall()->wall_int_pos().X, wal->point2Wall()->wall_int_pos().Y - amt);
auto pwal2 = wal->point2Wall()->point2Wall(); auto pwal2 = wal->point2Wall()->point2Wall();
pwal2->move(pwal2->wall_int_pos.X, pwal2->wall_int_pos.Y - amt); pwal2->move(pwal2->wall_int_pos().X, pwal2->wall_int_pos().Y - amt);
} }
else else
{ {
dragpoint(wal, wal->wall_int_pos.X, wal->wall_int_pos.Y - amt); dragpoint(wal, wal->wall_int_pos().X, wal->wall_int_pos().Y - amt);
dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos.X, wal->point2Wall()->wall_int_pos.Y - amt); dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos().X, wal->point2Wall()->wall_int_pos().Y - amt);
} }
break; break;
@ -346,16 +346,16 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt)
if (!wal->twoSided()) if (!wal->twoSided())
{ {
wal->move(wal->wall_int_pos.X, wal->wall_int_pos.Y + amt); wal->move(wal->wall_int_pos().X, wal->wall_int_pos().Y + amt);
pwal->move(pwal->wall_int_pos.X, pwal->wall_int_pos.Y + amt); pwal->move(pwal->wall_int_pos().X, pwal->wall_int_pos().Y + amt);
wal->point2Wall()->move(wal->point2Wall()->wall_int_pos.X, wal->point2Wall()->wall_int_pos.Y + amt); wal->point2Wall()->move(wal->point2Wall()->wall_int_pos().X, wal->point2Wall()->wall_int_pos().Y + amt);
auto pwal2 = wal->point2Wall()->point2Wall(); auto pwal2 = wal->point2Wall()->point2Wall();
pwal2->move(pwal2->wall_int_pos.X, pwal2->wall_int_pos.Y + amt); pwal2->move(pwal2->wall_int_pos().X, pwal2->wall_int_pos().Y + amt);
} }
else else
{ {
dragpoint(wal, wal->wall_int_pos.X, wal->wall_int_pos.Y + amt); dragpoint(wal, wal->wall_int_pos().X, wal->wall_int_pos().Y + amt);
dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos.X, wal->point2Wall()->wall_int_pos.Y + amt); dragpoint(wal->point2Wall(), wal->point2Wall()->wall_int_pos().X, wal->point2Wall()->wall_int_pos().Y + amt);
} }
@ -382,22 +382,22 @@ int DoSlidorInstantClose(DSWActor* actor)
switch (wal->lotag) switch (wal->lotag)
{ {
case TAG_WALL_SLIDOR_LEFT: case TAG_WALL_SLIDOR_LEFT:
diff = wal->wall_int_pos.X - actor->spr.pos.X; diff = wal->wall_int_pos().X - actor->spr.pos.X;
DoSlidorMoveWalls(actor, diff); DoSlidorMoveWalls(actor, diff);
break; break;
case TAG_WALL_SLIDOR_RIGHT: case TAG_WALL_SLIDOR_RIGHT:
diff = wal->wall_int_pos.X - actor->spr.pos.X; diff = wal->wall_int_pos().X - actor->spr.pos.X;
DoSlidorMoveWalls(actor, -diff); DoSlidorMoveWalls(actor, -diff);
break; break;
case TAG_WALL_SLIDOR_UP: case TAG_WALL_SLIDOR_UP:
diff = wal->wall_int_pos.Y - actor->spr.pos.Y; diff = wal->wall_int_pos().Y - actor->spr.pos.Y;
DoSlidorMoveWalls(actor, diff); DoSlidorMoveWalls(actor, diff);
break; break;
case TAG_WALL_SLIDOR_DOWN: case TAG_WALL_SLIDOR_DOWN:
diff = wal->wall_int_pos.Y - actor->spr.pos.Y; diff = wal->wall_int_pos().Y - actor->spr.pos.Y;
DoSlidorMoveWalls(actor, -diff); DoSlidorMoveWalls(actor, -diff);
break; break;
} }

View file

@ -1454,7 +1454,7 @@ void PreMapCombineFloors(void)
for (auto& wal : wallsofsector(dasect)) for (auto& wal : wallsofsector(dasect))
{ {
wal.move(wal.wall_int_pos.X + dx, wal.wall_int_pos.Y + dy); wal.move(wal.wall_int_pos().X + dx, wal.wall_int_pos().Y + dy);
if (wal.twoSided()) if (wal.twoSided())
search.Add(wal.nextSector()); search.Add(wal.nextSector());
@ -2125,8 +2125,8 @@ void SpriteSetup(void)
wallcount = 0; wallcount = 0;
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : wallsofsector(actor->sector()))
{ {
actor->user.rotator->origX[wallcount] = wal.wall_int_pos.X; actor->user.rotator->origX[wallcount] = wal.wall_int_pos().X;
actor->user.rotator->origY[wallcount] = wal.wall_int_pos.Y; actor->user.rotator->origY[wallcount] = wal.wall_int_pos().Y;
wallcount++; wallcount++;
} }

View file

@ -754,7 +754,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
for(auto& wal : wallsofsector(sect)) for(auto& wal : wallsofsector(sect))
{ {
// all walls have to be in bounds to be in sector object // all walls have to be in bounds to be in sector object
if (!(wal.wall_int_pos.X > xlow && wal.wall_int_pos.X < xhigh && wal.wall_int_pos.Y > ylow && wal.wall_int_pos.Y < yhigh)) if (!(wal.wall_int_pos().X > xlow && wal.wall_int_pos().X < xhigh && wal.wall_int_pos().Y > ylow && wal.wall_int_pos().Y < yhigh))
{ {
SectorInBounds = false; SectorInBounds = false;
break; break;
@ -1400,8 +1400,8 @@ void PlaceSectorObjectsOnTracks(void)
// move all walls in sectors // move all walls in sectors
for (auto& wal : wallsofsector(sop->sectp[j])) for (auto& wal : wallsofsector(sop->sectp[j]))
{ {
sop->xorig[sop->num_walls] = sop->pmid.X - wal.wall_int_pos.X; sop->xorig[sop->num_walls] = sop->pmid.X - wal.wall_int_pos().X;
sop->yorig[sop->num_walls] = sop->pmid.Y - wal.wall_int_pos.Y; sop->yorig[sop->num_walls] = sop->pmid.Y - wal.wall_int_pos().Y;
sop->num_walls++; sop->num_walls++;
} }
} }
@ -1623,11 +1623,11 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
if (wal.extra && (wal.extra & WALLFX_LOOP_OUTER)) if (wal.extra && (wal.extra & WALLFX_LOOP_OUTER))
{ {
dragpoint(&wal, wal.wall_int_pos.X + nx, wal.wall_int_pos.Y + ny); dragpoint(&wal, wal.wall_int_pos().X + nx, wal.wall_int_pos().Y + ny);
} }
else else
{ {
wal.move(wal.wall_int_pos.X + nx, wal.wall_int_pos.Y + ny); wal.move(wal.wall_int_pos().X + nx, wal.wall_int_pos().Y + ny);
} }
rot_ang = delta_ang; rot_ang = delta_ang;
@ -1641,7 +1641,7 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
if ((wal.extra & WALLFX_LOOP_SPIN_4X)) if ((wal.extra & WALLFX_LOOP_SPIN_4X))
rot_ang = NORM_ANGLE(rot_ang * 4); rot_ang = NORM_ANGLE(rot_ang * 4);
rotatepoint(sop->pmid.vec2, wal.wall_int_pos, rot_ang, &rxy); rotatepoint(sop->pmid.vec2, wal.wall_int_pos(), rot_ang, &rxy);
if (wal.extra && (wal.extra & WALLFX_LOOP_OUTER)) if (wal.extra && (wal.extra & WALLFX_LOOP_OUTER))
{ {

View file

@ -100,7 +100,7 @@ int DoWallMove(DSWActor* actor)
for(auto& wal : wall) for(auto& wal : wall)
{ {
if (wal.wall_int_pos.X == actor->spr.pos.X && wal.wall_int_pos.Y == actor->spr.pos.Y) if (wal.wall_int_pos().X == actor->spr.pos.X && wal.wall_int_pos().Y == actor->spr.pos.Y)
{ {
found = true; found = true;

View file

@ -7166,8 +7166,8 @@ void TraverseBreakableWalls(sectortype* start_sect, int x, int y, int z, short a
if (wal.lotag == TAG_WALL_BREAK) if (wal.lotag == TAG_WALL_BREAK)
{ {
// find midpoint // find midpoint
xmid = (wal.wall_int_pos.X + wal.point2Wall()->wall_int_pos.X) >> 1; xmid = (wal.wall_int_pos().X + wal.point2Wall()->wall_int_pos().X) >> 1;
ymid = (wal.wall_int_pos.Y + wal.point2Wall()->wall_int_pos.Y) >> 1; ymid = (wal.wall_int_pos().Y + wal.point2Wall()->wall_int_pos().Y) >> 1;
// don't need to go further if wall is too far out // don't need to go further if wall is too far out