From 3c9cd926ba3d5beef0ae502aba7255c1de7c77a2 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 22 Dec 2021 20:26:51 +1100 Subject: [PATCH] - Capitalise `vec2_t` `x` variable. --- source/build/include/build.h | 4 +- source/build/src/clip.cpp | 250 +++++++++--------- source/build/src/engine.cpp | 46 ++-- source/build/src/polymost.cpp | 88 +++--- source/core/automap.cpp | 8 +- source/core/gamecontrol.cpp | 14 +- source/core/gamefuncs.cpp | 14 +- source/core/gamehud.cpp | 4 +- source/core/gameinput.cpp | 4 +- source/core/intvec.h | 18 +- source/core/maploader.cpp | 8 +- source/core/maptypes.h | 2 +- source/core/rendering/hw_entrypoint.cpp | 2 +- source/core/rendering/hw_sections.cpp | 22 +- .../core/rendering/scene/hw_bunchdrawer.cpp | 6 +- source/core/rendering/scene/hw_drawinfo.cpp | 2 +- source/core/rendering/scene/hw_flats.cpp | 6 +- source/core/rendering/scene/hw_portal.cpp | 4 +- source/core/rendering/scene/hw_walls.cpp | 18 +- source/core/sectorgeometry.cpp | 2 +- source/games/blood/src/gameutil.cpp | 16 +- source/games/blood/src/sbar.cpp | 12 +- source/games/blood/src/triggers.cpp | 14 +- source/games/blood/src/view.cpp | 6 +- source/games/duke/src/actors.cpp | 8 +- source/games/duke/src/game_misc.cpp | 2 +- source/games/duke/src/inlines.h | 2 +- source/games/duke/src/input.cpp | 2 +- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/player_d.cpp | 4 +- source/games/duke/src/player_r.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/duke/src/savegame.cpp | 2 +- source/games/duke/src/sbar.cpp | 12 +- source/games/duke/src/sectors_d.cpp | 2 +- source/games/duke/src/sectors_r.cpp | 6 +- source/games/duke/src/spawn.cpp | 8 +- source/games/exhumed/src/lighting.cpp | 2 +- source/games/exhumed/src/map.cpp | 4 +- source/games/exhumed/src/move.cpp | 2 +- source/games/exhumed/src/status.cpp | 12 +- source/games/sw/src/mclip.cpp | 14 +- source/games/sw/src/rotator.cpp | 2 +- source/games/sw/src/sbar.cpp | 12 +- source/games/sw/src/track.cpp | 4 +- source/glbackend/glbackend.cpp | 2 +- 46 files changed, 339 insertions(+), 339 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index fc3f9f4af..f9c97fe20 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -308,7 +308,7 @@ inline int32_t ksqrt(uint64_t num) int32_t getangle(int32_t xvect, int32_t yvect); inline int32_t getangle(const vec2_t& vec) { - return getangle(vec.x, vec.y); + return getangle(vec.X, vec.y); } inline constexpr uint32_t uhypsq(int32_t const dx, int32_t const dy) @@ -334,7 +334,7 @@ inline void getcorrectzsofslope(int sectnum, int32_t dax, int32_t day, int32_t * { vec2_t closest = { dax, day }; getsectordist(closest, sectnum, &closest); - getzsofslopeptr((usectorptr_t)§or[sectnum], closest.x, closest.y, ceilz, florz); + getzsofslopeptr((usectorptr_t)§or[sectnum], closest.X, closest.y, ceilz, florz); } void alignceilslope(sectortype* dasect, int32_t x, int32_t y, int32_t z); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 41e7c3c12..6c81bc3ec 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -83,23 +83,23 @@ static inline void get_floorspr_points(spritetype const * const spr, int32_t px, int32_t const ratio = ksqrt(heinum * heinum + 4096 * 4096); if (spr->cstat & CSTAT_SPRITE_XFLIP) - adjofs.x = -adjofs.x; + adjofs.X = -adjofs.X; if (spr->cstat & CSTAT_SPRITE_YFLIP) adjofs.y = -adjofs.y; - vec2_t const center = { ((span.x >> 1) + adjofs.x) * repeat.x, ((span.y >> 1) + adjofs.y) * repeat.y }; - vec2_t const rspan = { span.x * repeat.x, span.y * repeat.y }; + vec2_t const center = { ((span.X >> 1) + adjofs.X) * repeat.X, ((span.y >> 1) + adjofs.y) * repeat.y }; + vec2_t const rspan = { span.X * repeat.X, span.y * repeat.y }; vec2_t const ofs = { -DivScale(MulScale(cosang, rspan.y, 16), ratio, 12), -DivScale(MulScale(sinang, rspan.y, 16), ratio, 12) }; vec2_t const cossinslope = { DivScale(cosang, ratio, 12), DivScale(sinang, ratio, 12) }; - *x1 += DMulScale(sinang, center.x, cossinslope.x, center.y, 16) - px; - *y1 += DMulScale(cossinslope.y, center.y, -cosang, center.x, 16) - py; + *x1 += DMulScale(sinang, center.X, cossinslope.X, center.y, 16) - px; + *y1 += DMulScale(cossinslope.y, center.y, -cosang, center.X, 16) - py; - *x2 = *x1 - MulScale(sinang, rspan.x, 16); - *y2 = *y1 + MulScale(cosang, rspan.x, 16); + *x2 = *x1 - MulScale(sinang, rspan.X, 16); + *y2 = *y1 + MulScale(cosang, rspan.X, 16); - *x3 = *x2 + ofs.x, *x4 = *x1 + ofs.x; + *x3 = *x2 + ofs.X, *x4 = *x1 + ofs.X; *y3 = *y2 + ofs.y, *y4 = *y1 + ofs.y; } @@ -113,24 +113,24 @@ 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->x + walldist - vect->x, wal1->y + walldist - vect->y }; - vec2_t v2 = { wal2->x + walldist - vect->x, wal2->y + walldist - vect->y }; + vec2_t const v1 = { wal1->x + walldist - vect->X, wal1->y + walldist - vect->y }; + vec2_t v2 = { wal2->x + walldist - vect->X, wal2->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; - v2.x -= v1.x; v2.y -= v1.y; + v2.X -= v1.X; v2.y -= v1.y; - if (v2.x * (walldist - v1.y) >= v2.y * (walldist - v1.x)) // Front + if (v2.X * (walldist - v1.y) >= v2.y * (walldist - v1.X)) // Front { - v2.x *= ((v2.x > 0) ? (0 - v1.y) : (r - v1.y)); - v2.y *= ((v2.y > 0) ? (r - v1.x) : (0 - v1.x)); - return v2.x < v2.y; + v2.X *= ((v2.X > 0) ? (0 - v1.y) : (r - v1.y)); + v2.y *= ((v2.y > 0) ? (r - v1.X) : (0 - v1.X)); + return v2.X < v2.y; } - v2.x *= ((v2.x > 0) ? (r - v1.y) : (0 - v1.y)); - v2.y *= ((v2.y > 0) ? (0 - v1.x) : (r - v1.x)); - return (v2.x >= v2.y) << 1; + v2.X *= ((v2.X > 0) ? (r - v1.y) : (0 - v1.y)); + v2.y *= ((v2.y > 0) ? (0 - v1.X) : (r - v1.X)); + return (v2.X >= v2.y) << 1; } static int32_t spriteGetZOfSlope(const spritetype* spr, int32_t dax, int32_t day) @@ -237,13 +237,13 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl break; default: { - int32_t daz = getflorzofslopeptr(§or[dasect], pos.x, pos.y); - int32_t daz2 = getflorzofslopeptr(sec2, pos.x, pos.y); + int32_t daz = getflorzofslopeptr(§or[dasect], pos.X, pos.y); + int32_t daz2 = getflorzofslopeptr(sec2, pos.X, pos.y); if (daz2 < daz-(1<<8) && (sec2->floorstat & CSTAT_SECTOR_SKY) == 0) if (posz >= daz2-(flordist-1)) return 1; - daz = getceilzofslopeptr(§or[dasect], pos.x, pos.y); - daz2 = getceilzofslopeptr(sec2, pos.x, pos.y); + daz = getceilzofslopeptr(§or[dasect], pos.X, pos.y); + daz2 = getceilzofslopeptr(sec2, pos.X, pos.y); if (daz2 > daz+(1<<8) && (sec2->ceilingstat & CSTAT_SECTOR_SKY) == 0) if (posz <= daz2+(ceildist-1)) return 1; @@ -255,7 +255,7 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl int32_t dacz2 = sec2->ceilingz; if ((sec2->floorstat|sec2->ceilingstat) & CSTAT_SECTOR_SLOPE) - getcorrectzsofslope(nextsect, pos.x, pos.y, &dacz2, &daz2); + getcorrectzsofslope(nextsect, pos.X, pos.y, &dacz2, &daz2); if (daz2 <= dacz2) return 1; @@ -266,7 +266,7 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl int32_t dacz = sec->ceilingz; if ((sec->floorstat|sec->ceilingstat) & CSTAT_SECTOR_SLOPE) - getcorrectzsofslope(dasect, pos.x, pos.y, &dacz, &daz); + getcorrectzsofslope(dasect, pos.X, pos.y, &dacz, &daz); int32_t const sec2height = abs(daz2-dacz2); @@ -293,19 +293,19 @@ static inline int32_t cliptrace(vec2_t const pos, vec2_t * const goal) { vec2_t const p1 = { clipit[z].x1, clipit[z].y1 }; vec2_t const p2 = { clipit[z].x2, clipit[z].y2 }; - vec2_t const area = { p2.x-p1.x, p2.y-p1.y }; + vec2_t const area = { p2.X-p1.X, p2.y-p1.y }; - int32_t topu = area.x*(pos.y-p1.y) - (pos.x-p1.x)*area.y; + int32_t topu = area.X*(pos.y-p1.y) - (pos.X-p1.X)*area.y; - if (topu <= 0 || area.x*(goal->y-p1.y) > (goal->x-p1.x)*area.y) + if (topu <= 0 || area.X*(goal->y-p1.y) > (goal->X-p1.X)*area.y) continue; - vec2_t const diff = { goal->x-pos.x, goal->y-pos.y }; + vec2_t const diff = { goal->X-pos.X, goal->y-pos.y }; - if (diff.x*(p1.y-pos.y) > (p1.x-pos.x)*diff.y || diff.x*(p2.y-pos.y) <= (p2.x-pos.x)*diff.y) + if (diff.X*(p1.y-pos.y) > (p1.X-pos.X)*diff.y || diff.X*(p2.y-pos.y) <= (p2.X-pos.X)*diff.y) continue; - int32_t const bot = diff.x*area.y - area.x*diff.y; + int32_t const bot = diff.X*area.y - area.X*diff.y; int cnt = 256; if (!bot) @@ -321,11 +321,11 @@ static inline int32_t cliptrace(vec2_t const pos, vec2_t * const goal) return z; } - n = { pos.x+Scale(diff.x, topu, bot), pos.y+Scale(diff.y, topu, bot) }; + n = { pos.X+Scale(diff.X, topu, bot), pos.y+Scale(diff.y, topu, bot) }; topu--; - } while (area.x*(n.y-p1.y) <= (n.x-p1.x)*area.y); + } while (area.X*(n.y-p1.y) <= (n.X-p1.X)*area.y); - if (abs(pos.x-n.x)+abs(pos.y-n.y) < abs(pos.x-goal->x)+abs(pos.y-goal->y)) + if (abs(pos.X-n.X)+abs(pos.y-n.y) < abs(pos.X-goal->X)+abs(pos.y-goal->y)) { *goal = n; hitwall = z; @@ -366,23 +366,23 @@ static int get_floorspr_clipyou(vec2_t const v1, vec2_t const v2, vec2_t const v if ((v1.y^v2.y) < 0) { - if ((v1.x^v2.x) < 0) clipyou ^= (v1.x*v2.y < v2.x*v1.y)^(v1.y= 0) clipyou ^= 1; + if ((v1.X^v2.X) < 0) clipyou ^= (v1.X*v2.y < v2.X*v1.y)^(v1.y= 0) clipyou ^= 1; } if ((v2.y^v3.y) < 0) { - if ((v2.x^v3.x) < 0) clipyou ^= (v2.x*v3.y < v3.x*v2.y)^(v2.y= 0) clipyou ^= 1; + if ((v2.X^v3.X) < 0) clipyou ^= (v2.X*v3.y < v3.X*v2.y)^(v2.y= 0) clipyou ^= 1; } if ((v3.y^v4.y) < 0) { - if ((v3.x^v4.x) < 0) clipyou ^= (v3.x*v4.y < v4.x*v3.y)^(v3.y= 0) clipyou ^= 1; + if ((v3.X^v4.X) < 0) clipyou ^= (v3.X*v4.y < v4.X*v3.y)^(v3.y= 0) clipyou ^= 1; } if ((v4.y^v1.y) < 0) { - if ((v4.x^v1.x) < 0) clipyou ^= (v4.x*v1.y < v1.x*v4.y)^(v4.y= 0) clipyou ^= 1; + if ((v4.X^v1.X) < 0) clipyou ^= (v4.X*v1.y < v1.X*v4.y)^(v4.y= 0) clipyou ^= 1; } return clipyou; @@ -398,14 +398,14 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist } #endif - if (inside_p(pos.x, pos.y, *sectnum)) + if (inside_p(pos.X, pos.y, *sectnum)) return; int16_t nsecs = min(getsectordist(pos, *sectnum), INT16_MAX); if (nsecs > (walldist + 8)) { - Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", __func__, pos.x, pos.y, *sectnum, nsecs); + Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", __func__, pos.X, pos.y, *sectnum, nsecs); walldist = 0x7fff; } @@ -414,7 +414,7 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist for (unsigned listsectnum; (listsectnum = search.GetNext()) != BFSSearch::EOL;) { - if (inside_p(pos.x, pos.y, listsectnum)) + if (inside_p(pos.X, pos.y, listsectnum)) { *sectnum = listsectnum; return; @@ -433,7 +433,7 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist for (unsigned listsectnum; (listsectnum = search.GetNext()) != BFSSearch::EOL;) { - if (inside_p(pos.x, pos.y, listsectnum)) + if (inside_p(pos.X, pos.y, listsectnum)) { *sectnum = listsectnum; return; @@ -468,13 +468,13 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, vec2_t const move = { xvect, yvect }; vec2_t goal = { pos->x + (xvect >> 14), pos->y + (yvect >> 14) }; - vec2_t const cent = { (pos->x + goal.x) >> 1, (pos->y + goal.y) >> 1 }; + vec2_t const cent = { (pos->x + goal.X) >> 1, (pos->y + goal.y) >> 1 }; //Extra walldist for sprites on sector lines - vec2_t const diff = { goal.x - (pos->x), goal.y - (pos->y) }; - int32_t const rad = ksqrt(compat_maybe_truncate_to_int32(uhypsq(diff.x, diff.y))) + MAXCLIPDIST + walldist + 8; - vec2_t const clipMin = { cent.x - rad, cent.y - rad }; - vec2_t const clipMax = { cent.x + rad, cent.y + rad }; + vec2_t const diff = { goal.X - (pos->x), goal.y - (pos->y) }; + int32_t const rad = ksqrt(compat_maybe_truncate_to_int32(uhypsq(diff.X, diff.y))) + MAXCLIPDIST + walldist + 8; + vec2_t const clipMin = { cent.X - rad, cent.y - rad }; + vec2_t const clipMax = { cent.X + rad, cent.y + rad }; int clipsectcnt = 0; int clipspritecnt = 0; @@ -507,21 +507,21 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { auto const wal2 = (uwallptr_t)wal->point2Wall(); - if ((wal->x < clipMin.x && wal2->x < clipMin.x) || (wal->x > clipMax.x && wal2->x > clipMax.x) || + if ((wal->x < clipMin.X && wal2->x < clipMin.X) || (wal->x > clipMax.X && wal2->x > clipMax.X) || (wal->y < clipMin.y && wal2->y < clipMin.y) || (wal->y > clipMax.y && wal2->y > clipMax.y)) continue; vec2_t p1 = wal->pos; vec2_t p2 = wal2->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) continue; //If wall's not facing you - vec2_t const r = { (d.y > 0) ? clipMax.x : clipMin.x, (d.x > 0) ? clipMin.y : clipMax.y }; - vec2_t v = { d.x * (r.y - p1.y), d.y * (r.x - p1.x) }; + vec2_t const r = { (d.y > 0) ? clipMax.X : clipMin.X, (d.X > 0) ? clipMin.y : clipMax.y }; + vec2_t v = { d.X * (r.y - p1.y), d.y * (r.X - p1.X) }; - if (v.x >= v.y) + if (v.X >= v.y) continue; int clipyou = 0; @@ -532,7 +532,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, } else { - clipmove_tweak_pos(pos, diff.x, diff.y, p1.x, p1.y, p2.x, p2.y, &v.x, &v.y); + clipmove_tweak_pos(pos, diff.X, diff.y, p1.X, p1.y, p2.X, p2.y, &v.X, &v.y); clipyou = cliptestsector(dasect, wal->nextsector, flordist, ceildist, v, pos->z); } @@ -555,20 +555,20 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, else objtype.setWall(j); //Add 2 boxes at endpoints - int32_t bsz = walldist; if (diff.x < 0) bsz = -bsz; - addclipline(p1.x-bsz, p1.y-bsz, p1.x-bsz, p1.y+bsz, objtype, false); - addclipline(p2.x-bsz, p2.y-bsz, p2.x-bsz, p2.y+bsz, objtype, false); + int32_t bsz = walldist; if (diff.X < 0) bsz = -bsz; + addclipline(p1.X-bsz, p1.y-bsz, p1.X-bsz, p1.y+bsz, objtype, false); + addclipline(p2.X-bsz, p2.y-bsz, p2.X-bsz, p2.y+bsz, objtype, false); bsz = walldist; if (diff.y < 0) bsz = -bsz; - addclipline(p1.x+bsz, p1.y-bsz, p1.x-bsz, p1.y-bsz, objtype, false); - addclipline(p2.x+bsz, p2.y-bsz, p2.x-bsz, p2.y-bsz, objtype, false); + addclipline(p1.X+bsz, p1.y-bsz, p1.X-bsz, p1.y-bsz, objtype, false); + addclipline(p2.X+bsz, p2.y-bsz, p2.X-bsz, p2.y-bsz, objtype, false); - v.x = walldist; if (d.y > 0) v.x = -v.x; - v.y = walldist; if (d.x < 0) v.y = -v.y; + v.X = walldist; if (d.y > 0) v.X = -v.X; + v.y = walldist; if (d.X < 0) v.y = -v.y; - if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && d.x * (pos->y-p1.y-v.y) < (pos->x-p1.x-v.x) * d.y) - v.x >>= 1, v.y >>= 1; + if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && d.X * (pos->y-p1.y-v.y) < (pos->x-p1.X-v.X) * d.y) + v.X >>= 1, v.y >>= 1; - addclipline(p1.x+v.x, p1.y+v.y, p2.x+v.x, p2.y+v.y, objtype, false); + addclipline(p1.X+v.X, p1.y+v.y, p2.X+v.X, p2.y+v.y, objtype, false); } else if (wal->nextsector>=0) { @@ -605,18 +605,18 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, switch (cstat & (CSTAT_SPRITE_ALIGNMENT_MASK)) { case CSTAT_SPRITE_ALIGNMENT_FACING: - if (p1.x >= clipMin.x && p1.x <= clipMax.x && p1.y >= clipMin.y && p1.y <= clipMax.y) + if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.y >= clipMin.y && p1.y <= clipMax.y) { int32_t height, daz = spr->z+spriteheightofsptr(spr, &height, 1); if (pos->z > daz-height-flordist && pos->z < daz+ceildist) { int32_t bsz = (spr->clipdist << 2)+walldist; - if (diff.x < 0) bsz = -bsz; - addclipline(p1.x-bsz, p1.y-bsz, p1.x-bsz, p1.y+bsz, obj, false); + if (diff.X < 0) bsz = -bsz; + addclipline(p1.X-bsz, p1.y-bsz, p1.X-bsz, p1.y+bsz, obj, false); bsz = (spr->clipdist << 2)+walldist; if (diff.y < 0) bsz = -bsz; - addclipline(p1.x+bsz, p1.y-bsz, p1.x-bsz, p1.y-bsz, obj, false); + addclipline(p1.X+bsz, p1.y-bsz, p1.X-bsz, p1.y-bsz, obj, false); } } break; @@ -629,27 +629,27 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { vec2_t p2; - get_wallspr_points(spr, &p1.x, &p2.x, &p1.y, &p2.y); + get_wallspr_points(spr, &p1.X, &p2.X, &p1.y, &p2.y); - if (clipinsideboxline(cent.x, cent.y, p1.x, p1.y, p2.x, p2.y, rad) != 0) + if (clipinsideboxline(cent.X, cent.y, p1.X, p1.y, p2.X, p2.y, rad) != 0) { vec2_t v = { MulScale(bcos(spr->ang + 256), walldist, 14), MulScale(bsin(spr->ang + 256), walldist, 14) }; - if ((p1.x-pos->x) * (p2.y-pos->y) >= (p2.x-pos->x) * (p1.y-pos->y)) // Front - addclipline(p1.x+v.x, p1.y+v.y, p2.x+v.y, p2.y-v.x, obj, false); + if ((p1.X-pos->x) * (p2.y-pos->y) >= (p2.X-pos->x) * (p1.y-pos->y)) // Front + addclipline(p1.X+v.X, p1.y+v.y, p2.X+v.y, p2.y-v.X, obj, false); else { if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) continue; - addclipline(p2.x-v.x, p2.y-v.y, p1.x-v.y, p1.y+v.x, obj, false); + addclipline(p2.X-v.X, p2.y-v.y, p1.X-v.y, p1.y+v.X, obj, false); } //Side blocker - if ((p2.x-p1.x) * (pos->x-p1.x)+(p2.y-p1.y) * (pos->y-p1.y) < 0) - addclipline(p1.x-v.y, p1.y+v.x, p1.x+v.x, p1.y+v.y, obj, true); - else if ((p1.x-p2.x) * (pos->x-p2.x)+(p1.y-p2.y) * (pos->y-p2.y) < 0) - addclipline(p2.x+v.y, p2.y-v.x, p2.x-v.x, p2.y-v.y, obj, true); + if ((p2.X-p1.X) * (pos->x-p1.X)+(p2.y-p1.y) * (pos->y-p1.y) < 0) + addclipline(p1.X-v.y, p1.y+v.X, p1.X+v.X, p1.y+v.y, obj, true); + else if ((p1.X-p2.X) * (pos->x-p2.X)+(p1.y-p2.y) * (pos->y-p2.y) < 0) + addclipline(p2.X+v.y, p2.y-v.X, p2.X-v.X, p2.y-v.y, obj, true); } } break; @@ -677,7 +677,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if ((pos->z > sz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) continue; - rxi[0] = p1.x; + rxi[0] = p1.X; ryi[0] = p1.y; get_floorspr_points(spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3], @@ -688,24 +688,24 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if ((rxi[0]-pos->x) * (ryi[1]-pos->y) < (rxi[1]-pos->x) * (ryi[0]-pos->y)) { - if (clipinsideboxline(cent.x, cent.y, rxi[1], ryi[1], rxi[0], ryi[0], rad) != 0) - addclipline(rxi[1]-v.y, ryi[1]+v.x, rxi[0]+v.x, ryi[0]+v.y, obj, false); + if (clipinsideboxline(cent.X, cent.y, rxi[1], ryi[1], rxi[0], ryi[0], rad) != 0) + addclipline(rxi[1]-v.y, ryi[1]+v.X, rxi[0]+v.X, ryi[0]+v.y, obj, false); } else if ((rxi[2]-pos->x) * (ryi[3]-pos->y) < (rxi[3]-pos->x) * (ryi[2]-pos->y)) { - if (clipinsideboxline(cent.x, cent.y, rxi[3], ryi[3], rxi[2], ryi[2], rad) != 0) - addclipline(rxi[3]+v.y, ryi[3]-v.x, rxi[2]-v.x, ryi[2]-v.y, obj, false); + if (clipinsideboxline(cent.X, cent.y, rxi[3], ryi[3], rxi[2], ryi[2], rad) != 0) + addclipline(rxi[3]+v.y, ryi[3]-v.X, rxi[2]-v.X, ryi[2]-v.y, obj, false); } if ((rxi[1]-pos->x) * (ryi[2]-pos->y) < (rxi[2]-pos->x) * (ryi[1]-pos->y)) { - if (clipinsideboxline(cent.x, cent.y, rxi[2], ryi[2], rxi[1], ryi[1], rad) != 0) - addclipline(rxi[2]-v.x, ryi[2]-v.y, rxi[1]-v.y, ryi[1]+v.x, obj, false); + if (clipinsideboxline(cent.X, cent.y, rxi[2], ryi[2], rxi[1], ryi[1], rad) != 0) + addclipline(rxi[2]-v.X, ryi[2]-v.y, rxi[1]-v.y, ryi[1]+v.X, obj, false); } else if ((rxi[3]-pos->x) * (ryi[0]-pos->y) < (rxi[0]-pos->x) * (ryi[3]-pos->y)) { - if (clipinsideboxline(cent.x, cent.y, rxi[0], ryi[0], rxi[3], ryi[3], rad) != 0) - addclipline(rxi[0]+v.x, ryi[0]+v.y, rxi[3]+v.y, ryi[3]-v.x, obj, false); + if (clipinsideboxline(cent.X, cent.y, rxi[0], ryi[0], rxi[3], ryi[3], rad) != 0) + addclipline(rxi[0]+v.X, ryi[0]+v.y, rxi[3]+v.y, ryi[3]-v.X, obj, false); } } @@ -721,14 +721,14 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, vec2_t adjofs = { tileLeftOffset(tilenum), tileTopOffset(tilenum) }; if (spr->cstat & CSTAT_SPRITE_XFLIP) - adjofs.x = -adjofs.x; + adjofs.X = -adjofs.X; if (spr->cstat & CSTAT_SPRITE_YFLIP) adjofs.y = -adjofs.y; - int32_t const centerx = ((span.x >> 1) + adjofs.x) * repeat.x; + int32_t const centerx = ((span.X >> 1) + adjofs.X) * repeat.X; int32_t const centery = ((span.y >> 1) + adjofs.y) * repeat.y; - int32_t const rspanx = span.x * repeat.x; + int32_t const rspanx = span.X * repeat.X; int32_t const rspany = span.y * repeat.y; int32_t const ratio = ksqrt(heinum * heinum + 4096 * 4096); int32_t zz[3] = { pos->z, pos->z + flordist, pos->z - ceildist }; @@ -746,17 +746,17 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, vec2_t const v = { MulScale(bcos(spr->ang - 256), walldist, 14), MulScale(bsin(spr->ang - 256), walldist, 14) }; - if (clipinsideboxline(cent.x, cent.y, x1, y1, x2, y2, rad) != 0) + if (clipinsideboxline(cent.X, cent.y, x1, y1, x2, y2, rad) != 0) { if ((x1 - pos->x) * (y2 - pos->y) >= (x2 - pos->x) * (y1 - pos->y)) { - addclipline(x1 + v.x, y1 + v.y, x2 + v.y, y2 - v.x, obj, false); + addclipline(x1 + v.X, y1 + v.y, x2 + v.y, y2 - v.X, obj, false); } else { if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) continue; - addclipline(x2 - v.x, y2 - v.y, x1 - v.y, y1 + v.x, obj, false); + addclipline(x2 - v.X, y2 - v.y, x1 - v.y, y1 + v.X, obj, false); } } } @@ -795,24 +795,24 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, vec2_t const clipr = { clipit[hitwall].x2 - clipit[hitwall].x1, clipit[hitwall].y2 - clipit[hitwall].y1 }; // clamp to the max value we can utilize without reworking the scaling below // this works around the overflow issue that affects dukedc2.map - int32_t const templl = (int32_t)clamp(compat_maybe_truncate_to_int32((int64_t)clipr.x * clipr.x + (int64_t)clipr.y * clipr.y), INT32_MIN, INT32_MAX); + int32_t const templl = (int32_t)clamp(compat_maybe_truncate_to_int32((int64_t)clipr.X * clipr.X + (int64_t)clipr.y * clipr.y), INT32_MIN, INT32_MAX); if (templl > 0) { // I don't know if this one actually overflows or not, but I highly doubt it hurts to check int32_t const templl2 - = (int32_t)clamp(compat_maybe_truncate_to_int32((int64_t)(goal.x - vec.x) * clipr.x + (int64_t)(goal.y - vec.y) * clipr.y), INT32_MIN, INT32_MAX); + = (int32_t)clamp(compat_maybe_truncate_to_int32((int64_t)(goal.X - vec.X) * clipr.X + (int64_t)(goal.y - vec.y) * clipr.y), INT32_MIN, INT32_MAX); int32_t const i = (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829 || (abs(templl2)>>11) < templl) ? (int)DivScaleL(templl2, templl, 20) : 0; - goal = { MulScale(clipr.x, i, 20)+vec.x, MulScale(clipr.y, i, 20)+vec.y }; + goal = { MulScale(clipr.X, i, 20)+vec.X, MulScale(clipr.y, i, 20)+vec.y }; } int32_t tempint; if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829) - tempint = clipr.x*(move.x>>6)+clipr.y*(move.y>>6); + tempint = clipr.X*(move.X>>6)+clipr.y*(move.y>>6); else - tempint = DMulScale(clipr.x, move.x, clipr.y, move.y, 6); + tempint = DMulScale(clipr.X, move.X, clipr.y, move.y, 6); for (int i=cnt+1, j; i<=clipmoveboxtracenum; ++i) { @@ -820,9 +820,9 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_t tempint2; if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829) - tempint2 = (clipit[j].x2-clipit[j].x1)*(move.x>>6)+(clipit[j].y2-clipit[j].y1)*(move.y>>6); + tempint2 = (clipit[j].x2-clipit[j].x1)*(move.X>>6)+(clipit[j].y2-clipit[j].y1)*(move.y>>6); else - tempint2 = DMulScale(clipit[j].x2-clipit[j].x1, move.x, clipit[j].y2-clipit[j].y1, move.y, 6); + tempint2 = DMulScale(clipit[j].x2-clipit[j].x1, move.X, clipit[j].y2-clipit[j].y1, move.y, 6); if ((tempint ^ tempint2) < 0) { @@ -832,8 +832,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, } } - keepaway(&goal.x, &goal.y, hitwall); - xvect = (goal.x-vec.x)<<14; + keepaway(&goal.X, &goal.y, hitwall); + xvect = (goal.X-vec.X)<<14; yvect = (goal.y-vec.y)<<14; if (cnt == clipmoveboxtracenum) @@ -846,7 +846,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, clipupdatesector(vec, sectnum, rad); } - pos->x = vec.x; + pos->x = vec.X; pos->y = vec.y; cnt--; } while ((xvect|yvect) != 0 && hitwall >= 0 && cnt > 0); @@ -1046,7 +1046,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) getsectordist(closest, sectnum, &closest); else - getzsofslopeptr(sect,closest.x,closest.y,ceilz,florz); + getzsofslopeptr(sect,closest.X,closest.y,ceilz,florz); ceilhit.setSector(sect); florhit.setSector(sect); @@ -1070,17 +1070,17 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas vec2_t const v1 = wal.pos; vec2_t const v2 = wal.point2Wall()->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)) continue; - vec2_t const d = { v2.x-v1.x, v2.y-v1.y }; - if (d.x*(pos.y-v1.y) < (pos.x-v1.x)*d.y) continue; //back + vec2_t const d = { v2.X-v1.X, v2.y-v1.y }; + if (d.X*(pos.y-v1.y) < (pos.x-v1.X)*d.y) continue; //back - vec2_t da = { (d.x > 0) ? d.x*(ymin-v1.y) : d.x*(ymax-v1.y), - (d.y > 0) ? d.y*(xmax-v1.x) : d.y*(xmin-v1.x) }; + vec2_t da = { (d.X > 0) ? d.X*(ymin-v1.y) : d.X*(ymax-v1.y), + (d.y > 0) ? d.y*(xmax-v1.X) : d.y*(xmin-v1.X) }; - if (da.x >= da.y) + if (da.X >= da.y) continue; if (wal.cstat & EWallFlags::FromInt(dawalclipmask)) continue; // XXX? @@ -1092,15 +1092,15 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (!clipsectormap[nextsectno]) addclipsect(nextsectno); - if (((v1.x < xmin + MAXCLIPDIST) && (v2.x < xmin + MAXCLIPDIST)) || - ((v1.x > xmax - MAXCLIPDIST) && (v2.x > xmax - MAXCLIPDIST)) || + if (((v1.X < xmin + MAXCLIPDIST) && (v2.X < xmin + MAXCLIPDIST)) || + ((v1.X > xmax - MAXCLIPDIST) && (v2.X > xmax - MAXCLIPDIST)) || ((v1.y < ymin + MAXCLIPDIST) && (v2.y < ymin + MAXCLIPDIST)) || ((v1.y > ymax - MAXCLIPDIST) && (v2.y > ymax - MAXCLIPDIST))) continue; - if (d.x > 0) da.x += d.x*MAXCLIPDIST; else da.x -= d.x*MAXCLIPDIST; + if (d.X > 0) da.X += d.X*MAXCLIPDIST; else da.X -= d.X*MAXCLIPDIST; if (d.y > 0) da.y -= d.y*MAXCLIPDIST; else da.y += d.y*MAXCLIPDIST; - if (da.x >= da.y) + if (da.X >= da.y) continue; //It actually got here, through all the continue's!!! int32_t daz = 0, daz2 = 0; @@ -1108,7 +1108,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) getsectordist(closest, nextsectno, &closest); else - getzsofslopeptr(nextsect, closest.x,closest.y, &daz,&daz2); + getzsofslopeptr(nextsect, closest.X,closest.y, &daz,&daz2); { if (daz > *ceilz) @@ -1148,7 +1148,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas case CSTAT_SPRITE_ALIGNMENT_FACING: { int32_t k = walldist+(spr->clipdist<<2)+1; - if ((abs(v1.x-pos.x) <= k) && (abs(v1.y-pos.y) <= k)) + if ((abs(v1.X-pos.x) <= k) && (abs(v1.y-pos.y) <= k)) { daz = spr->z + spriteheightofsptr(spr, &k, 1); daz2 = daz - k; @@ -1160,9 +1160,9 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas case CSTAT_SPRITE_ALIGNMENT_WALL: { vec2_t v2; - get_wallspr_points(spr, &v1.x, &v2.x, &v1.y, &v2.y); + get_wallspr_points(spr, &v1.X, &v2.X, &v1.y, &v2.y); - if (clipinsideboxline(pos.x,pos.y,v1.x,v1.y,v2.x,v2.y,walldist+1) != 0) + if (clipinsideboxline(pos.x,pos.y,v1.X,v1.y,v2.X,v2.y,walldist+1) != 0) { int32_t k; daz = spr->z + spriteheightofsptr(spr, &k, 1); @@ -1182,14 +1182,14 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas continue; vec2_t v2, v3, v4; - get_floorspr_points((uspriteptr_t) spr, pos.x, pos.y, &v1.x, &v2.x, &v3.x, &v4.x, + get_floorspr_points((uspriteptr_t) spr, pos.x, pos.y, &v1.X, &v2.X, &v3.X, &v4.X, &v1.y, &v2.y, &v3.y, &v4.y, spriteGetSlope(spr)); vec2_t const da = { MulScale(bcos(spr->ang - 256), walldist + 4, 14), MulScale(bsin(spr->ang - 256), walldist + 4, 14) }; - v1.x += da.x; v2.x -= da.y; v3.x -= da.x; v4.x += da.y; - v1.y += da.y; v2.y += da.x; v3.y -= da.y; v4.y -= da.x; + v1.X += da.X; v2.X -= da.y; v3.X -= da.X; v4.X += da.y; + v1.y += da.y; v2.y += da.X; v3.y -= da.y; v4.y -= da.X; clipyou = get_floorspr_clipyou(v1, v2, v3, v4); break; @@ -1241,7 +1241,7 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, int32_t const topu = vx * (sprpos.y - in.y) - vy * (sprpos.x - in.x); vec2_t const off = { Scale(vx, topu, bot), Scale(vy, topu, bot) }; - int32_t const dist = off.x * off.x + off.y * off.y; + int32_t const dist = off.X * off.X + off.y * off.y; siz = tileWidth(spr->picnum) * spr->xrepeat; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index f96d37f3a..a6a200c34 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -56,9 +56,9 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, { vec2_t const w = wall[dawall].pos; vec2_t const w2 = wall[dawall].point2Wall()->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); if (i <= 0) { @@ -66,7 +66,7 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, return; } - int64_t const j = (int64_t)d.x * d.x + (int64_t)d.y * d.y; + int64_t const j = (int64_t)d.X * d.X + (int64_t)d.y * d.y; if (i >= j) { @@ -76,7 +76,7 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, i = ((i << 15) / j) << 15; - *closest = { (int32_t)(w.x + ((d.x * i) >> 30)), (int32_t)(w.y + ((d.y * i) >> 30)) }; + *closest = { (int32_t)(w.X + ((d.X * i) >> 30)), (int32_t)(w.y + ((d.y * i) >> 30)) }; } int32_t xdimen = -1, xdimenscale, xdimscale; @@ -187,8 +187,8 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o const vec2_t originDiff = { lineStartX-originX, lineStartY-originY }; - const int32_t rayCrossLineVec = ray.x*lineVec.y - ray.y*lineVec.x; - const int32_t originDiffCrossRay = originDiff.x*ray.y - originDiff.y*ray.x; + const int32_t rayCrossLineVec = ray.X*lineVec.y - ray.y*lineVec.X; + const int32_t originDiffCrossRay = originDiff.X*ray.y - originDiff.y*ray.X; if (rayCrossLineVec == 0) { @@ -199,9 +199,9 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o } // line segments are collinear - const int32_t rayLengthSquared = ray.x*ray.x + ray.y*ray.y; - const int32_t rayDotOriginDiff = ray.x*originDiff.x + ray.y*originDiff.y; - const int32_t rayDotLineEndDiff = rayDotOriginDiff + ray.x*lineVec.x + ray.y*lineVec.y; + const int32_t rayLengthSquared = ray.X*ray.X + ray.y*ray.y; + const int32_t rayDotOriginDiff = ray.X*originDiff.X + ray.y*originDiff.y; + const int32_t rayDotLineEndDiff = rayDotOriginDiff + ray.X*lineVec.X + ray.y*lineVec.y; int64_t t = min(rayDotOriginDiff, rayDotLineEndDiff); if (rayDotOriginDiff < 0) { @@ -219,14 +219,14 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o } t = (t << 24) / rayLengthSquared; - *intersectionX = originX + MulScale(ray.x, t, 24); + *intersectionX = originX + MulScale(ray.X, t, 24); *intersectionY = originY + MulScale(ray.y, t, 24); *intersectionZ = originZ + MulScale(destZ-originZ, t, 24); return 1; } - const int32_t originDiffCrossLineVec = originDiff.x*lineVec.y - originDiff.y*lineVec.x; + const int32_t originDiffCrossLineVec = originDiff.X*lineVec.y - originDiff.y*lineVec.X; static const int32_t signBit = 1u<<31u; // Any point on either line can be expressed as p+t*r and q+u*s // The two line segments intersect when we can find a t & u such that p+t*r = q+u*s @@ -248,7 +248,7 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o int64_t t = (int64_t(originDiffCrossLineVec) << 24) / rayCrossLineVec; // For sake of completeness/readability, alternative to the above approach for an early out & avoidance of an extra division: - *intersectionX = originX + MulScale(ray.x, t, 24); + *intersectionX = originX + MulScale(ray.X, t, 24); *intersectionY = originY + MulScale(ray.y, t, 24); *intersectionZ = originZ + MulScale(destZ-originZ, t, 24); @@ -378,7 +378,7 @@ int32_t inside(int32_t x, int32_t y, const sectortype* sect) // y1 != y2 AND y_m <= y < y_M, // where y_m := min(y1, y2) and y_M := max(y1, y2). if ((v1.y^v2.y) < 0) - cnt ^= (((v1.x^v2.x) >= 0) ? v1.x : (v1.x*v2.y-v2.x*v1.y)^v2.y); + cnt ^= (((v1.X^v2.X) >= 0) ? v1.X : (v1.X*v2.y-v2.X*v1.y)^v2.y); } return cnt>>31; } @@ -683,19 +683,19 @@ int32_t getwalldist(vec2_t const in, int const wallnum) { vec2_t closest; getclosestpointonwall_internal(in, wallnum, &closest); - return abs(closest.x - in.x) + abs(closest.y - in.y); + return abs(closest.X - in.X) + abs(closest.y - in.y); } int32_t getwalldist(vec2_t const in, int const wallnum, vec2_t * const out) { getclosestpointonwall_internal(in, wallnum, out); - return abs(out->x - in.x) + abs(out->y - in.y); + return abs(out->X - in.X) + abs(out->y - in.y); } int32_t getsectordist(vec2_t const in, int const sectnum, vec2_t * const out /*= nullptr*/) { - if (inside_p(in.x, in.y, sectnum)) + if (inside_p(in.X, in.y, sectnum)) { if (out) *out = in; @@ -810,10 +810,10 @@ void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * con { int const dacos = bcos(daang); int const dasin = bsin(daang); - p.x -= pivot.x; + p.X -= pivot.X; p.y -= pivot.y; - p2->x = DMulScale(p.x, dacos, -p.y, dasin, 14) + pivot.x; - p2->y = DMulScale(p.y, dacos, p.x, dasin, 14) + pivot.y; + p2->X = DMulScale(p.X, dacos, -p.y, dasin, 14) + pivot.X; + p2->y = DMulScale(p.y, dacos, p.X, dasin, 14) + pivot.y; } // @@ -821,9 +821,9 @@ void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * con // void videoSetViewableArea(int32_t x1, int32_t y1, int32_t x2, int32_t y2) { - windowxy1.x = x1; + windowxy1.X = x1; windowxy1.y = y1; - windowxy2.x = x2; + windowxy2.X = x2; windowxy2.y = y2; xdimen = (x2-x1)+1; @@ -884,8 +884,8 @@ void renderRestoreTarget() xdim = bakxsiz; ydim = bakysiz; - videoSetViewableArea(bakwindowxy1.x,bakwindowxy1.y, - bakwindowxy2.x,bakwindowxy2.y); + videoSetViewableArea(bakwindowxy1.X,bakwindowxy1.y, + bakwindowxy2.X,bakwindowxy2.y); } diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index d20dfcc6b..82df5dc0e 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -243,13 +243,13 @@ FileReader GetBaseResource(const char* fn); static void resizeglcheck(void) { - const int32_t ourxdimen = (windowxy2.x-windowxy1.x+1); + const int32_t ourxdimen = (windowxy2.X-windowxy1.X+1); float ratio = 1; const int32_t fovcorrect = (int32_t)(ourxdimen*ratio - ourxdimen); ratio = 1.f/ratio; - GLInterface.SetViewport(windowxy1.x-(fovcorrect/2), ydim-(windowxy2.y+1), + GLInterface.SetViewport(windowxy1.X-(fovcorrect/2), ydim-(windowxy2.y+1), ourxdimen+fovcorrect, windowxy2.y-windowxy1.y+1); float m[4][4]{}; @@ -406,7 +406,7 @@ static void polymost_drawpoly(FVector2 const * const dpxy, int32_t const n, int3 bool success = GLInterface.SetTexture(globalskytex? globalskytex : tileGetTexture(globalpicnum), !hw_int_useindexedcolortextures && globalskytex ? 0 : palid, sampleroverride); if (!success) { - tsiz.x = tsiz.y = 1; + tsiz.X = tsiz.y = 1; GLInterface.SetColorMask(false); //Hack to update Z-buffer for invalid mirror textures } @@ -454,7 +454,7 @@ static void polymost_drawpoly(FVector2 const * const dpxy, int32_t const n, int3 GLInterface.SetColor(pc[0], pc[1], pc[2], pc[3]); - FVector2 const scale = { 1.f / tsiz2.x, 1.f / tsiz2.y }; + FVector2 const scale = { 1.f / tsiz2.X, 1.f / tsiz2.y }; auto data = screen->mVertexData->AllocVertices(npoints); auto vt = data.first; for (intptr_t i = 0; i < npoints; ++i, vt++) @@ -1005,7 +1005,7 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0 float r; - int length = ksqrt(uhypsq(xy.x, xy.y)); + int length = ksqrt(uhypsq(xy.X, xy.y)); if (globalorientation & 2) { r = 1.f / length; @@ -1016,7 +1016,7 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0 r = i * (1.f/1048576.f); } - FVector2 const fxy = { xy.x*r, xy.y*r }; + FVector2 const fxy = { xy.X*r, xy.y*r }; ft[0] = ((float)(globalposx - sec->firstWall()->x)) * fxy.X + ((float)(globalposy - sec->firstWall()->y)) * fxy.Y; ft[1] = ((float)(globalposy - sec->firstWall()->y)) * fxy.X - ((float)(globalposx - sec->firstWall()->x)) * fxy.Y; @@ -1219,10 +1219,10 @@ 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].x, wall[dawall].y }; - vec2_t const d = { POINT2(dawall).x - w.x, POINT2(dawall).y - w.y }; - int64_t i = d.x * ((int64_t)pos->x - w.x) + d.y * ((int64_t)pos->y - w.y); + vec2_t const d = { POINT2(dawall).x - w.X, POINT2(dawall).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) { // In Blood's E1M1 this gets triggered for wall 522. return 1; @@ -1231,14 +1231,14 @@ static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32 if (i < 0) return 1; - int64_t const j = (int64_t)d.x * d.x + (int64_t)d.y * d.y; + int64_t const j = (int64_t)d.X * d.X + (int64_t)d.y * d.y; if (i > j) return 1; i = ((i << 15) / j) << 15; - n->x = w.x + ((d.x * i) >> 30); + n->X = w.X + ((d.X * i) >> 30); n->y = w.y + ((d.y * i) >> 30); return 0; @@ -1756,7 +1756,7 @@ static void polymost_drawalls(int32_t const bunch) if (maskingOneWay) { vec2_t n, pos = { globalposx, globalposy }; - if (!polymost_getclosestpointonwall(&pos, wallnum, &n) && abs(pos.x - n.x) + abs(pos.y - n.y) <= 128) + if (!polymost_getclosestpointonwall(&pos, wallnum, &n) && abs(pos.X - n.X) + abs(pos.y - n.y) <= 128) break; } @@ -1809,27 +1809,27 @@ int32_t wallfront(int32_t l1, int32_t l2) vec2_t const l1p2vect = wall[thewall[l1]].point2Wall()->pos; vec2_t const l2vect = wall[thewall[l2]].pos; vec2_t const l2p2vect = wall[thewall[l2]].point2Wall()->pos; - 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 t2 = DMulScale(l2p2vect.x - l1vect.x, d.y, -d.x, l2p2vect.y - l1vect.y, 2); //p2(l2) vs. l1 + 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 t2 = DMulScale(l2p2vect.X - l1vect.X, d.y, -d.X, l2p2vect.y - l1vect.y, 2); //p2(l2) vs. l1 if (t1 == 0) { if (t2 == 0) return -1; t1 = t2; } if (t2 == 0) t2 = t1; if ((t1 ^ t2) >= 0) //pos vs. l1 - return (DMulScale(globalposx - l1vect.x, d.y, -d.x, globalposy - l1vect.y, 2) ^ t1) >= 0; + return (DMulScale(globalposx - l1vect.X, d.y, -d.X, globalposy - l1vect.y, 2) ^ t1) >= 0; - d.x = l2p2vect.x - l2vect.x; + d.X = l2p2vect.X - l2vect.X; d.y = l2p2vect.y - l2vect.y; - t1 = DMulScale(l1vect.x - l2vect.x, d.y, -d.x, l1vect.y - l2vect.y, 2); //p1(l1) vs. l2 - t2 = DMulScale(l1p2vect.x - l2vect.x, d.y, -d.x, l1p2vect.y - l2vect.y, 2); //p2(l1) vs. l2 + t1 = DMulScale(l1vect.X - l2vect.X, d.y, -d.X, l1vect.y - l2vect.y, 2); //p1(l1) vs. l2 + t2 = DMulScale(l1p2vect.X - l2vect.X, d.y, -d.X, l1p2vect.y - l2vect.y, 2); //p2(l1) vs. l2 if (t1 == 0) { if (t2 == 0) return -1; t1 = t2; } if (t2 == 0) t2 = t1; if ((t1 ^ t2) >= 0) //pos vs. l2 - return (DMulScale(globalposx - l2vect.x, d.y, -d.x, globalposy - l2vect.y, 2) ^ t1) < 0; + return (DMulScale(globalposx - l2vect.X, d.y, -d.X, globalposy - l2vect.y, 2) ^ t1) < 0; return -2; } @@ -1884,12 +1884,12 @@ void polymost_scansector(int32_t sectnum) if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) || (hw_models && tile2model[spr->picnum].modelid>=0) || - ((s.x * gcosang) + (s.y * gsinang) > 0)) + ((s.X * gcosang) + (s.y * gsinang) > 0)) { if ((spr->cstat&(CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_MASK))!=(CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL) || (r_voxels && tiletovox[spr->picnum] >= 0 && voxmodels[tiletovox[spr->picnum]]) || (r_voxels && gi->Voxelize(spr->picnum) > -1) || - DMulScale(bcos(spr->ang), -s.x, bsin(spr->ang), -s.y, 6) > 0) + DMulScale(bcos(spr->ang), -s.X, bsin(spr->ang), -s.y, 6) > 0) if (!renderAddTsprite(pm_tsprite, pm_spritesortcnt, act)) break; } @@ -2111,7 +2111,7 @@ void polymost_drawrooms() //if (glprojectionhacks == 2) { // calculates the extend of the zenith glitch - float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.x-windowxy1.x) * 4.f); + float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f); float verticalfov = atanf(verticalfovtan) * (2.f / pi::pi()); static constexpr float const maxhorizangle = 0.6361136f; // horiz of 199 in degrees float zenglitch = verticalfov + maxhorizangle - 0.95f; // less than 1 because the zenith glitch extends a bit @@ -2169,8 +2169,8 @@ void polymost_drawrooms() //Generate viewport trapezoid (for handling screen up/down) FVector3 p[4] = { { 0-1, 0-1+ghorizcorrect, 0 }, - { (float)(windowxy2.x + 1 - windowxy1.x + 2), 0-1+ghorizcorrect, 0 }, - { (float)(windowxy2.x + 1 - windowxy1.x + 2), (float)(windowxy2.y + 1 - windowxy1.y + 2)+ghorizcorrect, 0 }, + { (float)(windowxy2.X + 1 - windowxy1.X + 2), 0-1+ghorizcorrect, 0 }, + { (float)(windowxy2.X + 1 - windowxy1.X + 2), (float)(windowxy2.y + 1 - windowxy1.y + 2)+ghorizcorrect, 0 }, { 0-1, (float)(windowxy2.y + 1 - windowxy1.y + 2)+ghorizcorrect, 0 } }; for (auto & v : p) @@ -2499,7 +2499,7 @@ void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang //if (glprojectionhacks == 2) { // calculates the extent of the zenith glitch - float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.x-windowxy1.x) * 4.f); + float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f); float verticalfov = atanf(verticalfovtan) * (2.f / pi::pi()); static constexpr float const maxhorizangle = 0.6361136f; // horiz of 199 in degrees float zenglitch = verticalfov + maxhorizangle - 0.95f; // less than 1 because the zenith glitch extends a bit @@ -2580,7 +2580,7 @@ static inline int32_t polymost_findwall(tspritetype const * const tspr, vec2_t c if ((!wal.twoSided() || ((wal.nextSector()->ceilingz > (tspr->z - ((tsiz->y * tspr->yrepeat) << 2))) || wal.nextSector()->floorz < tspr->z)) && !polymost_getclosestpointonwall((const vec2_t *) tspr, wallnum(&wal), &n)) { - int const dst = abs(tspr->x - n.x) + abs(tspr->y - n.y); + int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.y); if (dst <= dist) { @@ -2681,7 +2681,7 @@ void polymost_drawsprite(int32_t snum) if (!(tspr->cstat2 & CSTAT2_SPRITE_SLOPE)) { - off.x += tspr->xoffset; + off.X += tspr->xoffset; off.y += tspr->yoffset; } @@ -2749,10 +2749,10 @@ void polymost_drawsprite(int32_t snum) else tsiz = { tileWidth(globalpicnum), tileHeight(globalpicnum) }; - if (tsiz.x <= 0 || tsiz.y <= 0) + if (tsiz.X <= 0 || tsiz.y <= 0) return; - FVector2 const ftsiz = { (float) tsiz.x, (float) tsiz.y }; + FVector2 const ftsiz = { (float) tsiz.X, (float) tsiz.y }; switch ((globalorientation >> 4) & 3) { @@ -2760,7 +2760,7 @@ void polymost_drawsprite(int32_t snum) { // Project 3D to 2D if (globalorientation & 4) - off.x = -off.x; + off.X = -off.X; // NOTE: yoff not negated not for y flipping, unlike wall and floor // aligned sprites. @@ -2786,12 +2786,12 @@ void polymost_drawsprite(int32_t snum) FVector2 ff = { ((float)tspr->xrepeat) * f, ((float)tspr->yrepeat) * f * ((float)yxaspect * (1.0f / 65536.f)) }; - if (tsiz.x & 1) + if (tsiz.X & 1) s0.X += ff.X * 0.5f; if (globalorientation & 128 && tsiz.y & 1) s0.Y += ff.Y * 0.5f; - s0.X -= ff.X * (float) off.x; + s0.X -= ff.X * (float) off.X; s0.Y -= ff.Y * (float) off.y; ff.X *= ftsiz.X; @@ -2852,7 +2852,7 @@ void polymost_drawsprite(int32_t snum) pxy[2].Y = pxy[3].Y = s0.Y; } - vec2_16_t tempsiz = { (int16_t)tsiz.x, (int16_t)tsiz.y }; + vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y }; pow2xsplit = 0; if (globalshade > 63) globalshade = 63; // debug polymost_drawpoly(pxy, 4, method, tempsiz); @@ -2866,7 +2866,7 @@ void polymost_drawsprite(int32_t snum) { // Project 3D to 2D if (globalorientation & 4) - off.x = -off.x; + off.X = -off.X; if (globalorientation & 8) off.y = -off.y; @@ -2874,7 +2874,7 @@ void polymost_drawsprite(int32_t snum) FVector2 const extent = { float(tspr->xrepeat * bsinf(tspr->ang, -16)), float(tspr->xrepeat * -bcosf(tspr->ang, -16)) }; - float f = (float)(tsiz.x >> 1) + (float)off.x; + float f = (float)(tsiz.X >> 1) + (float)off.X; FVector2 const vf = { extent.X * f, extent.Y * f }; @@ -2889,9 +2889,9 @@ 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].x + POINT2(w).x) || + if (walldist <= 2 || ((pos.x - v.X) + (pos.x + v.X)) == (wall[w].x + POINT2(w).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].x, wall[w].y, + polymost_lintersect(pos.x - v.X, pos.y - v.y, pos.x + v.X, pos.y + v.y, wall[w].x, wall[w].y, POINT2(w).x, POINT2(w).y)) { int32_t const ang = getangle(wall[w].x - POINT2(w).x, wall[w].y - POINT2(w).y); @@ -3019,7 +3019,7 @@ void polymost_drawsprite(int32_t snum) FVector2 const pxy[4] = { { sx0, sc0 }, { sx1, sc1 }, { sx1, sf1 }, { sx0, sf0 } }; - vec2_16_t tempsiz = { (int16_t)tsiz.x, (int16_t)tsiz.y }; + vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y }; pow2xsplit = 0; polymost_drawpoly(pxy, 4, method, tempsiz); @@ -3041,13 +3041,13 @@ void polymost_drawsprite(int32_t snum) float ratio = 1.f / sqrtf(fheinum * fheinum + 1.f); if ((globalorientation & 4) > 0) - off.x = -off.x; + off.X = -off.X; if ((globalorientation & 8) > 0) off.y = -off.y; - FVector2 const p0 = { (float)(((tsiz.x + 1) >> 1) - off.x) * tspr->xrepeat, + FVector2 const p0 = { (float)(((tsiz.X + 1) >> 1) - off.X) * tspr->xrepeat, (float)(((tsiz.y + 1) >> 1) - off.y) * tspr->yrepeat * ratio }, - p1 = { (float)((tsiz.x >> 1) + off.x) * tspr->xrepeat, + p1 = { (float)((tsiz.X >> 1) + off.X) * tspr->xrepeat, (float)((tsiz.y >> 1) + off.y) * tspr->yrepeat * ratio }; float const c = bcosf(tspr->ang, -16); @@ -3225,7 +3225,7 @@ void polymost_drawsprite(int32_t snum) xtex.v *= rr; ytex.v *= rr; otex.v *= rr; } - vec2_16_t tempsiz = { (int16_t)tsiz.x, (int16_t)tsiz.y }; + vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y }; pow2xsplit = 0; polymost_drawpoly(pxy2, npoints, method, tempsiz); @@ -3702,7 +3702,7 @@ void renderDrawMasks(void) for (jj = 0; jj < numpts; jj++) { - spr.X = (float)pp[jj].x; + spr.X = (float)pp[jj].X; spr.Y = (float)pp[jj].y; if (!sameside(&maskeq, &spr, &pos)) // behind the maskwall, diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 47417312e..87ebb9138 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -324,7 +324,7 @@ void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p) twod->AddThickLine(x1 / 4096, y1 / 4096, x2 / 4096, y2 / 4096, am_linethickness, p, uint8_t(am_linealpha * 255)); } else { // Use more efficient thin line drawing routine. - twod->AddLine(x1 / 4096.f, y1 / 4096.f, x2 / 4096.f, y2 / 4096.f, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y, p, uint8_t(am_linealpha * 255)); + twod->AddLine(x1 / 4096.f, y1 / 4096.f, x2 / 4096.f, y2 / 4096.f, windowxy1.X, windowxy1.y, windowxy2.X, windowxy2.y, p, uint8_t(am_linealpha * 255)); } } @@ -601,7 +601,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) } twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), (unsigned*)indices->Data(), indices->Size(), translation, light, - LegacyRenderStyles[STYLE_Translucent], windowxy1.x, windowxy1.y, windowxy2.x + 1, windowxy2.y + 1); + LegacyRenderStyles[STYLE_Translucent], windowxy1.X, windowxy1.y, windowxy2.X + 1, windowxy2.y + 1); } } qsort(floorsprites.Data(), floorsprites.Size(), sizeof(spritetype*), [](const void* a, const void* b) @@ -621,7 +621,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) for (unsigned j = 0; j < 4; j++) { - int ox = pp[j].x - cposx; + int ox = pp[j].X - cposx; int oy = pp[j].y - cposy; int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11); int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11); @@ -646,7 +646,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) gotpic.Set(picnum); const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 }; twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), indices, 6, translation, color, rs, - windowxy1.x, windowxy1.y, windowxy2.x + 1, windowxy2.y + 1); + windowxy1.X, windowxy1.y, windowxy2.X + 1, windowxy2.y + 1); } } diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index e98987cb4..7948e89d3 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -238,8 +238,8 @@ static IntRect System_GetSceneRect() { int viewbottom = windowxy2.y + 1; int viewheight = viewbottom - windowxy1.y; - int viewright = windowxy2.x + 1; - int viewwidth = viewright - windowxy1.x; + int viewright = windowxy2.X + 1; + int viewwidth = viewright - windowxy1.X; int renderheight; @@ -247,7 +247,7 @@ static IntRect System_GetSceneRect() else renderheight = (viewwidth * screen->GetHeight() / screen->GetWidth()) & ~7; IntRect mSceneViewport; - mSceneViewport.left = windowxy1.x; + mSceneViewport.left = windowxy1.X; mSceneViewport.top = screen->GetHeight() - (renderheight + windowxy1.y - ((renderheight - viewheight) / 2)); mSceneViewport.width = viewwidth; mSceneViewport.height = renderheight; @@ -1411,7 +1411,7 @@ void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double double crosshair_scale = crosshairscale * scale; DrawTexture(twod, tile, 160 + xdelta, 100 + ydelta, DTA_Color, color, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, crosshair_scale, DTA_ScaleY, crosshair_scale, DTA_CenterOffsetRel, true, - DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE); + DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE); return; } @@ -1419,7 +1419,7 @@ void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double // 0 means 'game provided crosshair' - use type 2 as fallback. ST_LoadCrosshair(crosshair == 0 ? 2 : *crosshair, false); - double xpos = (windowxy1.x + windowxy2.x) / 2 + xdelta * (windowxy2.y - windowxy1.y) / 240.; + double xpos = (windowxy1.X + windowxy2.X) / 2 + xdelta * (windowxy2.y - windowxy1.y) / 240.; double ypos = (windowxy1.y + windowxy2.y) / 2; ST_DrawCrosshair(health, xpos, ypos, 1); } @@ -1524,9 +1524,9 @@ bool validFilter(const char* str) DEFINE_ACTION_FUNCTION(_Screen, GetViewWindow) { PARAM_PROLOGUE; - if (numret > 0) ret[0].SetInt(windowxy1.x); + if (numret > 0) ret[0].SetInt(windowxy1.X); if (numret > 1) ret[1].SetInt(windowxy1.y); - if (numret > 2) ret[2].SetInt(windowxy2.x - windowxy1.x + 1); + if (numret > 2) ret[2].SetInt(windowxy2.X - windowxy1.X + 1); if (numret > 3) ret[3].SetInt(windowxy2.y - windowxy1.y + 1); return min(numret, 4); } diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index f5d7a10ad..ae50a9dcc 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -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->x) * delta.y; + int i = (y - wal->y) * delta.X - (x - wal->x) * delta.y; return i == 0? 0 : Scale((z - basez) << 8, wal->Length(), i); } @@ -261,9 +261,9 @@ void GetWallSpritePosition(const tspritetype* spr, vec2_t pos, vec2_t* out, bool if (spr->cstat & CSTAT_SPRITE_XFLIP) xoff = -xoff; int origin = (width >> 1) + xoff; - out[0].x = pos.x - MulScale(x, origin, 16); + out[0].X = pos.X - MulScale(x, origin, 16); out[0].y = pos.y - MulScale(y, origin, 16); - out[1].x = out[0].x + MulScale(x, width, 16); + out[1].X = out[0].X + MulScale(x, width, 16); out[1].y = out[0].y + MulScale(y, width, 16); } @@ -307,10 +307,10 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out, int cosangslope = DivScale(cosang, ratio, 12); int sinangslope = DivScale(sinang, ratio, 12); - out[0].x = pos.x + DMulScale(sinang, sprcenterx, cosangslope, sprcentery, 16); + out[0].X = pos.X + DMulScale(sinang, sprcenterx, cosangslope, sprcentery, 16); out[0].y = pos.y + DMulScale(sinangslope, sprcentery, -cosang, sprcenterx, 16); - out[1].x = out[0].x - MulScale(sinang, width, 16); + out[1].X = out[0].X - MulScale(sinang, width, 16); out[1].y = out[0].y + MulScale(cosang, width, 16); vec2_t sub = { MulScale(cosangslope, height, 16), MulScale(sinangslope, height, 16) }; @@ -323,7 +323,7 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out, { for (int i = 0; i < 4; i++) { - int spos = DMulScale(-sinang, out[i].y - spr->y, -cosang, out[i].x - spr->x, 4); + int spos = DMulScale(-sinang, out[i].y - spr->y, -cosang, out[i].X - spr->x, 4); outz[i] = MulScale(heinum, spos, 18); } } @@ -396,7 +396,7 @@ FSerializer& Serialize(FSerializer& arc, const char* key, vec2_t& c, vec2_t* def if (arc.isWriting() && def && !memcmp(&c, def, sizeof(c))) return arc; if (arc.BeginObject(key)) { - arc("x", c.x, def ? &def->x : nullptr) + arc("x", c.X, def ? &def->X : nullptr) ("y", c.y, def ? &def->y : nullptr) .EndObject(); } diff --git a/source/core/gamehud.cpp b/source/core/gamehud.cpp index 31d18fe57..3b7f73e0e 100644 --- a/source/core/gamehud.cpp +++ b/source/core/gamehud.cpp @@ -65,8 +65,8 @@ void hud_drawsprite(double sx, double sy, double sz, double a, int picnum, int d DTA_ScaleX, sz, DTA_ScaleY, sz, DTA_Color, shadeToLight(dashade), DTA_TranslationIndex, palid, - DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, - DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, + DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y, + DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, DTA_FullscreenScale, (dastat & RS_STRETCH)? FSMode_ScaleToScreen: FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_CenterOffsetRel, (dastat & (RS_TOPLEFT | RS_CENTER))? 0:2, DTA_TopLeft, !!(dastat & RS_TOPLEFT), diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 61ccff160..3207db14f 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -453,7 +453,7 @@ void PlayerHorizon::calcviewpitch(vec2_t const pos, binangle const ang, bool con { // Get a point, 512 (64 for Blood) units ahead of player's position int const shift = -(isBlood() ? BLOODSINSHIFT : DEFSINSHIFT); - int const x = pos.x + ang.bcos(shift); + int const x = pos.X + ang.bcos(shift); int const y = pos.y + ang.bsin(shift); auto tempsect = cursectnum; updatesector(x, y, &tempsect); @@ -462,7 +462,7 @@ void PlayerHorizon::calcviewpitch(vec2_t const pos, binangle const ang, bool con { // Get the floorz as if the new (x,y) point was still in // your sector - int const j = getflorzofslopeptr(cursectnum, pos.x, pos.y); + int const j = getflorzofslopeptr(cursectnum, pos.X, pos.y); int const k = getflorzofslopeptr(tempsect, x, y); // If extended point is in same sector as you or the slopes diff --git a/source/core/intvec.h b/source/core/intvec.h index 4534827a4..1743207e8 100644 --- a/source/core/intvec.h +++ b/source/core/intvec.h @@ -9,19 +9,19 @@ struct vec2_16_t struct vec2_t { - int32_t x, y; + int32_t X, y; vec2_t() = default; vec2_t(const vec2_t&) = default; - vec2_t(int x_, int y_) : x(x_), y(y_) {} - vec2_t operator+(const vec2_t& other) const { return { x + other.x, y + other.y }; } - vec2_t operator-(const vec2_t& other) const { return { x - other.x, y - other.y }; } - vec2_t& operator+=(const vec2_t& other) { x += other.x; y += other.y; return *this; }; - vec2_t& operator-=(const vec2_t& other) { x -= other.x; y -= other.y; return *this; }; - vec2_t& operator/= (int other) { x /= other; y /= other; return *this; } - bool operator == (const vec2_t& other) const { return x == other.x && y == other.y; }; + vec2_t(int x, int y_) : X(x), y(y_) {} + vec2_t operator+(const vec2_t& other) const { return { X + other.X, y + other.y }; } + vec2_t operator-(const vec2_t& other) const { return { X - other.X, y - other.y }; } + vec2_t& operator+=(const vec2_t& other) { X += other.X; y += other.y; return *this; }; + vec2_t& operator-=(const vec2_t& other) { X -= other.X; y -= other.y; return *this; }; + vec2_t& operator/= (int other) { X /= other; y /= other; return *this; } + bool operator == (const vec2_t& other) const { return X == other.X && y == other.y; }; }; -inline vec2_t operator/ (const vec2_t& vec, int other) { return { vec.x / other, vec.y / other }; } +inline vec2_t operator/ (const vec2_t& vec, int other) { return { vec.X / other, vec.y / other }; } struct vec3_t { diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index fc9c49a3d..0ca1bf4d0 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -63,7 +63,7 @@ void walltype::calcLength() lengthflags &= ~1; point2Wall()->lengthflags &= ~2; auto d = delta(); - length = (int)sqrt(d.x * d.x + d.y * d.y); + length = (int)sqrt(d.X * d.X + d.y * d.y); } // needed for skipping over to get the map size first. @@ -178,7 +178,7 @@ static void ReadSectorV5(FileReader& fr, sectortype& sect) static void ReadWallV7(FileReader& fr, walltype& wall) { - wall.pos.x = fr.ReadInt32(); + wall.pos.X = fr.ReadInt32(); wall.pos.y = fr.ReadInt32(); wall.point2 = fr.ReadInt16(); wall.nextwall = fr.ReadInt16(); @@ -199,7 +199,7 @@ static void ReadWallV7(FileReader& fr, walltype& wall) static void ReadWallV6(FileReader& fr, walltype& wall) { - wall.pos.x = fr.ReadInt32(); + wall.pos.X = fr.ReadInt32(); wall.pos.y = fr.ReadInt32(); wall.point2 = fr.ReadInt16(); wall.nextsector = fr.ReadInt16(); @@ -220,7 +220,7 @@ static void ReadWallV6(FileReader& fr, walltype& wall) static void ReadWallV5(FileReader& fr, walltype& wall) { - wall.pos.x = fr.ReadInt32(); + wall.pos.X = fr.ReadInt32(); wall.pos.y = fr.ReadInt32(); wall.point2 = fr.ReadInt16(); wall.picnum = fr.ReadInt16(); diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 8bd35269f..c56745a49 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -685,7 +685,7 @@ inline void walltype::moved() inline void walltype::move(int newx, int newy) { - pos.x = newx; + pos.X = newx; pos.y = newy; lengthflags = 3; sectorp()->dirty = EDirty::AllDirty; diff --git a/source/core/rendering/hw_entrypoint.cpp b/source/core/rendering/hw_entrypoint.cpp index a02d9b34c..b3e1ee57b 100644 --- a/source/core/rendering/hw_entrypoint.cpp +++ b/source/core/rendering/hw_entrypoint.cpp @@ -249,7 +249,7 @@ void WriteSavePic(FileWriter* file, int width, int height) writingsavepic = false; xdim = oldx; ydim = oldy; - videoSetViewableArea(oldwindowxy1.x, oldwindowxy1.y, oldwindowxy2.x, oldwindowxy2.y); + videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.y, oldwindowxy2.X, oldwindowxy2.y); } void RenderToSavePic(FRenderViewpoint& vp, FileWriter* file, int width, int height) diff --git a/source/core/rendering/hw_sections.cpp b/source/core/rendering/hw_sections.cpp index bf1d495d2..5a00c3637 100644 --- a/source/core/rendering/hw_sections.cpp +++ b/source/core/rendering/hw_sections.cpp @@ -89,7 +89,7 @@ static int sgn(int v) static int dist(const vec2_t& a, const vec2_t& b) { // We only need to know if it's 1 or higher, so this is enough. - return abs(a.x - b.x) + abs(a.y - b.y); + return abs(a.X - b.X) + abs(a.y - b.y); } @@ -122,8 +122,8 @@ void StripLoop(TArray& points) } if (p > 0) p--; // backtrack one point more to ensure we can check the newly formed connection as well. } - else if ((points[prev].x == points[p].x && points[next].x == points[p].x && sgn(points[next].y - points[p].y) == sgn(points[prev].y - points[p].y)) || - (points[prev].y == points[p].y && points[next].y == points[p].y && sgn(points[next].x - points[p].x) == sgn(points[prev].x - points[p].x)) || + else if ((points[prev].X == points[p].X && points[next].X == points[p].X && sgn(points[next].y - points[p].y) == sgn(points[prev].y - points[p].y)) || + (points[prev].y == points[p].y && points[next].y == points[p].y && sgn(points[next].X - points[p].X) == sgn(points[prev].X - points[p].X)) || dist(points[prev], points[next]) <= 1) // if the two points are extremely close together, we may also ignore the intermediate point. { // both connections exit the point into the same direction. Here it is sufficient to just delete it so that the neighboring ones connect directly. @@ -145,16 +145,16 @@ void StripLoop(TArray& points) int GetWindingOrder(TArray& poly, cmp comp1 = cmpLess, cmp comp2 = cmpGreater) { int n = poly.Size(); - int minx = poly[0].x; + int minx = poly[0].X; int miny = poly[0].y; int m = 0; for (int i = 0; i < n; i++) { - if ((comp1(poly[i].y, miny)) || ((poly[i].y == miny) && (comp2(poly[i].x, minx)))) + if ((comp1(poly[i].y, miny)) || ((poly[i].y == miny) && (comp2(poly[i].X, minx)))) { m = i; - minx = poly[m].x; + minx = poly[m].X; miny = poly[m].y; } } @@ -164,9 +164,9 @@ int GetWindingOrder(TArray& poly, cmp comp1 = cmpLess, cmp comp2 = cmpGr int m1 = (m + n - 1) % n; int m2 = (m + 1) % n; - a[0] = poly[m1].x; - b[0] = poly[m].x; - c[0] = poly[m2].x; + a[0] = poly[m1].X; + b[0] = poly[m].X; + c[0] = poly[m2].X; a[1] = poly[m1].y; b[1] = poly[m].y; @@ -311,9 +311,9 @@ static int insideLoop(int vertex, TArray& loop) if ((pt1.y >pt.y) != (pt2.y > pt.y)) // skip if both are on the same side. { // use 64 bit values to avoid overflows in the multiplications below. - int64_t deltatx = int64_t(pt.x) - pt1.x; + int64_t deltatx = int64_t(pt.X) - pt1.X; int64_t deltaty = int64_t(pt.y) - pt1.y; - int64_t deltax = int64_t(pt2.x) - pt1.x; + int64_t deltax = int64_t(pt2.X) - pt1.X; int64_t deltay = int64_t(pt2.y) - pt1.y; //if (x < deltax * (deltaty) / deltay + pt1.x) // reformatted to avoid the division - for nagative deltay the sign needs to be flipped to give the correct result. diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index 0051ad43d..8bfceeb31 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -59,7 +59,7 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b angrange = ang2 - ang1; di = _di; clipper = c; - viewx = view.x * (1/ 16.f); + viewx = view.X * (1/ 16.f); viewy = view.y * -(1/ 16.f); viewz = (float)di->Viewpoint.Pos.Z; iview = view; @@ -72,7 +72,7 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b { // Precalculate the clip angles to avoid doing this repeatedly during level traversal. auto vv = w.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(sectionendang.Data(), -1, sectionendang.Size() * sizeof(sectionendang[0])); @@ -607,7 +607,7 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal) if ((spr->cstat & CSTAT_SPRITE_INVISIBLE) || spr->xrepeat == 0 || spr->yrepeat == 0) // skip invisible sprites continue; - int sx = spr->x - iview.x, sy = spr->y - int(iview.y); + int sx = spr->x - iview.X, sy = spr->y - int(iview.y); // this checks if the sprite is it behind the camera, which will not work if the pitch is high enough to necessitate a FOV of more than 180°. //if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) || (hw_models && tile2model[spr->picnum].modelid >= 0) || ((sx * gcosang) + (sy * gsinang) > 0)) diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 7e914e927..9a32a67a2 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -393,7 +393,7 @@ void HWDrawInfo::CreateScene(bool portal) mDrawer.RenderScene(&vp.SectCount, 1, portal); SetupSprite.Clock(); - gi->processSprites(tsprite, spritesortcnt, view.x, view.y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536); + gi->processSprites(tsprite, spritesortcnt, view.X, view.y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536); DispatchSprites(); SetupSprite.Unclock(); diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index 84e612d5a..7f9fd508b 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -141,7 +141,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di) float maxofs = -FLT_MAX, minofs = FLT_MAX; for (int i = 0; i < 4; i++) { - float vz = getceilzofslopeptr(Sprite->sectp, pos[i].x, pos[i].y) * (1 / -256.f); + float vz = getceilzofslopeptr(Sprite->sectp, pos[i].X, pos[i].y) * (1 / -256.f); float sz = z + ofsz[i] * (1 / -256.f); int diff = vz - sz; if (diff > maxofs) maxofs = diff; @@ -154,7 +154,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di) float maxofs = -FLT_MAX, minofs = FLT_MAX; for (int i = 0; i < 4; i++) { - float vz = getflorzofslopeptr(Sprite->sectp, pos[i].x, pos[i].y) * (1 / -256.f); + float vz = getflorzofslopeptr(Sprite->sectp, pos[i].X, pos[i].y) * (1 / -256.f); float sz = z + ofsz[i] * (1 / -256.f); int diff = vz - sz; if (diff > maxofs) maxofs = diff; @@ -167,7 +167,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di) { const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 }; int j = indices[i]; - vp->SetVertex(pos[j].x * (1 / 16.f), z + ofsz[j] * (1 / -256.f), pos[j].y * (1 / -16.f)); + vp->SetVertex(pos[j].X * (1 / 16.f), z + ofsz[j] * (1 / -256.f), pos[j].y * (1 / -16.f)); if (!canvas) vp->SetTexCoord(j == 1 || j == 2 ? 1.f - x : x, j == 2 || j == 3 ? 1.f - y : y); else vp->SetTexCoord(j == 1 || j == 2 ? 1.f - x : x, j == 2 || j == 3 ? y : 1.f - y); vp++; diff --git a/source/core/rendering/scene/hw_portal.cpp b/source/core/rendering/scene/hw_portal.cpp index 67af68533..44fcc1ec4 100644 --- a/source/core/rendering/scene/hw_portal.cpp +++ b/source/core/rendering/scene/hw_portal.cpp @@ -536,9 +536,9 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe vec2_t view = { int(vp.Pos.X * 16), int(vp.Pos.Y * -16) }; - int64_t i = ((int64_t(view.x) - x) * dx + (int64_t(view.y) - y) * dy) << 1; + int64_t i = ((int64_t(view.X) - x) * dx + (int64_t(view.y) - y) * dy) << 1; - int newx = int((x << 1) + Scale(dx, i, j) - view.x); + int newx = int((x << 1) + Scale(dx, i, j) - view.X); int newy = int((y << 1) + Scale(dy, i, j) - view.y); auto myan = bvectangbam(dx, dy); diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index d648e0f27..12a8d941c 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -54,16 +54,16 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const auto pos = spr->pos; // avoid the math below for orthogonal walls. Here we allow only sprites that exactly match the line's coordinate and orientation - if (d.x == 0 && d.y == 0) + if (d.X == 0 && d.y == 0) { // line has no length. // In Blood's E1M1 this gets triggered for wall 522. return 1; } - else if (d.x == 0) + else if (d.X == 0) { // line is vertical. - if (abs(pos.x - w.x) <= 1 && (spr->ang & 0x3ff) == 0) + if (abs(pos.x - w.X) <= 1 && (spr->ang & 0x3ff) == 0) { *n = pos.vec2; return 0; @@ -82,20 +82,20 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const } - 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 (i < 0) return 1; - int64_t j = (int64_t)d.x * d.x + (int64_t)d.y * d.y; + int64_t j = (int64_t)d.X * d.X + (int64_t)d.y * d.y; if (i > j) return 1; i = ((i << 15) / j) << 15; - n->x = w.x + ((d.x * i) >> 30); + n->X = w.X + ((d.X * i) >> 30); n->y = w.y + ((d.y * i) >> 30); return 0; @@ -120,7 +120,7 @@ static int IsOnWall(tspritetype* tspr, int height) if ((wal.nextsector == -1 || ((wal.nextSector()->ceilingz > topz) || wal.nextSector()->floorz < tspr->z)) && !GetClosestPointOnWall(tspr, &wal, &n)) { - int const dst = abs(tspr->x - n.x) + abs(tspr->y - n.y); + int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.y); if (dst <= dist) { @@ -1136,9 +1136,9 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, tspritetype* spr, sectortype* sec int sprz = spr->pos.z; GetWallSpritePosition(spr, spr->pos.vec2, pos, true); - glseg.x1 = pos[0].x * (1 / 16.f); + glseg.x1 = pos[0].X * (1 / 16.f); glseg.y1 = pos[0].y * (1 / -16.f); - glseg.x2 = pos[1].x * (1 / 16.f); + glseg.x2 = pos[1].X * (1 / 16.f); glseg.y2 = pos[1].y * (1 / -16.f); if (spr->cstat & CSTAT_SPRITE_ONE_SIDE) diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 8374055fe..94cd61da3 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -230,7 +230,7 @@ static int OutlineToFloat(Outline& outl, FOutline& polygon) count += outl[i].Size(); for (unsigned j = 0; j < outl[i].Size(); j++) { - float X = RenderX(outl[i][j].x); + float X = RenderX(outl[i][j].X); float Y = RenderY(outl[i][j].y); if (fabs(X) > 32768.f || fabs(Y) > 32768.f) { diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 8d67e3af1..6de033ae9 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -285,7 +285,7 @@ bool CheckProximityWall(walltype* pWall, int x, int y, int nDist) int GetWallAngle(walltype* pWall) { auto delta = pWall->delta(); - return getangle(delta.x, delta.y); + return getangle(delta.X, delta.y); } void GetWallNormal(walltype* pWall, int *pX, int *pY) @@ -293,7 +293,7 @@ void GetWallNormal(walltype* pWall, int *pX, int *pY) auto delta = pWall->delta(); int dX = -delta.y >> 4; - int dY = delta.x >> 4; + int dY = delta.X >> 4; int nLength = ksqrt(dX*dX+dY*dY); if (nLength <= 0) @@ -347,16 +347,16 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; if (nRange) { - hitscangoal.x = x + MulScale(nRange << 4, Cos(pSprite->ang), 30); + hitscangoal.X = x + MulScale(nRange << 4, Cos(pSprite->ang), 30); hitscangoal.y = y + MulScale(nRange << 4, Sin(pSprite->ang), 30); } else { - hitscangoal.x = hitscangoal.y = 0x1ffffff; + hitscangoal.X = hitscangoal.y = 0x1ffffff; } hitscan({ x, y, z }, pSprite->sector(), { dx, dy, dz << 4 }, gHitInfo, nMask); - hitscangoal.x = hitscangoal.y = 0x1ffffff; + hitscangoal.X = hitscangoal.y = 0x1ffffff; pSprite->cstat = bakCstat; if (gHitInfo.actor() != nullptr) return 3; @@ -392,17 +392,17 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; if (nRange) { - hitscangoal.x = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30); + hitscangoal.X = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30); hitscangoal.y = y1+MulScale(nRange<<4, Sin(pSprite->ang), 30); } else { - hitscangoal.x = hitscangoal.y = 0x1fffffff; + hitscangoal.X = hitscangoal.y = 0x1fffffff; } vec3_t pos = { x1, y1, z1 }; hitscan(pos, pSprite->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); - hitscangoal.x = hitscangoal.y = 0x1ffffff; + hitscangoal.X = hitscangoal.y = 0x1ffffff; pSprite->cstat = bakCstat; while (nNum--) { diff --git a/source/games/blood/src/sbar.cpp b/source/games/blood/src/sbar.cpp index 6291cbc46..8921360ef 100644 --- a/source/games/blood/src/sbar.cpp +++ b/source/games/blood/src/sbar.cpp @@ -51,13 +51,13 @@ static void UpdateFrame(void) twod->AddFlatFill(0, 0, width, windowxy1.y - 3, tex); twod->AddFlatFill(0, windowxy2.y + 4, width, height, tex); - twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.x - 3, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy2.x + 4, windowxy1.y - 3, width, windowxy2.y + 4, tex); + twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex); + twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, width, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy1.x - 3, windowxy1.y - 3, windowxy1.x, windowxy2.y + 1, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy1.x, windowxy1.y - 3, windowxy2.x + 4, windowxy1.y, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy2.x + 1, windowxy1.y, windowxy2.x + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); - twod->AddFlatFill(windowxy1.x - 3, windowxy2.y + 1, windowxy2.x + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); } void UpdateStatusBar() diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index e32cfc833..be1889fd1 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -811,7 +811,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 { for (auto& wal : wallsofsector(pSector)) { - x = wal.baseWall.x; + x = wal.baseWall.X; y = wal.baseWall.y; if (vbp) RotatePoint((int*)&x, (int*)&y, vbp, a4, a5); @@ -823,7 +823,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 for (auto& wal : wallsofsector(pSector)) { auto p2Wall = wal.point2Wall(); - x = wal.baseWall.x; + x = wal.baseWall.X; y = wal.baseWall.y; if (wal.cstat & CSTAT_WALL_MOVE_FORWARD) { @@ -832,7 +832,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 DragPoint(&wal, x+vc-a4, y+v8-a5); if ((p2Wall->cstat & CSTAT_WALL_MOVE_MASK) == 0) { - x = p2Wall->baseWall.x; + x = p2Wall->baseWall.X; y = p2Wall->baseWall.y; if (vbp) RotatePoint((int*)&x, (int*)&y, vbp, a4, a5); @@ -847,7 +847,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 DragPoint(&wal, x-(vc-a4), y-(v8-a5)); if ((p2Wall->cstat & CSTAT_WALL_MOVE_MASK) == 0) { - x = p2Wall->baseWall.x; + x = p2Wall->baseWall.X; y = p2Wall->baseWall.y; if (vbp) RotatePoint((int*)&x, (int*)&y, -vbp, a4, a5); @@ -1966,7 +1966,7 @@ void trInit(TArray& actors) gBusy.Clear(); for(auto& wal : wall) { - wal.baseWall.x = wal.x; + wal.baseWall.X = wal.x; wal.baseWall.y = wal.y; } for(auto actor : actors) @@ -2019,7 +2019,7 @@ void trInit(TArray& actors) TranslateSector(pSector, 0, -65536, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, pSprite1->ang, pSprite2->x, pSprite2->y, pSprite2->ang, pSector->type == kSectorSlide); for(auto& wal : wallsofsector(pSector)) { - wal.baseWall.x = wal.x; + wal.baseWall.X = wal.x; wal.baseWall.y = wal.y; } BloodSectIterator it(pSector); @@ -2038,7 +2038,7 @@ void trInit(TArray& actors) TranslateSector(pSector, 0, -65536, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, 0, pSprite1->x, pSprite1->y, pSprite1->ang, pSector->type == kSectorRotate); for (auto& wal : wallsofsector(pSector)) { - wal.baseWall.x = wal.x; + wal.baseWall.X = wal.x; wal.baseWall.y = wal.y; } BloodSectIterator it(pSector); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 2d08aaaac..17ac984cf 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -384,7 +384,7 @@ int32_t g_frameRate; static void DrawMap(spritetype* pSprite) { int tm = 0; - if (windowxy1.x > 0) + if (windowxy1.X > 0) { setViewport(Hud_Stbar); tm = 1; @@ -785,8 +785,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a double x = xdim / 2. + x1 / double(1 << 12); double y = ydim / 2. + y1 / double(1 << 12); // This very likely needs fixing later - DrawTexture(twod, tileGetTexture(nTile, true), xx, yy, DTA_ClipLeft, windowxy1.x, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z/1536., DTA_ScaleY, z/1536., DTA_CenterOffset, true, - DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE); + DrawTexture(twod, tileGetTexture(nTile, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z/1536., DTA_ScaleY, z/1536., DTA_CenterOffset, true, + DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE); } } return true; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 015c0f076..a121ced6e 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -291,7 +291,7 @@ void ms(DDukeActor* const actor) vec2_t t; rotatepoint({ 0, 0 }, { msx[j], msy[j] }, k & 2047, &t); - dragpoint(&wal, actor->spr.x + t.x, actor->spr.y + t.y); + dragpoint(&wal, actor->spr.x + t.X, actor->spr.y + t.y); j++; } } @@ -2714,7 +2714,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE) vec2_t res; rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res); - ps[p].bobposx += res.x - ps[p].pos.x; + ps[p].bobposx += res.X - ps[p].pos.x; ps[p].bobposy += res.y - ps[p].pos.y; ps[p].pos.vec2 = res; @@ -4326,7 +4326,7 @@ void handle_se26(DDukeActor* actor) for (int p = connecthead; p >= 0; p = connectpoint2[p]) if (ps[p].GetActor()->sector() == actor->spr.sector() && ps[p].on_ground) { - ps[p].fric.x += l << 5; + ps[p].fric.X += l << 5; ps[p].fric.y += x << 5; ps[p].pos.z += actor->spr.zvel; } @@ -4466,7 +4466,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2, { if (abs(ps[p].pos.z - ps[p].truefz) < gs.playerheight + (9 << 8)) { - ps[p].fric.x += x << 3; + ps[p].fric.X += x << 3; ps[p].fric.y += l << 3; } } diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index e7199e13a..e4f378668 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -317,7 +317,7 @@ void cameratext(DDukeActor *cam) { auto drawitem = [=](int tile, double x, double y, bool flipx, bool flipy) { - DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_CenterOffsetRel, 2, + DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_CenterOffsetRel, 2, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, DTA_FlipX, flipx, DTA_FlipY, flipy, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE); }; if (!cam->temp_data[0]) diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index 23527d51b..30a185ec4 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -179,7 +179,7 @@ inline void clearfriction() { for (int i = 0; i != -1; i = connectpoint2[i]) { - ps[i].fric.x = ps[i].fric.y = 0; + ps[i].fric.X = ps[i].fric.y = 0; } } diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 42b5154f1..fa7dce579 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -850,7 +850,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju if (packet) { *packet = loc; - packet->fvel = MulScale(loc.fvel, p->angle.ang.bcos(), 9) + MulScale(loc.svel, p->angle.ang.bsin(), 9) + p->fric.x; + packet->fvel = MulScale(loc.fvel, p->angle.ang.bcos(), 9) + MulScale(loc.svel, p->angle.ang.bsin(), 9) + p->fric.X; packet->svel = MulScale(loc.fvel, p->angle.ang.bsin(), 9) - MulScale(loc.svel, p->angle.ang.bcos(), 9) + p->fric.y; loc = {}; } diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 1f17343d6..007e1a5fe 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -1027,7 +1027,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i { spawned->spr.xvel = -12; auto delta = hit.hitWall->delta(); - spawned->spr.ang = getangle(-delta.x, -delta.y) + 512; // note the '-' sign here! + spawned->spr.ang = getangle(-delta.X, -delta.y) + 512; // note the '-' sign here! spawned->spr.x = hit.hitpos.x; spawned->spr.y = hit.hitpos.y; spawned->spr.z = hit.hitpos.z; diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index bd58092ef..20610c426 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -516,7 +516,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa { hole->spr.xvel = -1; auto delta = hit.hitWall->delta(); - hole->spr.ang = getangle(-delta.x, -delta.y) + 512; + hole->spr.ang = getangle(-delta.X, -delta.y) + 512; ssp(hole, CLIPMASK0); } } @@ -896,7 +896,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) ssp(bomb, CLIPMASK0); bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL; auto delta = hit.hitWall->delta(); - bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.x, -delta.y) - 512; + bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.X, -delta.y) - 512; if (p >= 0) ps[p].ammo_amount[TRIPBOMB_WEAPON]--; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 38d4432bc..f0db65535 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -412,7 +412,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa { l->spr.xvel = -1; auto delta = hit.hitWall->delta(); - l->spr.ang = getangle(-delta.x, -delta.y) + 512; + l->spr.ang = getangle(-delta.X, -delta.y) + 512; ssp(l, CLIPMASK0); } } diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 82c661325..a0c24ce17 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -151,7 +151,7 @@ void resetplayerstats(int snum) p->posxv = 0; //!! p->posyv = 0; p->poszv = 0; - p->fric.x = 0; + p->fric.X = 0; p->fric.y = 0; p->somethingonplayer =nullptr; p->angle.spin = 0; diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index a7a637b27..3bcec9508 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -114,7 +114,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, ("horizon", w.horizon) .Array("gotweapon", w.gotweapon, MAX_WEAPONS) ("pals", w.pals) - ("fricx", w.fric.x) + ("fricx", w.fric.X) ("fricy", w.fric.y) ("exitx", w.exitx) ("exity", w.exity) diff --git a/source/games/duke/src/sbar.cpp b/source/games/duke/src/sbar.cpp index 66c0a61ee..38ec32dbb 100644 --- a/source/games/duke/src/sbar.cpp +++ b/source/games/duke/src/sbar.cpp @@ -61,19 +61,19 @@ void DrawBorder() { twod->AddFlatFill(0, windowxy2.y + 1, twod->GetWidth(), twod->GetHeight(), tex, false, 1); } - if (windowxy1.x > 0) + if (windowxy1.X > 0) { - twod->AddFlatFill(0, windowxy1.y, windowxy1.x, windowxy2.y + 1, tex, false, 1); + twod->AddFlatFill(0, windowxy1.y, windowxy1.X, windowxy2.y + 1, tex, false, 1); } - if (windowxy2.x + 1 < twod->GetWidth()) + if (windowxy2.X + 1 < twod->GetWidth()) { - twod->AddFlatFill(windowxy2.x + 1, windowxy1.y, twod->GetWidth(), windowxy2.y + 1, tex, false, 1); + twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, twod->GetWidth(), windowxy2.y + 1, tex, false, 1); } auto vb = tileGetTexture(TILE_VIEWBORDER); auto ve = tileGetTexture(TILE_VIEWBORDER + 1); - int x1 = windowxy1.x - 4; + int x1 = windowxy1.X - 4; int y1 = windowxy1.y - 4; - int x2 = windowxy2.x + 5; + int x2 = windowxy2.X + 5; int y2 = windowxy2.y + 5; twod->AddFlatFill(x1, y1, x2, y1 + 4, vb, 5); twod->AddFlatFill(x1, y2 - 4, x2, y2, vb, 6); diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index b19c5b2f3..9dcdb40a0 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -692,7 +692,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw { spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER; auto delta = wal->delta(); - spawned->spr.ang = getangle(-delta.x, -delta.y) - 512; + spawned->spr.ang = getangle(-delta.X, -delta.y) - 512; S_PlayActorSound(SOMETHINGHITFORCE, spawned); } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 3d339e0ca..23500414a 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -951,15 +951,15 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n) auto delta = wal->delta(); - x1 -= Sgn(delta.x); + x1 -= Sgn(delta.X); y1 += Sgn(delta.y); - delta.x /= j; + delta.X /= j; delta.y /= j; for (j = n; j > 0; j--) { - x1 += delta.x; + x1 += delta.X; y1 += delta.y; updatesector(x1, y1, §); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 7786600f6..737c437d7 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -1092,12 +1092,12 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n) auto delta = wal->delta() / (n + 1); x1 -= Sgn(delta.y); - y1 += Sgn(delta.x); + y1 += Sgn(delta.X); for (j = n; j > 0; j--) { - x1 += delta.x; + x1 += delta.X; y1 += delta.y; updatesector(x1, y1, §); @@ -1149,7 +1149,7 @@ void ceilingglass(DDukeActor* actor, sectortype* sectp, int n) for (j = n; j > 0; j--) { - x1 += delta.x; + x1 += delta.X; y1 += delta.y; a = krand() & 2047; z = sectp->ceilingz + ((krand() & 15) << 8); @@ -1188,7 +1188,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n) for (j = n; j > 0; j--) { - x1 += delta.x; + x1 += delta.X; y1 += delta.y; updatesector(x1, y1, §); diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index 4b267fcee..78badbcac 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -262,7 +262,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val) if (!var_18) { - int x2 = x - average.x; + int x2 = x - average.X; if (x2 < 0) { x2 = -x2; } diff --git a/source/games/exhumed/src/map.cpp b/source/games/exhumed/src/map.cpp index 3c7172ebd..facc1ed10 100644 --- a/source/games/exhumed/src/map.cpp +++ b/source/games/exhumed/src/map.cpp @@ -100,8 +100,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a double x = xdim / 2. + x1 / double(1 << 12); double y = ydim / 2. + y1 / double(1 << 12); // This very likely needs fixing later - DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.x, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true, - DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE); + DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true, + DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE); break; } } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index d418c6a43..91e7285f3 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -1259,7 +1259,7 @@ int GetWallNormal(walltype* pWall) { auto delta = pWall->delta(); - int nAngle = GetMyAngle(delta.x, delta.y); + int nAngle = GetMyAngle(delta.X, delta.y); return (nAngle + 512) & kAngleMask; } diff --git a/source/games/exhumed/src/status.cpp b/source/games/exhumed/src/status.cpp index 41f6f3490..8fa3e12d8 100644 --- a/source/games/exhumed/src/status.cpp +++ b/source/games/exhumed/src/status.cpp @@ -124,13 +124,13 @@ void UpdateFrame() twod->AddFlatFill(0, 0, xdim, windowxy1.y - 3, tex); twod->AddFlatFill(0, windowxy2.y + 4, xdim, ydim, tex); - twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.x - 3, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy2.x + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex); + twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex); + twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy1.x - 3, windowxy1.y - 3, windowxy1.x, windowxy2.y + 1, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy1.x, windowxy1.y - 3, windowxy2.x + 4, windowxy1.y, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy2.x + 1, windowxy1.y, windowxy2.x + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); - twod->AddFlatFill(windowxy1.x - 3, windowxy2.y + 1, windowxy2.x + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); } void StatusMessage(int messageTime, const char* fmt, ...) diff --git a/source/games/sw/src/mclip.cpp b/source/games/sw/src/mclip.cpp index 3a1ced2ad..c5e376026 100644 --- a/source/games/sw/src/mclip.cpp +++ b/source/games/sw/src/mclip.cpp @@ -164,7 +164,7 @@ int testquadinsect(int *point_num, vec2_t const * q, sectortype* sect) for (i=0; i < 4; i++) { - if (!inside(q[i].x, q[i].y, sect)) + if (!inside(q[i].X, q[i].y, sect)) { *point_num = i; @@ -175,8 +175,8 @@ int testquadinsect(int *point_num, vec2_t const * q, sectortype* sect) for (i=0; i<4; i++) { next_i = (i+1) & 3; - if (!cansee(q[i].x, q[i].y,0x3fffffff, sect, - q[next_i].x, q[next_i].y,0x3fffffff, sect)) + if (!cansee(q[i].X, q[i].y,0x3fffffff, sect, + q[next_i].X, q[next_i].y,0x3fffffff, sect)) { return false; } @@ -195,7 +195,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) for (i = 0; i < 4; i++) { - xy[i].x = qx[i] + (pp->xvect>>14); + xy[i].X = qx[i] + (pp->xvect>>14); xy[i].y = qy[i] + (pp->yvect>>14); } @@ -214,7 +214,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) { for (i = 0; i < 4; i++) { - xy[i].x = qx[i] - (pp->yvect>>15); + xy[i].X = qx[i] - (pp->yvect>>15); xy[i].y = qy[i] + (pp->xvect>>15); } if (testquadinsect(&point_num, xy, pp->cursector)) @@ -230,7 +230,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy) { for (i = 0; i < 4; i++) { - xy[i].x = qx[i] + (pp->yvect>>15); + xy[i].X = qx[i] + (pp->yvect>>15); xy[i].y = qy[i] - (pp->xvect>>15); } if (testquadinsect(&point_num, xy, pp->cursector)) @@ -289,7 +289,7 @@ short RectClipTurn(PLAYERp pp, short new_ang, int *qx, int *qy, int *ox, int *oy // move to new pos for (i = 0; i < 4; i++) { - qx[i] = xy[i].x; + qx[i] = xy[i].X; qy[i] = xy[i].y; } return true; diff --git a/source/games/sw/src/rotator.cpp b/source/games/sw/src/rotator.cpp index e27be7ec1..dbcc65400 100644 --- a/source/games/sw/src/rotator.cpp +++ b/source/games/sw/src/rotator.cpp @@ -373,7 +373,7 @@ int DoRotator(DSWActor* actor) vec2_t const orig = { r->origX[ndx], r->origY[ndx] }; rotatepoint(pivot->pos.vec2, orig, r->pos, &nxy); - dragpoint(&wal, nxy.x, nxy.y); + dragpoint(&wal, nxy.X, nxy.y); ndx++; } diff --git a/source/games/sw/src/sbar.cpp b/source/games/sw/src/sbar.cpp index da7f0b405..52c2d65b0 100644 --- a/source/games/sw/src/sbar.cpp +++ b/source/games/sw/src/sbar.cpp @@ -59,13 +59,13 @@ static void UpdateFrame(void) twod->AddFlatFill(0, 0, xdim, windowxy1.y - 3, tex); twod->AddFlatFill(0, windowxy2.y + 4, xdim, ydim, tex); - twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.x - 3, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy2.x + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex); + twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex); + twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex); - twod->AddFlatFill(windowxy1.x - 3, windowxy1.y - 3, windowxy1.x, windowxy2.y + 1, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy1.x, windowxy1.y - 3, windowxy2.x + 4, windowxy1.y, tex, 0, 1, 0xff545454); - twod->AddFlatFill(windowxy2.x + 1, windowxy1.y, windowxy2.x + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); - twod->AddFlatFill(windowxy1.x - 3, windowxy2.y + 1, windowxy2.x + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454); + twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); + twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a); } //--------------------------------------------------------------------------- diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 287fa54c3..e3c3a8c54 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1710,11 +1710,11 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny) if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER)) { - dragpoint(&wal, rxy.x, rxy.y); + dragpoint(&wal, rxy.X, rxy.y); } else { - wal.move(rxy.x, rxy.y); + wal.move(rxy.X, rxy.y); } } diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index d9d09ffe9..692eac8ec 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -343,7 +343,7 @@ void PM_WriteSavePic(FileWriter* file, int width, int height) xdim = oldx; ydim = oldy; - videoSetViewableArea(oldwindowxy1.x, oldwindowxy1.y, oldwindowxy2.x, oldwindowxy2.y); + videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.y, oldwindowxy2.X, oldwindowxy2.y); // The 2D drawers can contain some garbage from the dirty render setup. Get rid of that first. twod->Clear();