From 09e00a69fe51c651a961014de6d2f5b34a34537d Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 22 Dec 2021 21:06:32 +1100 Subject: [PATCH] - Replace `walltype` `y` with `pos.Y` calls and eliminate `walltype` `pos` union. --- source/build/src/clip.cpp | 20 +++---- source/build/src/engine.cpp | 4 +- source/build/src/polymost.cpp | 46 ++++++++-------- source/core/automap.cpp | 12 ++--- source/core/gamefuncs.cpp | 6 +-- source/core/gamefuncs.h | 14 ++--- source/core/interpolate.cpp | 4 +- source/core/maptypes.h | 8 +-- source/core/rendering/hw_sections.cpp | 2 +- .../core/rendering/scene/hw_bunchdrawer.cpp | 8 +-- source/core/rendering/scene/hw_drawinfo.cpp | 8 +-- source/core/rendering/scene/hw_portal.cpp | 16 +++--- source/core/rendering/scene/hw_walls.cpp | 8 +-- source/core/savegamehelp.cpp | 2 +- source/core/sectorgeometry.cpp | 8 +-- source/games/blood/src/_polymost.cpp | 10 ++-- source/games/blood/src/actor.cpp | 2 +- source/games/blood/src/db.cpp | 2 +- source/games/blood/src/gameutil.cpp | 10 ++-- source/games/blood/src/gib.cpp | 6 +-- source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/triggers.cpp | 8 +-- source/games/duke/src/_polymost.cpp | 2 +- source/games/duke/src/actors.cpp | 4 +- source/games/duke/src/actors_d.cpp | 12 ++--- source/games/duke/src/actors_lava.cpp | 34 ++++++------ source/games/duke/src/actors_r.cpp | 12 ++--- source/games/duke/src/gameexec.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/duke/src/sectors.cpp | 22 ++++---- source/games/duke/src/sectors_d.cpp | 2 +- source/games/duke/src/sectors_r.cpp | 18 +++---- source/games/duke/src/spawn.cpp | 14 ++--- source/games/exhumed/src/init.cpp | 6 +-- source/games/exhumed/src/move.cpp | 6 +-- source/games/exhumed/src/object.cpp | 42 +++++++-------- source/games/exhumed/src/sound.cpp | 4 +- source/games/exhumed/src/switch.cpp | 4 +- source/games/sw/src/_polymost.cpp | 4 +- source/games/sw/src/break.cpp | 2 +- source/games/sw/src/interpso.cpp | 2 +- source/games/sw/src/jsector.cpp | 8 +-- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/sector.cpp | 10 ++-- source/games/sw/src/slidor.cpp | 52 +++++++++---------- source/games/sw/src/sprite.cpp | 4 +- source/games/sw/src/track.cpp | 8 +-- source/games/sw/src/wallmove.cpp | 2 +- source/games/sw/src/weapon.cpp | 2 +- 49 files changed, 242 insertions(+), 246 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index ed38d121e..a37e0425b 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -113,8 +113,8 @@ int clipinsidebox(vec2_t *vect, int wallnum, int walldist) auto const wal1 = (uwallptr_t)&wall[wallnum]; auto const wal2 = (uwallptr_t)wal1->point2Wall(); - vec2_t const v1 = { wal1->pos.X + walldist - vect->X, wal1->y + walldist - vect->Y }; - vec2_t v2 = { wal2->pos.X + walldist - vect->X, wal2->y + walldist - vect->Y }; + vec2_t const v1 = { wal1->pos.X + walldist - vect->X, wal1->pos.Y + walldist - vect->Y }; + vec2_t v2 = { wal2->pos.X + walldist - vect->X, wal2->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))) return 0; @@ -508,7 +508,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, auto const wal2 = (uwallptr_t)wal->point2Wall(); if ((wal->pos.X < clipMin.X && wal2->pos.X < clipMin.X) || (wal->pos.X > clipMax.X && wal2->pos.X > clipMax.X) || - (wal->y < clipMin.Y && wal2->y < clipMin.Y) || (wal->y > clipMax.Y && wal2->y > clipMax.Y)) + (wal->pos.Y < clipMin.Y && wal2->pos.Y < clipMin.Y) || (wal->pos.Y > clipMax.Y && wal2->pos.Y > clipMax.Y)) continue; vec2_t p1 = wal->pos; @@ -969,8 +969,8 @@ int pushmove_(vec3_t *const vect, int *const sectnum, { //Find closest point on wall (dax, day) to (vect->x, vect->y) int32_t dax = wal->point2Wall()->pos.X-wal->pos.X; - int32_t day = wal->point2Wall()->y-wal->y; - int32_t daz = dax*((vect->X)-wal->pos.X) + day*((vect->Y)-wal->y); + int32_t day = wal->point2Wall()->pos.Y-wal->pos.Y; + int32_t daz = dax*((vect->X)-wal->pos.X) + day*((vect->Y)-wal->pos.Y); int32_t t; if (daz <= 0) t = 0; @@ -980,7 +980,7 @@ int pushmove_(vec3_t *const vect, int *const sectnum, if (daz >= daz2) t = (1<<30); else t = DivScale(daz, daz2, 30); } dax = wal->pos.X + MulScale(dax, t, 30); - day = wal->y + MulScale(day, t, 30); + day = wal->pos.Y + MulScale(day, t, 30); closest = { dax, day }; } @@ -990,7 +990,7 @@ int pushmove_(vec3_t *const vect, int *const sectnum, if (j != 0) { - j = getangle(wal->point2Wall()->pos.X-wal->pos.X, wal->point2Wall()->y-wal->y); + j = getangle(wal->point2Wall()->pos.X-wal->pos.X, wal->point2Wall()->pos.Y-wal->pos.Y); int32_t dx = -bsin(j, -11); int32_t dy = bcos(j, -11); int bad2 = 16; @@ -1282,7 +1282,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase { auto const wal = (uwallptr_t)sec->firstWall(); auto const wal2 = (uwallptr_t)wal->point2Wall(); - int32_t j, dax=wal2->pos.X-wal->pos.X, day=wal2->y-wal->y; + int32_t j, dax=wal2->pos.X-wal->pos.X, day=wal2->pos.Y-wal->pos.Y; i = ksqrt(compat_maybe_truncate_to_int32(uhypsq(dax,day))); if (i == 0) return 1; //continue; i = DivScale(heinum,i, 15); @@ -1291,7 +1291,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase j = (vz<<8)-DMulScale(dax,vy,-day,vx, 15); if (j != 0) { - i = ((z - sv->Z)<<8)+DMulScale(dax,sv->Y-wal->y,-day,sv->X-wal->pos.X, 15); + i = ((z - sv->Z)<<8)+DMulScale(dax,sv->Y-wal->pos.Y,-day,sv->X-wal->pos.X, 15); if (((i^j) >= 0) && ((abs(i)>>1) < abs(j))) { i = DivScale(i,j, 30); @@ -1366,7 +1366,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire auto const nextsect = wal->nextSector(); if (curspr && !wal->twoSided()) continue; - x1 = wal->pos.X; y1 = wal->y; x2 = wal2->pos.X; y2 = wal2->y; + x1 = wal->pos.X; y1 = wal->pos.Y; x2 = wal2->pos.X; y2 = wal2->pos.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; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index d80f6758f..5ef7a3ff4 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -486,7 +486,7 @@ int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, se { auto const wal2 = (uwallptr_t)wal->point2Wall(); const int32_t x31 = wal->pos.X-x1, x34 = wal->pos.X-wal2->pos.X; - const int32_t y31 = wal->y-y1, y34 = wal->y-wal2->y; + const int32_t y31 = wal->pos.Y-y1, y34 = wal->pos.Y-wal2->pos.Y; int32_t x, y, z, t, bot; int32_t cfz[2]; @@ -554,7 +554,7 @@ void neartag(const vec3_t& sv, sectortype* sect, int ange, HitInfoBase& result, auto const wal2 = (uwallptr_t)wal->point2Wall(); const auto nextsect = wal->nextSector(); - const int32_t x1 = wal->pos.X, y1 = wal->y, x2 = wal2->pos.X, y2 = wal2->y; + const int32_t x1 = wal->pos.X, y1 = wal->pos.Y, x2 = wal2->pos.X, y2 = wal2->pos.Y; int32_t intx, inty, intz, good = 0; if (wal->twoSided()) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 633b162ba..e76003e8b 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -1018,8 +1018,8 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0 FVector2 const fxy = { xy.X*r, xy.Y*r }; - ft[0] = ((float)(globalposx - sec->firstWall()->pos.X)) * fxy.X + ((float)(globalposy - sec->firstWall()->y)) * fxy.Y; - ft[1] = ((float)(globalposy - sec->firstWall()->y)) * fxy.X - ((float)(globalposx - sec->firstWall()->pos.X)) * fxy.Y; + ft[0] = ((float)(globalposx - sec->firstWall()->pos.X)) * fxy.X + ((float)(globalposy - sec->firstWall()->pos.Y)) * fxy.Y; + ft[1] = ((float)(globalposy - sec->firstWall()->pos.Y)) * fxy.X - ((float)(globalposx - sec->firstWall()->pos.X)) * fxy.Y; ft[2] = fcosglobalang * fxy.X + fsinglobalang * fxy.Y; ft[3] = fsinglobalang * fxy.X - fcosglobalang * fxy.Y; @@ -1218,8 +1218,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) { - vec2_t const w = { wall[dawall].pos.X, wall[dawall].y }; - vec2_t const d = { POINT2(dawall).pos.X - w.X, POINT2(dawall).y - w.Y }; + vec2_t const w = { wall[dawall].pos.X, wall[dawall].pos.Y }; + vec2_t const d = { POINT2(dawall).pos.X - w.X, POINT2(dawall).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) @@ -1483,13 +1483,13 @@ static void polymost_drawalls(int32_t const bunch) auto const nextsec = nextsectnum>=0 ? (usectorptr_t)§or[nextsectnum] : NULL; //Offset&Rotate 3D coordinates to screen 3D space - FVector2 walpos = { (float)(wal->pos.X-globalposx), (float)(wal->y-globalposy) }; + FVector2 walpos = { (float)(wal->pos.X-globalposx), (float)(wal->pos.Y-globalposy) }; FVector2 p0 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 }; FVector2 const op0 = p0; walpos = { (float)(wal2->pos.X - globalposx), - (float)(wal2->y - globalposy) }; + (float)(wal2->pos.Y - globalposy) }; FVector2 p1 = { walpos.Y * gcosang - walpos.X * gsinang, walpos.X * gcosang2 + walpos.Y * gsinang2 }; @@ -1504,12 +1504,12 @@ static void polymost_drawalls(int32_t const bunch) t0 = (SCISDIST-p0.Y)/(p1.Y-p0.Y); p0 = { (p1.X-p0.X)*t0+p0.X, SCISDIST }; n0 = { (wal2->pos.X-wal->pos.X)*t0+wal->pos.X, - (wal2->y-wal->y)*t0+wal->y }; + (wal2->pos.Y-wal->pos.Y)*t0+wal->pos.Y }; } else { t0 = 0.f; - n0 = { (float)wal->pos.X, (float)wal->y }; + n0 = { (float)wal->pos.X, (float)wal->pos.Y }; } if (p1.Y < SCISDIST) @@ -1517,12 +1517,12 @@ static void polymost_drawalls(int32_t const bunch) t1 = (SCISDIST-op0.Y)/(p1.Y-op0.Y); p1 = { (p1.X-op0.X)*t1+op0.X, SCISDIST }; n1 = { (wal2->pos.X-wal->pos.X)*t1+wal->pos.X, - (wal2->y-wal->y)*t1+wal->y }; + (wal2->pos.Y-wal->pos.Y)*t1+wal->pos.Y }; } else { t1 = 1.f; - n1 = { (float)wal2->pos.X, (float)wal2->y }; + n1 = { (float)wal2->pos.X, (float)wal2->pos.Y }; } float ryp0 = 1.f/p0.Y, ryp1 = 1.f/p1.Y; @@ -1913,8 +1913,8 @@ void polymost_scansector(int32_t sectnum) { auto const wal2 = (uwallptr_t)wal->point2Wall(); - DVector2 const fp1 = { double(wal->pos.X - globalposx), double(wal->y - globalposy) }; - DVector2 const fp2 = { double(wal2->pos.X - globalposx), double(wal2->y - globalposy) }; + DVector2 const fp1 = { double(wal->pos.X - globalposx), double(wal->pos.Y - globalposy) }; + DVector2 const fp2 = { double(wal2->pos.X - globalposx), double(wal2->pos.Y - globalposy) }; int const nextsectnum = wal->nextsector; //Scan close sectors @@ -2315,10 +2315,10 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex) globalshade = (int32_t)wal->shade; globalfloorpal = globalpal = (int32_t)((uint8_t)wal->pal); - FVector2 s0 = { (float)(wal->pos.X-globalposx), (float)(wal->y-globalposy) }; + FVector2 s0 = { (float)(wal->pos.X-globalposx), (float)(wal->pos.Y-globalposy) }; FVector2 p0 = { s0.Y*gcosang - s0.X*gsinang, s0.X*gcosang2 + s0.Y*gsinang2 }; - FVector2 s1 = { (float)(wal2->pos.X-globalposx), (float)(wal2->y-globalposy) }; + FVector2 s1 = { (float)(wal2->pos.X-globalposx), (float)(wal2->pos.Y-globalposy) }; FVector2 p1 = { s1.Y*gcosang - s1.X*gsinang, s1.X*gcosang2 + s1.Y*gsinang2 }; if ((p0.Y < SCISDIST) && (p1.Y < SCISDIST)) return; @@ -2343,12 +2343,12 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex) } int32_t m0 = (int32_t)((wal2->pos.X - wal->pos.X) * t0 + wal->pos.X); - int32_t m1 = (int32_t)((wal2->y - wal->y) * t0 + wal->y); + int32_t m1 = (int32_t)((wal2->pos.Y - wal->pos.Y) * t0 + wal->pos.Y); int32_t cz[4], fz[4]; getzsofslopeptr(sec, m0, m1, &cz[0], &fz[0]); getzsofslopeptr(wal->nextSector(), m0, m1, &cz[1], &fz[1]); m0 = (int32_t)((wal2->pos.X - wal->pos.X) * t1 + wal->pos.X); - m1 = (int32_t)((wal2->y - wal->y) * t1 + wal->y); + m1 = (int32_t)((wal2->pos.Y - wal->pos.Y) * t1 + wal->pos.Y); getzsofslopeptr(sec, m0, m1, &cz[2], &fz[2]); getzsofslopeptr(wal->nextSector(), m0, m1, &cz[3], &fz[3]); @@ -2890,11 +2890,11 @@ void polymost_drawsprite(int32_t snum) 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].pos.X + POINT2(w).pos.X) || - ((pos.Y - v.Y) + (pos.Y + v.Y)) == (wall[w].y + POINT2(w).y) || - polymost_lintersect(pos.X - v.X, pos.Y - v.Y, pos.X + v.X, pos.Y + v.Y, wall[w].pos.X, wall[w].y, - POINT2(w).pos.X, POINT2(w).y)) + ((pos.Y - v.Y) + (pos.Y + v.Y)) == (wall[w].pos.Y + POINT2(w).pos.Y) || + polymost_lintersect(pos.X - v.X, pos.Y - v.Y, pos.X + v.X, pos.Y + v.Y, wall[w].pos.X, wall[w].pos.Y, + POINT2(w).pos.X, POINT2(w).pos.Y)) { - int32_t const ang = getangle(wall[w].pos.X - POINT2(w).pos.X, wall[w].y - POINT2(w).y); + int32_t const ang = getangle(wall[w].pos.X - POINT2(w).pos.X, wall[w].pos.Y - POINT2(w).pos.Y); float const foffs = TSPR_OFFSET(tspr); DVector2 const offs = { -bsinf(ang, -6) * foffs, bcosf(ang, -6) * foffs }; @@ -3260,7 +3260,7 @@ void renderPrepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, f int32_t* tposx, int32_t* tposy, fixed_t* tang) { const int32_t x = wall[dawall].pos.X, dx = wall[dawall].point2Wall()->pos.X - x; - const int32_t y = wall[dawall].y, dy = wall[dawall].point2Wall()->y - y; + const int32_t y = wall[dawall].pos.Y, dy = wall[dawall].point2Wall()->pos.Y - y; const int32_t j = dx * dx + dy * dy; if (j == 0) @@ -3639,8 +3639,8 @@ void renderDrawMasks(void) maskwallcnt--; - FVector2 dot = { (float)wall[w].pos.X, (float)wall[w].y }; - FVector2 dot2 = { (float)wall[w].point2Wall()->pos.X, (float)wall[w].point2Wall()->y }; + FVector2 dot = { (float)wall[w].pos.X, (float)wall[w].pos.Y }; + FVector2 dot2 = { (float)wall[w].point2Wall()->pos.X, (float)wall[w].point2Wall()->pos.Y }; FVector2 middle = { (dot.X + dot2.X) * .5f, (dot.Y + dot2.Y) * .5f }; _equation maskeq = equation(dot.X, dot.Y, dot2.X, dot2.Y); diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 21554eedd..90845cafb 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -171,9 +171,9 @@ static void CalcMapBounds() { // get map min and max coordinates if (wal.pos.X < x_min_bound) x_min_bound = wal.pos.X; - if (wal.y < y_min_bound) y_min_bound = wal.y; + if (wal.pos.Y < y_min_bound) y_min_bound = wal.pos.Y; if (wal.pos.X > x_max_bound) x_max_bound = wal.pos.X; - if (wal.y > y_max_bound) y_max_bound = wal.y; + if (wal.pos.Y > y_max_bound) y_max_bound = wal.pos.Y; } } @@ -435,13 +435,13 @@ void drawredlines(int cposx, int cposy, int czoom, int cang) if (ShowRedLine(wallnum(&wal), i)) { int ox = wal.pos.X - cposx; - int oy = wal.y - cposy; + int oy = wal.pos.Y - cposy; int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); auto wal2 = wal.point2Wall(); ox = wal2->pos.X - cposx; - oy = wal2->y - cposy; + oy = wal2->pos.Y - cposy; int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); @@ -477,14 +477,14 @@ static void drawwhitelines(int cposx, int cposy, int czoom, int cang) continue; int ox = wal.pos.X - cposx; - int oy = wal.y - cposy; + int oy = wal.pos.Y - cposy; int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); int k = wal.point2; auto wal2 = &wall[k]; ox = wal2->pos.X - cposx; - oy = wal2->y - cposy; + oy = wal2->pos.Y - cposy; int x2 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int y2 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index 2664ac4f2..b9691c79e 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -67,7 +67,7 @@ bool calcChaseCamPos(int* px, int* py, int* pz, spritetype* pspr, sectortype** p // Push you a little bit off the wall *psect = hitinfo.hitSector; daang = bvectangbam(hitinfo.hitWall->point2Wall()->pos.X - hitinfo.hitWall->pos.X, - hitinfo.hitWall->point2Wall()->y - hitinfo.hitWall->y); + hitinfo.hitWall->point2Wall()->pos.Y - hitinfo.hitWall->pos.Y); newdist = nx * daang.bsin() + ny * -daang.bcos(); if (abs(nx) > abs(ny)) @@ -169,7 +169,7 @@ void calcSlope(const sectortype* sec, float xpos, float ypos, float* pceilz, flo int len = wal->Length(); if (len != 0) { - float fac = (wal->deltax() * (float(ypos - wal->y)) - wal->deltay() * (float(xpos - wal->pos.X))) * (1.f / 256.f) / len; + float fac = (wal->deltax() * (float(ypos - wal->pos.Y)) - wal->deltay() * (float(xpos - wal->pos.X))) * (1.f / 256.f) / len; if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * fac); if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * fac); } @@ -227,7 +227,7 @@ int getslopeval(sectortype* sect, int x, int y, int z, int basez) { auto wal = sect->firstWall(); auto delta = wal->delta(); - int i = (y - wal->y) * delta.X - (x - wal->pos.X) * delta.Y; + int i = (y - wal->pos.Y) * delta.X - (x - wal->pos.X) * delta.Y; return i == 0? 0 : Scale((z - basez) << 8, wal->Length(), i); } diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index ef5ef2ccd..26a81e662 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -151,7 +151,7 @@ inline double WallStartX(int wallnum) inline double WallStartY(int wallnum) { - return wall[wallnum].y * (1 / -16.); + return wall[wallnum].pos.Y * (1 / -16.); } inline double WallEndX(int wallnum) @@ -161,7 +161,7 @@ inline double WallEndX(int wallnum) inline double WallEndY(int wallnum) { - return wall[wallnum].point2Wall()->y * (1 / -16.); + return wall[wallnum].point2Wall()->pos.Y * (1 / -16.); } inline double WallStartX(const walltype* wallnum) @@ -171,7 +171,7 @@ inline double WallStartX(const walltype* wallnum) inline double WallStartY(const walltype* wallnum) { - return wallnum->y * (1 / -16.); + return wallnum->pos.Y * (1 / -16.); } inline DVector2 WallStart(const walltype* wallnum) @@ -186,7 +186,7 @@ inline double WallEndX(const walltype* wallnum) inline double WallEndY(const walltype* wallnum) { - return wallnum->point2Wall()->y * (1 / -16.); + return wallnum->point2Wall()->pos.Y * (1 / -16.); } inline DVector2 WallEnd(const walltype* wallnum) @@ -290,7 +290,7 @@ inline int32_t getangle(walltype* wal) { return getangle( wal->point2Wall()->pos.X - wal->pos.X, - wal->point2Wall()->y - wal->y); + wal->point2Wall()->pos.Y - wal->pos.Y); } inline TArrayView wallsofsector(const sectortype* sec) @@ -324,9 +324,9 @@ inline double SquareDist(double lx1, double ly1, double lx2, double ly2) inline double SquareDistToWall(double px, double py, const walltype* wal) { double lx1 = wal->pos.X; - double ly1 = wal->y; + double ly1 = wal->pos.Y; double lx2 = wal->point2Wall()->pos.X; - double ly2 = wal->point2Wall()->y; + double ly2 = wal->point2Wall()->pos.Y; double wall_length = SquareDist(lx1, ly1, lx2, ly2); diff --git a/source/core/interpolate.cpp b/source/core/interpolate.cpp index bb35e786e..0f40cce3b 100644 --- a/source/core/interpolate.cpp +++ b/source/core/interpolate.cpp @@ -50,7 +50,7 @@ double Get(int index, int type) case Interp_Sect_CeilingPanY: return sector[index].ceilingypan_; case Interp_Wall_X: return wall[index].pos.X; - case Interp_Wall_Y: return wall[index].y; + case Interp_Wall_Y: return wall[index].pos.Y; case Interp_Wall_PanX: return wall[index].xpan_; case Interp_Wall_PanY: return wall[index].ypan_; @@ -73,7 +73,7 @@ void Set(int index, int type, double val) case Interp_Sect_CeilingPanY: sector[index].ceilingypan_ = float(val); break; case Interp_Wall_X: old = wall[index].pos.X; wall[index].pos.X = xs_CRoundToInt(val); if (wall[index].pos.X != old) wall[index].moved(); break; - case Interp_Wall_Y: old = wall[index].y; wall[index].y = xs_CRoundToInt(val); if (wall[index].y != old) wall[index].moved(); break; + case Interp_Wall_Y: old = wall[index].pos.Y; wall[index].pos.Y = xs_CRoundToInt(val); if (wall[index].pos.Y != old) wall[index].moved(); break; case Interp_Wall_PanX: wall[index].xpan_ = float(val); break; case Interp_Wall_PanY: wall[index].ypan_ = float(val); break; } diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 4847b1f0c..04e18695e 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -311,11 +311,7 @@ struct sectortype struct walltype { - // todo: get rid of the single variables! - union { - struct { int32_t BLAHBLAHX, y; }; - vec2_t pos; - }; + vec2_t pos; int32_t point2; int32_t nextwall; @@ -364,7 +360,7 @@ struct walltype vec2_t delta() const { return point2Wall()->pos - pos; } vec2_t center() const { return(point2Wall()->pos + pos) / 2; } int deltax() const { return point2Wall()->pos.X - pos.X; } - int deltay() const { return point2Wall()->y - y; } + int deltay() const { return point2Wall()->pos.Y - pos.Y; } bool twoSided() const { return nextsector >= 0; } int Length(); void calcLength(); // this is deliberately not inlined and stored in a file where it can't be found at compile time. diff --git a/source/core/rendering/hw_sections.cpp b/source/core/rendering/hw_sections.cpp index 77a2e2b59..8b2ab2590 100644 --- a/source/core/rendering/hw_sections.cpp +++ b/source/core/rendering/hw_sections.cpp @@ -244,7 +244,7 @@ static void CollectLoops(TArray& sectors) { // 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. - if (ww > 1 && wall[ww-1].pos.X == wall[ww-2].pos.X && wall[ww-1].y == wall[ww-2].y && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww) + if (ww > 1 && wall[ww-1].pos.X == wall[ww-2].pos.X && wall[ww-1].pos.Y == wall[ww-2].pos.Y && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww) { thisloop.Clear(); break; diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index ce3cb405c..2525092d1 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -167,11 +167,11 @@ bool BunchDrawer::CheckClip(walltype* wal, float* topclip, float* bottomclip) // Mirrors and horizons always block the view //if (linedef->special==Line_Mirror || linedef->special==Line_Horizon) return true; - PlanesAtPoint(frontsector, wal->pos.X, wal->y, &fs_ceilingheight1, &fs_floorheight1); - PlanesAtPoint(frontsector, pt2->pos.X, pt2->y, &fs_ceilingheight2, &fs_floorheight2); + PlanesAtPoint(frontsector, wal->pos.X, wal->pos.Y, &fs_ceilingheight1, &fs_floorheight1); + PlanesAtPoint(frontsector, pt2->pos.X, pt2->pos.Y, &fs_ceilingheight2, &fs_floorheight2); - PlanesAtPoint(backsector, wal->pos.X, wal->y, &bs_ceilingheight1, &bs_floorheight1); - PlanesAtPoint(backsector, pt2->pos.X, pt2->y, &bs_ceilingheight2, &bs_floorheight2); + PlanesAtPoint(backsector, wal->pos.X, wal->pos.Y, &bs_ceilingheight1, &bs_floorheight1); + PlanesAtPoint(backsector, pt2->pos.X, pt2->pos.Y, &bs_ceilingheight2, &bs_floorheight2); *bottomclip = max(max(bs_floorheight1, bs_floorheight2), max(fs_floorheight1, fs_floorheight2)); diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 1f41f3c39..51c0d7e61 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -415,7 +415,7 @@ void HWDrawInfo::CreateScene(bool portal) { auto wal = sect->firstWall() + w; wal->pos.X += eff.geox[i]; - wal->y += eff.geoy[i]; + wal->pos.Y += eff.geoy[i]; } sect->dirty = EDirty::AllDirty; if (eff.geosector[i] == drawsectp) drawsectp = eff.geosectorwarp[i]; @@ -434,7 +434,7 @@ void HWDrawInfo::CreateScene(bool portal) { auto wal = sect->firstWall() + w; wal->pos.X -= eff.geox[i]; - wal->y -= eff.geoy[i]; + wal->pos.Y -= eff.geoy[i]; } } @@ -447,7 +447,7 @@ void HWDrawInfo::CreateScene(bool portal) { auto wal = sect->firstWall() + w; wal->pos.X += eff.geox2[i]; - wal->y += eff.geoy2[i]; + wal->pos.Y += eff.geoy2[i]; } sect->dirty = EDirty::AllDirty; if (eff.geosector[i] == orgdrawsectp) drawsectp = eff.geosectorwarp2[i]; @@ -465,7 +465,7 @@ void HWDrawInfo::CreateScene(bool portal) { auto wal = sect->firstWall() + w; wal->pos.X -= eff.geox2[i]; - wal->y -= eff.geoy2[i]; + wal->pos.Y -= eff.geoy2[i]; } } ingeo = false; diff --git a/source/core/rendering/scene/hw_portal.cpp b/source/core/rendering/scene/hw_portal.cpp index 854cd028b..fc3d5b026 100644 --- a/source/core/rendering/scene/hw_portal.cpp +++ b/source/core/rendering/scene/hw_portal.cpp @@ -525,9 +525,9 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe di->mClipPortal = this; int x = line->pos.X; - int y = line->y; + int y = line->pos.Y; int dx = line->point2Wall()->pos.X - x; - int dy = line->point2Wall()->y - y; + int dy = line->point2Wall()->pos.Y - y; // this can overflow so use 64 bit math. const int64_t j = int64_t(dx) * dx + int64_t(dy) * dy; @@ -564,8 +564,8 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe ClearClipper(di, clipper); - auto startan = bvectangbam(line->pos.X - newx, line->y - newy); - auto endan = bvectangbam(line->point2Wall()->pos.X - newx, line->point2Wall()->y - newy); + auto startan = bvectangbam(line->pos.X - newx, line->pos.Y - newy); + auto endan = bvectangbam(line->point2Wall()->pos.X - newx, line->point2Wall()->pos.Y - newy); clipper->RestrictVisibleRange(endan, startan); // we check the line from the backside so angles are reversed. return true; } @@ -634,8 +634,8 @@ bool HWLineToLinePortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *cl ClearClipper(di, clipper); - auto startan = bvectangbam(origin->pos.X - origx, origin->y - origy); - auto endan = bvectangbam(origin->point2Wall()->pos.X - origx, origin->point2Wall()->y - origy); + auto startan = bvectangbam(origin->pos.X - origx, origin->pos.Y - origy); + auto endan = bvectangbam(origin->point2Wall()->pos.X - origx, origin->point2Wall()->pos.Y - origy); clipper->RestrictVisibleRange(startan, endan); return true; } @@ -686,8 +686,8 @@ bool HWLineToSpritePortal::Setup(HWDrawInfo* di, FRenderState& rstate, Clipper* ClearClipper(di, clipper); - auto startan = bvectangbam(origin->pos.X - origx, origin->y - origy); - auto endan = bvectangbam(origin->point2Wall()->pos.X - origx, origin->point2Wall()->y - origy); + auto startan = bvectangbam(origin->pos.X - origx, origin->pos.Y - origy); + auto endan = bvectangbam(origin->point2Wall()->pos.X - origx, origin->point2Wall()->pos.Y - origy); clipper->RestrictVisibleRange(startan, endan); return true; } diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index 23812b89a..8f2931333 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -964,8 +964,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec FVector2 v1(WallStartX(wal), WallStartY(wal)); FVector2 v2(WallEndX(wal), WallEndY(wal)); - PlanesAtPoint(frontsector, wal->pos.X, wal->y, &fch1, &ffh1); - PlanesAtPoint(frontsector, p2wall->pos.X, p2wall->y, &fch2, &ffh2); + PlanesAtPoint(frontsector, wal->pos.X, wal->pos.Y, &fch1, &ffh1); + PlanesAtPoint(frontsector, p2wall->pos.X, p2wall->pos.Y, &fch2, &ffh2); #ifdef _DEBUG @@ -1050,8 +1050,8 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec float bfh2; float bch1; float bch2; - PlanesAtPoint(backsector, wal->pos.X, wal->y, &bch1, &bfh1); - PlanesAtPoint(backsector, p2wall->pos.X, p2wall->y, &bch2, &bfh2); + PlanesAtPoint(backsector, wal->pos.X, wal->pos.Y, &bch1, &bfh1); + PlanesAtPoint(backsector, p2wall->pos.X, p2wall->pos.Y, &bch2, &bfh2); SkyTop(di, wal, frontsector, backsector, v1, v2, fch1, fch2); SkyBottom(di, wal, frontsector, backsector, v1, v2, ffh1, ffh2); diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index 55230a1e6..478473abc 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -606,7 +606,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, walltype &c, walltype if (arc.BeginObject(key)) { arc("x", c.pos.X, def->pos.X) - ("y", c.y, def->y) + ("y", c.pos.Y, def->pos.Y) ("point2", c.point2, def->point2) ("nextwall", c.nextwall, def->nextwall) ("nextsector", c.nextsector, def->nextsector) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index a876ce7c8..ca74d2122 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -60,8 +60,8 @@ static FVector3 CalcNormal(sectortype* sector, int plane) pt[0] = { (float)WallStartX(wal), (float)WallStartY(wal), 0 }; pt[1] = { (float)WallEndX(wal), (float)WallEndY(wal), 0 }; - PlanesAtPoint(sector, wal->pos.X, wal->y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Z); - PlanesAtPoint(sector, wal2->pos.X, wal2->y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Z); + PlanesAtPoint(sector, wal->pos.X, wal->pos.Y, plane ? &pt[0].Z : nullptr, plane? nullptr : &pt[0].Z); + PlanesAtPoint(sector, wal2->pos.X, wal2->pos.Y, plane ? &pt[1].Z : nullptr, plane ? nullptr : &pt[1].Z); if (pt[0].X == pt[1].X) { @@ -117,9 +117,9 @@ public: auto firstwall = sec->firstWall(); ix1 = firstwall->pos.X; - iy1 = firstwall->y; + iy1 = firstwall->pos.Y; ix2 = firstwall->point2Wall()->pos.X; - iy2 = firstwall->point2Wall()->y; + iy2 = firstwall->point2Wall()->pos.Y; if (plane == 0) { diff --git a/source/games/blood/src/_polymost.cpp b/source/games/blood/src/_polymost.cpp index 3bf00729c..68057071e 100644 --- a/source/games/blood/src/_polymost.cpp +++ b/source/games/blood/src/_polymost.cpp @@ -222,20 +222,20 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int wallarr[mirrorwall[0]].nextwall = nWall; wallarr[mirrorwall[0]].nextsector = nSector; wallarr[mirrorwall[0]].pos.X = pWall->point2Wall()->pos.X; - wallarr[mirrorwall[0]].y = pWall->point2Wall()->y; + wallarr[mirrorwall[0]].pos.Y = pWall->point2Wall()->pos.Y; wallarr[mirrorwall[1]].pos.X = pWall->pos.X; - wallarr[mirrorwall[1]].y = pWall->y; + wallarr[mirrorwall[1]].pos.Y = pWall->pos.Y; wallarr[mirrorwall[2]].pos.X = wallarr[mirrorwall[1]].pos.X + (wallarr[mirrorwall[1]].pos.X - wallarr[mirrorwall[0]].pos.X) * 16; - wallarr[mirrorwall[2]].y = wallarr[mirrorwall[1]].y + (wallarr[mirrorwall[1]].y - wallarr[mirrorwall[0]].y) * 16; + wallarr[mirrorwall[2]].pos.Y = wallarr[mirrorwall[1]].pos.Y + (wallarr[mirrorwall[1]].pos.Y - wallarr[mirrorwall[0]].pos.Y) * 16; wallarr[mirrorwall[3]].pos.X = wallarr[mirrorwall[0]].pos.X + (wallarr[mirrorwall[0]].pos.X - wallarr[mirrorwall[1]].pos.X) * 16; - wallarr[mirrorwall[3]].y = wallarr[mirrorwall[0]].y + (wallarr[mirrorwall[0]].y - wallarr[mirrorwall[1]].y) * 16; + wallarr[mirrorwall[3]].pos.Y = wallarr[mirrorwall[0]].pos.Y + (wallarr[mirrorwall[0]].pos.Y - wallarr[mirrorwall[1]].pos.Y) * 16; sector.Data()[mirrorsector].floorz = sector[nSector].floorz; sector.Data()[mirrorsector].ceilingz = sector[nSector].ceilingz; int cx, cy, ca; if (pWall->type == kWallStack) { cx = x - (wall[pWall->hitag].pos.X - pWall->point2Wall()->pos.X); - cy = y - (wall[pWall->hitag].y - pWall->point2Wall()->y); + cy = y - (wall[pWall->hitag].pos.Y - pWall->point2Wall()->pos.Y); ca = a; } else diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 167a68457..cc7964212 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2624,7 +2624,7 @@ int actFloorBounceVector(int* x, int* y, int* z, sectortype* pSector, int a5) } walltype* pWall = pSector->firstWall(); walltype* pWall2 = pWall->point2Wall(); - int angle = getangle(pWall2->pos.X - pWall->pos.X, pWall2->y - pWall->y) + 512; + int angle = getangle(pWall2->pos.X - pWall->pos.X, pWall2->pos.Y - pWall->pos.Y) + 512; int t2 = pSector->floorheinum << 4; int t3 = approxDist(-0x10000, t2); int t4 = DivScale(-0x10000, t3, 16); diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index 80b5e9fce..db4472590 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -439,7 +439,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, sect dbCrypt((char*)&load, sizeof(walltypedisk), (gMapRev * sizeof(sectortypedisk)) | 0x7474614d); } pWall->pos.X = LittleLong(load.x); - pWall->y = LittleLong(load.y); + pWall->pos.Y = LittleLong(load.y); pWall->point2 = LittleShort(load.point2); pWall->nextwall = LittleShort(load.nextwall); pWall->nextsector = LittleShort(load.nextsector); diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index e17332a6e..329d85935 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -149,9 +149,9 @@ 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) { int x1 = pWall->pos.X; - int y1 = pWall->y; + int y1 = pWall->pos.Y; int x2 = pWall->point2Wall()->pos.X; - int y2 = pWall->point2Wall()->y; + int y2 = pWall->point2Wall()->pos.Y; nDist <<= 4; if (x1 < x2) { @@ -489,12 +489,12 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in nOffset = (nOffset*pWall->yrepeat) / 8; nOffset += int((nSizY*pWall->ypan_) / 256); - int nLength = approxDist(pWall->pos.X - pWall->point2Wall()->pos.X, pWall->y - pWall->point2Wall()->y); + int nLength = approxDist(pWall->pos.X - pWall->point2Wall()->pos.X, pWall->pos.Y - pWall->point2Wall()->pos.Y); int nHOffset; if (pWall->cstat & CSTAT_WALL_XFLIP) - nHOffset = approxDist(gHitInfo.hitpos.X - pWall->point2Wall()->pos.X, gHitInfo.hitpos.Y - pWall->point2Wall()->y); + nHOffset = approxDist(gHitInfo.hitpos.X - pWall->point2Wall()->pos.X, gHitInfo.hitpos.Y - pWall->point2Wall()->pos.Y); else - nHOffset = approxDist(gHitInfo.hitpos.X - pWall->pos.X, gHitInfo.hitpos.Y - pWall->y); + nHOffset = approxDist(gHitInfo.hitpos.X - pWall->pos.X, gHitInfo.hitpos.Y - pWall->pos.Y); nHOffset = pWall->xpan() + ((nHOffset*pWall->xrepeat) << 3) / nLength; nHOffset %= nSizX; diff --git a/source/games/blood/src/gib.cpp b/source/games/blood/src/gib.cpp index 574b8b315..16e073b9a 100644 --- a/source/games/blood/src/gib.cpp +++ b/source/games/blood/src/gib.cpp @@ -436,7 +436,7 @@ void GibFX(walltype* pWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVe int r1 = Random(a6); int r2 = Random(a5); int r3 = Random(a4); - auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->pos.X+r3, pWall->y+r2, a3+r1, 0); + auto pGib = gFX.fxSpawnActor(pGFX->fxId, pSector, pWall->pos.X+r3, pWall->pos.Y+r2, a3+r1, 0); if (pGib) { if (pGFX->at1 < 0) @@ -464,7 +464,7 @@ void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity *pVel) int cx, cy, cz, wx, wy, wz; cx = (pWall->pos.X+pWall->point2Wall()->pos.X)>>1; - cy = (pWall->y+pWall->point2Wall()->y)>>1; + cy = (pWall->pos.Y+pWall->point2Wall()->pos.Y)>>1; auto pSector = pWall->sectorp(); int32_t ceilZ, floorZ; getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ); @@ -475,7 +475,7 @@ void GibWall(walltype* pWall, GIBTYPE nGibType, CGibVelocity *pVel) floorZ = ClipHigh(floorZ, floorZ2); wz = floorZ-ceilZ; wx = pWall->point2Wall()->pos.X-pWall->pos.X; - wy = pWall->point2Wall()->y-pWall->y; + wy = pWall->point2Wall()->pos.Y-pWall->pos.Y; cz = (ceilZ+floorZ)>>1; GIBLIST *pGib = &gibList[nGibType]; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index d000e8072..2a6f90d1c 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3556,7 +3556,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector { int cx, cy, cz; cx = (pWall->pos.X + pWall->point2Wall()->pos.X) >> 1; - cy = (pWall->y + pWall->point2Wall()->y) >> 1; + cy = (pWall->pos.Y + pWall->point2Wall()->pos.Y) >> 1; auto pMySector = pWall->sectorp(); int32_t ceilZ, floorZ; getzsofslopeptr(pSector, cx, cy, &ceilZ, &floorZ); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 482bbbc5d..7ae77b718 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1903,7 +1903,7 @@ void AlignSlopes(void) auto pNextSector = pWall->nextSector(); int x = (pWall->pos.X+pWall2->pos.X)/2; - int y = (pWall->y+pWall2->y)/2; + int y = (pWall->pos.Y+pWall2->pos.Y)/2; viewInterpolateSector(§); alignflorslope(§, x, y, getflorzofslopeptr(pNextSector, x, y)); alignceilslope(§, x, y, getceilzofslopeptr(pNextSector, x, y)); @@ -1967,7 +1967,7 @@ void trInit(TArray& actors) for(auto& wal : wall) { wal.baseWall.X = wal.pos.X; - wal.baseWall.Y = wal.y; + wal.baseWall.Y = wal.pos.Y; } for(auto actor : actors) { @@ -2020,7 +2020,7 @@ void trInit(TArray& actors) for(auto& wal : wallsofsector(pSector)) { wal.baseWall.X = wal.pos.X; - wal.baseWall.Y = wal.y; + wal.baseWall.Y = wal.pos.Y; } BloodSectIterator it(pSector); while (auto actor = it.Next()) @@ -2039,7 +2039,7 @@ void trInit(TArray& actors) for (auto& wal : wallsofsector(pSector)) { wal.baseWall.X = wal.pos.X; - wal.baseWall.Y = wal.y; + wal.baseWall.Y = wal.pos.Y; } BloodSectIterator it(pSector); while (auto actor = it.Next()) diff --git a/source/games/duke/src/_polymost.cpp b/source/games/duke/src/_polymost.cpp index dda1797ec..f3323bf9a 100644 --- a/source/games/duke/src/_polymost.cpp +++ b/source/games/duke/src/_polymost.cpp @@ -164,7 +164,7 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho int dst = 0x7fffffff, i = 0; for (int k = 0; k < mirrorcnt; k++) { - int j = abs(mirrorwall[k]->pos.X - cposx) + abs(mirrorwall[k]->y - cposy); + int j = abs(mirrorwall[k]->pos.X - cposx) + abs(mirrorwall[k]->pos.Y - cposy); if (j < dst) dst = j, i = k; } diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 3f7158b5e..d9afcc875 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4205,8 +4205,8 @@ void handle_se20(DDukeActor* actor) } auto& wal = actor->temp_walls; - dragpoint(wal[0], wal[0]->pos.X + x, wal[0]->y + l); - dragpoint(wal[1], wal[1]->pos.X + x, wal[1]->y + l); + dragpoint(wal[0], wal[0]->pos.X + x, wal[0]->pos.Y + l); + dragpoint(wal[1], wal[1]->pos.X + x, wal[1]->pos.Y + l); for (int p = connecthead; p >= 0; p = connectpoint2[p]) if (ps[p].cursector == actor->spr.sector() && ps[p].on_ground) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 633755353..bfec76fb1 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -270,13 +270,13 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h if (((dasectp->ceilingz - actor->spr.z) >> 8) < r) { auto wal = dasectp->firstWall(); - int d = abs(wal->pos.X - actor->spr.x) + abs(wal->y - actor->spr.y); + int d = abs(wal->pos.X - actor->spr.x) + abs(wal->pos.Y - actor->spr.y); if (d < r) fi.checkhitceiling(dasectp); else { auto thirdpoint = wal->point2Wall()->point2Wall(); - d = abs(thirdpoint->pos.X - actor->spr.x) + abs(thirdpoint->y - actor->spr.y); + d = abs(thirdpoint->pos.X - actor->spr.x) + abs(thirdpoint->pos.Y - actor->spr.y); if (d < r) 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)) { - if ((abs(wal.pos.X - actor->spr.x) + abs(wal.y - actor->spr.y)) < r) + if ((abs(wal.pos.X - actor->spr.x) + abs(wal.pos.Y - actor->spr.y)) < r) { if (wal.twoSided()) { search.Add(wal.nextSector()); } int x1 = (((wal.pos.X + wal.point2Wall()->pos.X) >> 1) + actor->spr.x) >> 1; - int y1 = (((wal.y + wal.point2Wall()->y) >> 1) + actor->spr.y) >> 1; + int y1 = (((wal.pos.Y + wal.point2Wall()->pos.Y) >> 1) + actor->spr.y) >> 1; sectortype* sect = wal.sectorp(); updatesector(x1, y1, §); if (sect && cansee(x1, y1, actor->spr.z, sect, actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector())) - fi.checkhitwall(actor, &wal, wal.pos.X, wal.y, actor->spr.z, actor->spr.picnum); + fi.checkhitwall(actor, &wal, wal.pos.X, wal.pos.Y, actor->spr.z, actor->spr.picnum); } } } @@ -3656,7 +3656,7 @@ void moveeffectors_d(void) //STATNUM 3 auto sc = act->sector(); if (sc->wallnum != 4) continue; auto wal = sc->firstWall() + 2; - alignflorslope(act->spr.sector(), wal->pos.X, wal->y, wal->nextSector()->floorz); + alignflorslope(act->spr.sector(), wal->pos.X, wal->pos.Y, wal->nextSector()->floorz); } } diff --git a/source/games/duke/src/actors_lava.cpp b/source/games/duke/src/actors_lava.cpp index b0091ec53..e73be15bb 100644 --- a/source/games/duke/src/actors_lava.cpp +++ b/source/games/duke/src/actors_lava.cpp @@ -285,7 +285,7 @@ void dojaildoor(void) for (auto& wal : wallsofsector(sectp)) { int x = wal.pos.X; - int y = wal.y; + int y = wal.pos.Y; switch (jaildoordir[i]) { case 10: @@ -337,23 +337,23 @@ void dojaildoor(void) { default: // make case of bad parameters well defined. x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; break; case 10: x = wal.pos.X; - y = wal.y + speed; + y = wal.pos.Y + speed; break; case 20: x = wal.pos.X - speed; - y = wal.y; + y = wal.pos.Y; break; case 30: x = wal.pos.X; - y = wal.y - speed; + y = wal.pos.Y - speed; break; case 40: x = wal.pos.X + speed; - y = wal.y; + y = wal.pos.Y; break; } dragpoint(&wal, x, y); @@ -419,23 +419,23 @@ void moveminecart(void) { default: // make case of bad parameters well defined. x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; break; case 10: x = wal.pos.X; - y = wal.y + speed; + y = wal.pos.Y + speed; break; case 20: x = wal.pos.X - speed; - y = wal.y; + y = wal.pos.Y; break; case 30: x = wal.pos.X; - y = wal.y - speed; + y = wal.pos.Y - speed; break; case 40: x = wal.pos.X + speed; - y = wal.y; + y = wal.pos.Y; break; } dragpoint(&wal, x, y); @@ -473,23 +473,23 @@ void moveminecart(void) { default: // make case of bad parameters well defined. x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; break; case 10: x = wal.pos.X; - y = wal.y + speed; + y = wal.pos.Y + speed; break; case 20: x = wal.pos.X - speed; - y = wal.y; + y = wal.pos.Y; break; case 30: x = wal.pos.X; - y = wal.y - speed; + y = wal.pos.Y - speed; break; case 40: x = wal.pos.X + speed; - y = wal.y; + y = wal.pos.Y; break; } dragpoint(&wal, x, y); @@ -502,7 +502,7 @@ void moveminecart(void) for (auto& wal : wallsofsector(csect)) { x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; if (x > max_x) max_x = x; if (y > max_y) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index b65ab5789..92d6c42ec 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -228,13 +228,13 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h if (((dasectp->ceilingz - actor->spr.z) >> 8) < r) { auto wal = dasectp->firstWall(); - int d = abs(wal->pos.X - actor->spr.x) + abs(wal->y - actor->spr.y); + int d = abs(wal->pos.X - actor->spr.x) + abs(wal->pos.Y - actor->spr.y); if (d < r) fi.checkhitceiling(dasectp); else { auto thirdpoint = wal->point2Wall()->point2Wall(); - d = abs(thirdpoint->pos.X - actor->spr.x) + abs(thirdpoint->y - actor->spr.y); + d = abs(thirdpoint->pos.X - actor->spr.x) + abs(thirdpoint->pos.Y - actor->spr.y); if (d < r) 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)) { - if ((abs(wal.pos.X - actor->spr.x) + abs(wal.y - actor->spr.y)) < r) + if ((abs(wal.pos.X - actor->spr.x) + abs(wal.pos.Y - actor->spr.y)) < r) { if (wal.twoSided()) { search.Add(wal.nextSector()); } int x1 = (((wal.pos.X + wal.point2Wall()->pos.X) >> 1) + actor->spr.x) >> 1; - int y1 = (((wal.y + wal.point2Wall()->y) >> 1) + actor->spr.y) >> 1; + int y1 = (((wal.pos.Y + wal.point2Wall()->pos.Y) >> 1) + actor->spr.y) >> 1; auto sect = wal.sectorp(); updatesector(x1, y1, §); if (sect != nullptr && cansee(x1, y1, actor->spr.z, sect, actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector())) - fi.checkhitwall(actor, &wal, wal.pos.X, wal.y, actor->spr.z, actor->spr.picnum); + fi.checkhitwall(actor, &wal, wal.pos.X, wal.pos.Y, actor->spr.z, actor->spr.picnum); } } } @@ -3615,7 +3615,7 @@ void moveeffectors_r(void) //STATNUM 3 auto sc = act->sector(); if (sc->wallnum != 4) continue; auto wal = sc->firstWall() + 2; - alignflorslope(act->sector(), wal->pos.X, wal->y, wal->nextSector()->floorz); + alignflorslope(act->sector(), wal->pos.X, wal->pos.Y, wal->nextSector()->floorz); } } diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index d4b692a69..5ae363349 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -967,7 +967,7 @@ void DoWall(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, i if (!bSet) SetGameVarID(lVar2, wallp->pos.X, sActor, sPlayer); break; case WALL_Y: - if (bSet) SetGameVarID(lVar2, wallp->y, sActor, sPlayer); + if (bSet) SetGameVarID(lVar2, wallp->pos.Y, sActor, sPlayer); break; case WALL_POINT2: if (!bSet) SetGameVarID(lVar2, wallp->point2, sActor, sPlayer); diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 15be35fe5..960ed2b00 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -717,7 +717,7 @@ void prelevel_common(int g) if (sectp->lotag == -1) { ps[0].exitx = sectp->firstWall()->pos.X; - ps[0].exity = sectp->firstWall()->y; + ps[0].exity = sectp->firstWall()->pos.Y; continue; } } diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 30070d6a7..16d402400 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -291,7 +291,7 @@ int* animateptr(int type, int index, bool write) return &wall[index].pos.X; case anim_vertexy: if (write) wall[index].moved(); - return &wall[index].y; + return &wall[index].pos.Y; default: assert(false); return &scratch; @@ -507,7 +507,7 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor) for (auto& wal : wallsofsector(sptr)) { dax += wal.pos.X; - day += wal.y; + day += wal.pos.Y; } dax /= sptr->wallnum; day /= sptr->wallnum; @@ -517,7 +517,7 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor) wallfind[0] = nullptr; wallfind[1] = nullptr; for (auto& wal : wallsofsector(sptr)) - if ((wal.pos.X == dax) || (wal.y == day)) + if ((wal.pos.X == dax) || (wal.pos.Y == day)) { if (wallfind[0] == nullptr) wallfind[0] = &wal; @@ -533,10 +533,10 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor) auto prevwall = wal - 1; if (prevwall < sptr->firstWall()) prevwall += sptr->wallnum; - if ((wal->pos.X == dax) && (wal->y == day)) + if ((wal->pos.X == dax) && (wal->pos.Y == day)) { dax2 = ((prevwall->pos.X + wal->point2Wall()->pos.X) >> 1) - wal->pos.X; - day2 = ((prevwall->y + wal->point2Wall()->y) >> 1) - wal->y; + day2 = ((prevwall->pos.Y + wal->point2Wall()->pos.Y) >> 1) - wal->pos.Y; if (dax2 != 0) { dax2 = wal->point2Wall()->point2Wall()->pos.X; @@ -548,18 +548,18 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor) } else if (day2 != 0) { - day2 = wal->point2Wall()->point2Wall()->y; - day2 -= wal->point2Wall()->y; - setanimation(sptr, anim_vertexy, wal, wal->y + day2, sp); - setanimation(sptr, anim_vertexy, prevwall, prevwall->y + day2, sp); - setanimation(sptr, anim_vertexy, wal->point2Wall(), wal->point2Wall()->y + day2, sp); + day2 = wal->point2Wall()->point2Wall()->pos.Y; + day2 -= wal->point2Wall()->pos.Y; + setanimation(sptr, anim_vertexy, wal, wal->pos.Y + day2, sp); + setanimation(sptr, anim_vertexy, prevwall, prevwall->pos.Y + day2, sp); + setanimation(sptr, anim_vertexy, wal->point2Wall(), wal->point2Wall()->pos.Y + day2, sp); callsound(sptr, actor); } } else { dax2 = ((prevwall->pos.X + wal->point2Wall()->pos.X) >> 1) - wal->pos.X; - day2 = ((prevwall->y + wal->point2Wall()->y) >> 1) - wal->y; + day2 = ((prevwall->pos.Y + wal->point2Wall()->pos.Y) >> 1) - wal->pos.Y; if (dax2 != 0) { setanimation(sptr, anim_vertexx, wal, dax, sp); diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index c466a7094..db38427df 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -251,7 +251,7 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act) if (lotag == 0) return 0; hitag = wwal->hitag; sx = wwal->pos.X; - sy = wwal->y; + sy = wwal->pos.Y; picnum = wwal->picnum; switchpal = wwal->pal; } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 9a74b1afa..839caeeb3 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -370,7 +370,7 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act) if (lotag == 0) return 0; hitag = wwal->hitag; sx = wwal->pos.X; - sy = wwal->y; + sy = wwal->pos.Y; picnum = wwal->picnum; switchpal = wwal->pal; } @@ -947,7 +947,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n) j = n + 1; int x1 = wal->pos.X; - int y1 = wal->y; + int y1 = wal->pos.Y; auto delta = wal->delta(); @@ -2818,7 +2818,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum) for(auto& wal : wallsofsector(nextsect)) { x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; if (x > max_x) max_x = x; if (y > max_y) @@ -2851,11 +2851,11 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum) for(auto& wal : wallsofsector(nextsect)) { x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; switch (wlwal->lotag) { case 42: - y = wal.y + var_cx; + y = wal.pos.Y + var_cx; dragpoint(&wal, x, y); break; case 41: @@ -2863,7 +2863,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum) dragpoint(&wal, x, y); break; case 40: - y = wal.y - var_cx; + y = wal.pos.Y - var_cx; dragpoint(&wal, x, y); break; case 43: @@ -2878,11 +2878,11 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum) for(auto& wal : wallsofsector(nextsect)) { x = wal.pos.X; - y = wal.y; + y = wal.pos.Y; switch (wlwal->lotag) { case 42: - y = wal.y - (var_cx - 2); + y = wal.pos.Y - (var_cx - 2); dragpoint(&wal, x, y); break; case 41: @@ -2890,7 +2890,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum) dragpoint(&wal, x, y); break; case 40: - y = wal.y + (var_cx - 2); + y = wal.pos.Y + (var_cx - 2); dragpoint(&wal, x, y); break; case 43: diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 9e2d421ea..4fa4166db 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -788,7 +788,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) for (auto& wal : wallsofsector(sectp)) { - d = FindDistance2D(actor->spr.x - wal.pos.X, actor->spr.y - wal.y); + d = FindDistance2D(actor->spr.x - wal.pos.X, actor->spr.y - wal.pos.Y); if (d < q) { q = d; @@ -802,7 +802,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) for (auto& wal : wallsofsector(sectp)) { - d = FindDistance2D(actor->spr.x - wal.pos.X, actor->spr.y - wal.y); + d = FindDistance2D(actor->spr.x - wal.pos.X, actor->spr.y - wal.pos.Y); if (d < q && &wal != actor->temp_walls[0]) { q = d; @@ -963,11 +963,11 @@ void spawneffector(DDukeActor* actor, TArray* actors) for (auto& wal : wallsofsector(sectp)) { msx[tempwallptr] = wal.pos.X - actor->spr.x; - msy[tempwallptr] = wal.y - actor->spr.y; + msy[tempwallptr] = wal.pos.Y - actor->spr.y; tempwallptr++; if (tempwallptr > 2047) { - I_Error("Too many moving sectors at (%d,%d).\n", wal.pos.X, wal.y); + I_Error("Too many moving sectors at (%d,%d).\n", wal.pos.X, wal.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) @@ -1088,7 +1088,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n) } int x1 = wal->pos.X; - int y1 = wal->y; + int y1 = wal->pos.Y; auto delta = wal->delta() / (n + 1); x1 -= Sgn(delta.Y); @@ -1143,7 +1143,7 @@ void ceilingglass(DDukeActor* actor, sectortype* sectp, int n) for (auto& wal : wallsofsector(sectp)) { int x1 = wal.pos.X; - int y1 = wal.y; + int y1 = wal.pos.Y; auto delta = wal.delta() / (n + 1); @@ -1182,7 +1182,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n) } int x1 = wal->pos.X; - int y1 = wal->y; + int y1 = wal->pos.Y; auto delta = wal->delta() / (n + 1); diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index 5b96fd2a4..5117ebb18 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -228,14 +228,14 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b) int besty = bestx; int x = wal1.pos.X; - int y = wal1.y; + int y = wal1.pos.Y; walltype* bestwall = nullptr; for(auto& wal2 : wallsofsector(pSectorB)) { int thisx = x - wal2.pos.X; - int thisy = y - wal2.y; + int thisy = y - wal2.pos.Y; int thisdist = abs(thisx) + abs(thisy); int bestdist = abs(bestx) + abs(besty); @@ -247,7 +247,7 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b) } } - dragpoint(bestwall, bestwall->pos.X + bestx, bestwall->y + besty); + dragpoint(bestwall, bestwall->pos.X + bestx, bestwall->pos.Y + besty); } if (b) { diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index ed4d4be04..aa23ba572 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -823,7 +823,7 @@ void CreatePushBlock(sectortype* pSector) for (auto& wal : wallsofsector(pSector)) { xSum += wal.pos.X; - ySum += wal.y; + ySum += wal.pos.Y; } int xAvg = xSum / pSector->wallnum; @@ -847,7 +847,7 @@ void CreatePushBlock(sectortype* pSector) for (auto& wal : wallsofsector(pSector)) { uint32_t xDiff = abs(xAvg - wal.pos.X); - uint32_t yDiff = abs(yAvg - wal.y); + uint32_t yDiff = abs(yAvg - wal.pos.Y); uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; @@ -1058,7 +1058,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) for(auto& wal : wallsofsector(pSector)) { - dragpoint(&wal, xvect + wal.pos.X, yvect + wal.y); + dragpoint(&wal, xvect + wal.pos.X, yvect + wal.pos.Y); } pBlockInfo->x += xvect; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 33a6c56df..18cd40d4a 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -420,12 +420,12 @@ DExhumedActor* FindWallSprites(sectortype* pSector) esi = wal.pos.X; } - if (ecx > wal.y) { - ecx = wal.y; + if (ecx > wal.pos.Y) { + ecx = wal.pos.Y; } - if (edi < wal.y) { - edi = wal.y; + if (edi < wal.pos.Y) { + edi = wal.pos.Y; } } @@ -993,22 +993,22 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p SlideData[nSlide].pWall3 = pWall3; SlideData[nSlide].x1 = pStartWall->pos.X; - SlideData[nSlide].y1 = pStartWall->y; + SlideData[nSlide].y1 = pStartWall->pos.Y; SlideData[nSlide].x2 = pWall2->pos.X; - SlideData[nSlide].y2 = pWall2->y; + SlideData[nSlide].y2 = pWall2->pos.Y; SlideData[nSlide].x3 = pWall1->pos.X; - SlideData[nSlide].y3 = pWall1->y; + SlideData[nSlide].y3 = pWall1->pos.Y; SlideData[nSlide].x4 = pWall3->pos.X; - SlideData[nSlide].y4 = pWall3->y; + SlideData[nSlide].y4 = pWall3->pos.Y; SlideData[nSlide].x5 = p2ndLastWall->pos.X; - SlideData[nSlide].y5 = p2ndLastWall->y; + SlideData[nSlide].y5 = p2ndLastWall->pos.Y; SlideData[nSlide].x6 = pWall4->pos.X; - SlideData[nSlide].y6 = pWall4->y; + SlideData[nSlide].y6 = pWall4->pos.Y; StartInterpolation(pStartWall, Interp_Wall_X); StartInterpolation(pStartWall, Interp_Wall_Y); @@ -1029,7 +1029,7 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p SlideData[nSlide].pActor = pActor; pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->x = pStartWall->pos.X; - pSprite->y = pStartWall->y; + pSprite->y = pStartWall->pos.Y; pSprite->z = pSector->floorz; pSprite->backuppos(); @@ -1082,7 +1082,7 @@ void AISlide::Tick(RunListEvent* ev) { auto pWall = SlideData[nSlide].pWall1; int x = pWall->pos.X; - int y = pWall->y; + int y = pWall->pos.Y; int nSeekA = LongSeek(&x, SlideData[nSlide].x5, 20, 20); int var_34 = nSeekA; @@ -1105,7 +1105,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pStartWall; - y = pWall->y + var_24; + y = pWall->pos.Y + var_24; x = pWall->pos.X + var_20; dragpoint(SlideData[nSlide].pStartWall, x, y); @@ -1113,7 +1113,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pWall3; x = pWall->pos.X; - y = pWall->y; + y = pWall->pos.Y; int nSeekC = LongSeek(&x, SlideData[nSlide].x6, 20, 20); int var_30 = nSeekC; @@ -1132,7 +1132,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pWall2; x = pWall->pos.X + var_20; - y = pWall->y + var_24; + y = pWall->pos.Y + var_24; dragpoint(SlideData[nSlide].pWall2, x, y); } @@ -1140,7 +1140,7 @@ void AISlide::Tick(RunListEvent* ev) { auto pWall = SlideData[nSlide].pStartWall; int x = pWall->pos.X; - int y = pWall->y; + int y = pWall->pos.Y; int nSeekA = LongSeek(&x, SlideData[nSlide].x1, 20, 20); int edi = nSeekA; @@ -1158,7 +1158,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pWall1; - y = pWall->y + var_28; + y = pWall->pos.Y + var_28; x = pWall->pos.X + var_1C; dragpoint(SlideData[nSlide].pWall1, x, y); @@ -1166,7 +1166,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pWall2; x = pWall->pos.X; - y = pWall->y; + y = pWall->pos.Y; int nSeekC = LongSeek(&x, SlideData[nSlide].x2, 20, 20); edi = nSeekC; @@ -1184,7 +1184,7 @@ void AISlide::Tick(RunListEvent* ev) pWall = SlideData[nSlide].pWall3; - y = pWall->y + var_28; + y = pWall->pos.Y + var_28; x = pWall->pos.X + var_1C; dragpoint(SlideData[nSlide].pWall3, x, y); @@ -1579,7 +1579,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) for(auto& wal : wallsofsector(pSector)) { x += wal.pos.X; - y += wal.y; + y += wal.pos.Y; wal.picnum = kClockSymbol16; wal.pal = 0; @@ -2545,7 +2545,7 @@ void PostProcess() if (§ != §j && sectj.Speed && !(sect.Flag & kSectLava)) { int xVal = abs(sect.firstWall()->pos.X - sectj.firstWall()->pos.X); - int yVal = abs(sect.firstWall()->y - sectj.firstWall()->y); + int yVal = abs(sect.firstWall()->pos.Y - sectj.firstWall()->pos.Y); if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20)) { diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 53bc2ad17..22186a5dd 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -673,7 +673,7 @@ void CheckAmbience(sectortype* sect) walltype* pWall = pSector2->firstWall(); if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0)) { - vec3_t v = { pWall->pos.X, pWall->y, pSector2->floorz }; + vec3_t v = { pWall->pos.X, pWall->pos.Y, pSector2->floorz }; amb = GetSoundPos(&v); soundEngine->StartSound(SOURCE_Ambient, &amb, nullptr, CHAN_BODY, CHANF_TRANSIENT, sect->Sound + 1, 1.f, ATTN_NORM); return; @@ -688,7 +688,7 @@ void CheckAmbience(sectortype* sect) } else { - vec3_t v = { pWall->pos.X, pWall->y, pSector2->floorz }; + vec3_t v = { pWall->pos.X, pWall->pos.Y, pSector2->floorz }; amb = GetSoundPos(&v); } return 1; diff --git a/source/games/exhumed/src/switch.cpp b/source/games/exhumed/src/switch.cpp index 58fcb38cc..5b83cc3ac 100644 --- a/source/games/exhumed/src/switch.cpp +++ b/source/games/exhumed/src/switch.cpp @@ -290,7 +290,7 @@ void AISWStepOn::TouchFloor(RunListEvent* ev) if (var_14 != sRunChannels[nChannel].c) { auto pWall = pSector->firstWall(); - PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->pos.X, pWall->y, pSector->floorz); + PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->pos.X, pWall->pos.Y, pSector->floorz); assert(sRunChannels[nChannel].c < 8); @@ -510,7 +510,7 @@ void AISWPressWall::Use(RunListEvent* ev) auto pWall = SwitchData[nSwitch].pWall; auto pSector = SwitchData[nSwitch].pSector; - PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->pos.X, pWall->y, 0, CHANF_LISTENERZ); + PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->pos.X, pWall->pos.Y, 0, CHANF_LISTENERZ); } END_PS_NS diff --git a/source/games/sw/src/_polymost.cpp b/source/games/sw/src/_polymost.cpp index 721c6b7ac..b8ca2a9b1 100644 --- a/source/games/sw/src/_polymost.cpp +++ b/source/games/sw/src/_polymost.cpp @@ -210,7 +210,7 @@ void JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed if (bIsWallMirror) { j = abs(mirror[cnt].mirrorWall->pos.X - tx); - j += abs(mirror[cnt].mirrorWall->y - ty); + j += abs(mirror[cnt].mirrorWall->pos.Y - ty); if (j < dist) dist = j; } @@ -243,7 +243,7 @@ void JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, fixed_t tpq16ang, fixed // Get wall midpoint for offset in mirror view midx = (wal->pos.X + wal->point2Wall()->pos.X) / 2; - midy = (wal->y + wal->point2Wall()->y) / 2; + midy = (wal->pos.Y + wal->point2Wall()->pos.Y) / 2; // Finish finding offsets tdx = abs(midx - tx); diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index d0f6334d9..1d3b85aa2 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -741,7 +741,7 @@ int WallBreakPosition(walltype* wp, sectortype** sectp, int *x, int *y, int *z, // midpoint of wall *x = (wp->pos.X + wp->pos.X) >> 1; - *y = (wp->y + wp->y) >> 1; + *y = (wp->pos.Y + wp->pos.Y) >> 1; if (!wp->twoSided()) { diff --git a/source/games/sw/src/interpso.cpp b/source/games/sw/src/interpso.cpp index 144c78f4d..63187f030 100644 --- a/source/games/sw/src/interpso.cpp +++ b/source/games/sw/src/interpso.cpp @@ -100,7 +100,7 @@ static int &getvalue(so_interp::interp_data& element, bool write) return wall[index].pos.X; case soi_wally: if (write) wall[index].moved(); - return wall[index].y; + return wall[index].pos.Y; case soi_ceil: return sector[index].ceilingz; case soi_floor: diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index f54eec583..79b6d156a 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -343,7 +343,7 @@ void JS_InitMirrors(void) if (!Found_Cam) { Printf("Cound not find the camera view sprite for match %d\n", wal.hitag); - Printf("Map Coordinates: x = %d, y = %d\n", wal.pos.X, wal.y); + Printf("Map Coordinates: x = %d, y = %d\n", wal.pos.X, wal.pos.Y); break; } @@ -373,7 +373,7 @@ void JS_InitMirrors(void) { Printf("Did not find drawtotile for camera number %d\n", mirrorcnt); Printf("wall(%d).hitag == %d\n", wallnum(&wal), wal.hitag); - Printf("Map Coordinates: x = %d, y = %d\n", wal.pos.X, wal.y); + Printf("Map Coordinates: x = %d, y = %d\n", wal.pos.X, wal.pos.Y); RESET_BOOL1(&mirror[mirrorcnt].cameraActor->s()); } } @@ -526,7 +526,7 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) if (bIsWallMirror) { j = abs(mirror[cnt].mirrorWall->pos.X - tx); - j += abs(mirror[cnt].mirrorWall->y - ty); + j += abs(mirror[cnt].mirrorWall->pos.Y - ty); if (j < dist) dist = j; } @@ -556,7 +556,7 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) // Get wall midpoint for offset in mirror view midx = (wal->pos.X + wal->point2Wall()->pos.X) / 2; - midy = (wal->y + wal->point2Wall()->y) / 2; + midy = (wal->pos.Y + wal->point2Wall()->pos.Y) / 2; // Finish finding offsets tdx = abs(midx - tx); diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 8fd60ff44..8f0232b7c 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2629,7 +2629,7 @@ void DoPlayerMoveVehicle(PLAYERp pp) if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY) == WALLFX_LOOP_OUTER) { x[count] = wal.pos.X; - y[count] = wal.y; + y[count] = wal.pos.Y; ox[count] = sop->xmid - sop->xorig[wallcount]; oy[count] = sop->ymid - sop->yorig[wallcount]; diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 7302baa76..467265da7 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -128,7 +128,7 @@ void WallSetupDontMove(void) { for(auto& wal : wall) { - if (wal.pos.X < spl->x && wal.pos.X > spu->x && wal.y < spl->y && wal.y > spu->y) + if (wal.pos.X < spl->x && wal.pos.X > spu->x && wal.pos.Y < spl->y && wal.pos.Y > spu->y) { SET(wal.extra, WALLFX_DONT_MOVE); } @@ -304,7 +304,7 @@ void WallSetup(void) SET(wall_num->extra, WALLFX_DONT_STICK); if (!sw->type) - sw->orig_xy = wall_num->y - (sw->range >> 2); + sw->orig_xy = wall_num->pos.Y - (sw->range >> 2); else sw->orig_xy = wall_num->pos.X - (sw->range >> 2); @@ -598,7 +598,7 @@ void SectorMidPoint(sectortype* sectp, int *xmid, int *ymid, int *zmid) for(auto& wal : wallsofsector(sectp)) { xsum += wal.pos.X; - ysum += wal.y; + ysum += wal.pos.Y; } *xmid = xsum / (sectp->wallnum); @@ -2477,7 +2477,7 @@ void DoSineWaveFloor(void) wal = sect->firstWall() + 2; //Pass (Sector, x, y, z) - alignflorslope(sect,wal->pos.X,wal->y, wal->nextSector()->floorz); + alignflorslope(sect,wal->pos.X,wal->pos.Y, wal->nextSector()->floorz); } } } @@ -2507,7 +2507,7 @@ void DoSineWaveWall(void) else { New = sw->orig_xy + MulScale(sw->range, bsin(sw->sintable_ndx), 14); - dragpoint(wal, New, wal->y); + dragpoint(wal, New, wal->pos.Y); } } } diff --git a/source/games/sw/src/slidor.cpp b/source/games/sw/src/slidor.cpp index b821598b5..449e59ed7 100644 --- a/source/games/sw/src/slidor.cpp +++ b/source/games/sw/src/slidor.cpp @@ -297,17 +297,17 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt) if (!wal->twoSided()) { // white wall - move 4 points - wal->move(wal->pos.X - amt, wal->y); - pwal->move(pwal->pos.X - amt, pwal->y); - wal->point2Wall()->move(wal->point2Wall()->pos.X - amt, wal->point2Wall()->y); + wal->move(wal->pos.X - amt, wal->pos.Y); + pwal->move(pwal->pos.X - amt, pwal->pos.Y); + wal->point2Wall()->move(wal->point2Wall()->pos.X - amt, wal->point2Wall()->pos.Y); auto pwal2 = wal->point2Wall()->point2Wall(); - pwal2->move(pwal2->pos.X - amt, pwal2->y); + pwal2->move(pwal2->pos.X - amt, pwal2->pos.Y); } else { // red wall - move 2 points - dragpoint(wal, wal->pos.X - amt, wal->y); - dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X - amt, wal->point2Wall()->y); + dragpoint(wal, wal->pos.X - amt, wal->pos.Y); + dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X - amt, wal->point2Wall()->pos.Y); } break; @@ -322,17 +322,17 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt) if (!wal->twoSided()) { // white wall - move 4 points - wal->move(wal->pos.X + amt, wal->y); - pwal->move(pwal->pos.X + amt, pwal->y); - wal->point2Wall()->move(wal->point2Wall()->pos.X + amt, wal->point2Wall()->y); + wal->move(wal->pos.X + amt, wal->pos.Y); + pwal->move(pwal->pos.X + amt, pwal->pos.Y); + wal->point2Wall()->move(wal->point2Wall()->pos.X + amt, wal->point2Wall()->pos.Y); auto pwal2 = wal->point2Wall()->point2Wall(); - pwal2->move(pwal2->pos.X + amt, pwal2->y); + pwal2->move(pwal2->pos.X + amt, pwal2->pos.Y); } else { // red wall - move 2 points - dragpoint(wal, wal->pos.X + amt, wal->y); - dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X + amt, wal->point2Wall()->y); + dragpoint(wal, wal->pos.X + amt, wal->pos.Y); + dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X + amt, wal->point2Wall()->pos.Y); } break; @@ -346,16 +346,16 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt) if (!wal->twoSided()) { - wal->move(wal->pos.X, wal->y - amt); - pwal->move(pwal->pos.X, pwal->y - amt); - wal->point2Wall()->move(wal->point2Wall()->pos.X, wal->point2Wall()->y - amt); + wal->move(wal->pos.X, wal->pos.Y - amt); + pwal->move(pwal->pos.X, pwal->pos.Y - amt); + wal->point2Wall()->move(wal->point2Wall()->pos.X, wal->point2Wall()->pos.Y - amt); auto pwal2 = wal->point2Wall()->point2Wall(); - pwal2->move(pwal2->pos.X, pwal2->y - amt); + pwal2->move(pwal2->pos.X, pwal2->pos.Y - amt); } else { - dragpoint(wal, wal->pos.X, wal->y - amt); - dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X, wal->point2Wall()->y - amt); + dragpoint(wal, wal->pos.X, wal->pos.Y - amt); + dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X, wal->point2Wall()->pos.Y - amt); } break; @@ -369,16 +369,16 @@ int DoSlidorMoveWalls(DSWActor* actor, int amt) if (!wal->twoSided()) { - wal->move(wal->pos.X, wal->y + amt); - pwal->move(pwal->pos.X, pwal->y + amt); - wal->point2Wall()->move(wal->point2Wall()->pos.X, wal->point2Wall()->y + amt); + wal->move(wal->pos.X, wal->pos.Y + amt); + pwal->move(pwal->pos.X, pwal->pos.Y + amt); + wal->point2Wall()->move(wal->point2Wall()->pos.X, wal->point2Wall()->pos.Y + amt); auto pwal2 = wal->point2Wall()->point2Wall(); - pwal2->move(pwal2->pos.X, pwal2->y + amt); + pwal2->move(pwal2->pos.X, pwal2->pos.Y + amt); } else { - dragpoint(wal, wal->pos.X, wal->y + amt); - dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X, wal->point2Wall()->y + amt); + dragpoint(wal, wal->pos.X, wal->pos.Y + amt); + dragpoint(wal->point2Wall(), wal->point2Wall()->pos.X, wal->point2Wall()->pos.Y + amt); } @@ -416,12 +416,12 @@ int DoSlidorInstantClose(DSWActor* actor) break; case TAG_WALL_SLIDOR_UP: - diff = wal->y - sp->y; + diff = wal->pos.Y - sp->y; DoSlidorMoveWalls(actor, diff); break; case TAG_WALL_SLIDOR_DOWN: - diff = wal->y - sp->y; + diff = wal->pos.Y - sp->y; DoSlidorMoveWalls(actor, -diff); break; } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 62616c618..09ab2e2d1 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1513,7 +1513,7 @@ void PreMapCombineFloors(void) for (auto& wal : wallsofsector(dasect)) { - wal.move(wal.pos.X + dx, wal.y + dy); + wal.move(wal.pos.X + dx, wal.pos.Y + dy); if (wal.twoSided()) search.Add(wal.nextSector()); @@ -2196,7 +2196,7 @@ void SpriteSetup(void) for(auto& wal : wallsofsector(sp->sector())) { u->rotator->origX[wallcount] = wal.pos.X; - u->rotator->origY[wallcount] = wal.y; + u->rotator->origY[wallcount] = wal.pos.Y; wallcount++; } diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index e4618d184..53d24a4e6 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -790,7 +790,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop) for(auto& wal : wallsofsector(sect)) { // all walls have to be in bounds to be in sector object - if (!(wal.pos.X > xlow && wal.pos.X < xhigh && wal.y > ylow && wal.y < yhigh)) + if (!(wal.pos.X > xlow && wal.pos.X < xhigh && wal.pos.Y > ylow && wal.pos.Y < yhigh)) { SectorInBounds = false; break; @@ -1459,7 +1459,7 @@ void PlaceSectorObjectsOnTracks(void) for (auto& wal : wallsofsector(sop->sectp[j])) { sop->xorig[sop->num_walls] = sop->xmid - wal.pos.X; - sop->yorig[sop->num_walls] = sop->ymid - wal.y; + sop->yorig[sop->num_walls] = sop->ymid - wal.pos.Y; sop->num_walls++; } } @@ -1688,11 +1688,11 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny) if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER)) { - dragpoint(&wal, wal.pos.X + nx, wal.y + ny); + dragpoint(&wal, wal.pos.X + nx, wal.pos.Y + ny); } else { - wal.move(wal.pos.X + nx, wal.y + ny); + wal.move(wal.pos.X + nx, wal.pos.Y + ny); } rot_ang = delta_ang; diff --git a/source/games/sw/src/wallmove.cpp b/source/games/sw/src/wallmove.cpp index cd608bc24..f64540b53 100644 --- a/source/games/sw/src/wallmove.cpp +++ b/source/games/sw/src/wallmove.cpp @@ -104,7 +104,7 @@ int DoWallMove(DSWActor* actor) for(auto& wal : wall) { - if (wal.pos.X == sp->x && wal.y == sp->y) + if (wal.pos.X == sp->x && wal.pos.Y == sp->y) { found = true; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index d5c187e99..ef682fec1 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -7316,7 +7316,7 @@ void TraverseBreakableWalls(sectortype* start_sect, int x, int y, int z, short a { // find midpoint xmid = (wal.pos.X + wal.point2Wall()->pos.X) >> 1; - ymid = (wal.y + wal.point2Wall()->y) >> 1; + ymid = (wal.pos.Y + wal.point2Wall()->pos.Y) >> 1; // don't need to go further if wall is too far out