From 4d02cdcce951c6c6c4da4943654bf8fd288bd185 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 15:47:52 +0200 Subject: [PATCH] - use explicit types in hitscan calls --- source/core/gamefuncs.cpp | 2 +- source/games/blood/src/gameutil.cpp | 2 +- source/games/duke/src/actors.cpp | 4 ++-- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/player_d.cpp | 8 ++++---- source/games/duke/src/player_r.cpp | 8 ++++---- source/games/exhumed/src/lion.cpp | 2 +- source/games/exhumed/src/snake.cpp | 2 +- source/games/sw/src/draw.cpp | 2 +- source/games/sw/src/rooms.cpp | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index c7a9f4beb..6391ef819 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -49,7 +49,7 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps auto bakcstat = act->spr.cstat; act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; updatesectorz(*px, *py, *pz, psect); - hitscan({ *px, *py, *pz }, *psect, np, hitinfo, CLIPMASK1); + hitscan(vec3_t( *px, *py, *pz ), *psect, np, hitinfo, CLIPMASK1); act->spr.cstat = bakcstat; int hx = hitinfo.int_hitpos().X - *px; diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 08510dbdf..1df06a69f 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -400,7 +400,7 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas { hitscangoal.X = hitscangoal.Y = 0x1fffffff; } - hitscan({ x, y, z }, actor->sector(), { dx, dy, dz << 4 }, gHitInfo, nMask); + hitscan(vec3_t( x, y, z ), actor->sector(), { dx, dy, dz << 4 }, gHitInfo, nMask); hitscangoal.X = hitscangoal.Y = 0x1fffffff; actor->spr.cstat = bakCstat; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index bc122c122..1da053f0a 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4943,7 +4943,7 @@ int furthestangle(DDukeActor *actor, int angs) for (j = actor->int_ang(); j < (2048 + actor->int_ang()); j += angincs) { - hitscan({ actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8) }, actor->sector(), { bcos(j), bsin(j), 0 }, hit, CLIPMASK1); + hitscan(vec3_t( actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8) ), actor->sector(), { bcos(j), bsin(j), 0 }, hit, CLIPMASK1); d = abs(hit.int_hitpos().X - actor->int_pos().X) + abs(hit.int_hitpos().Y - actor->int_pos().Y); @@ -4976,7 +4976,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, int* dax, int* day for (j = tosee->int_ang(); j < (2048 + tosee->int_ang()); j += (angincs - (krand() & 511))) { - hitscan({ tosee->int_pos().X, tosee->int_pos().Y, tosee->int_pos().Z - (16 << 8) }, tosee->sector(), { bcos(j), bsin(j), 16384 - (krand() & 32767) }, hit, CLIPMASK1); + hitscan(vec3_t( tosee->int_pos().X, tosee->int_pos().Y, tosee->int_pos().Z - (16 << 8) ), tosee->sector(), { bcos(j), bsin(j), 16384 - (krand() & 32767) }, hit, CLIPMASK1); d = abs(hit.int_hitpos().X - tosee->int_pos().X) + abs(hit.int_hitpos().Y - tosee->int_pos().Y); da = abs(hit.int_hitpos().X - actor->int_pos().X) + abs(hit.int_hitpos().Y - actor->int_pos().Y); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 6f99f9660..24e55cb6b 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -1024,7 +1024,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i zvel = 1024 - (krand() & 2047); - hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); // oh my... if (FindDistance2D(sx - hit.int_hitpos().X, sy - hit.int_hitpos().Y) < 1024 && diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 029f4e05c..c889fc667 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -245,7 +245,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) sa = getangle(pactor->int_pos().X - sx, pactor->int_pos().Y - sy); } - hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); if (hit.hitSector == nullptr) return; @@ -396,7 +396,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa } actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; - hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; @@ -843,7 +843,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) zvel = -ps[p].horizon.sum().asq16() >> 11; else zvel = 0; - hitscan({ sx, sy, sz - ps[p].pyoff }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz - ps[p].pyoff ), sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); j = 0; if (hit.actor()) return; @@ -957,7 +957,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int //RESHOOTGROW: actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; - hitscan({ sx, sy, sz }, sect, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sect, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 0cac17b94..02f35e8dd 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -103,7 +103,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, sa = getangle(pspr->int_pos().X - sx, pspr->int_pos().Y - sy); } - hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); if (isRRRA() && hit.hitSector != nullptr && ((hit.hitSector->lotag == 160 && zvel > 0) || (hit.hitSector->lotag == 161 && zvel < 0)) && hit.actor() == nullptr && hit.hitWall == nullptr) @@ -125,7 +125,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, { nz = effector->GetOwner()->sector()->int_ceilingz(); } - hitscan({ nx, ny, nz }, effector->GetOwner()->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( nx, ny, nz ), effector->GetOwner()->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); break; } } @@ -258,7 +258,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa } actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; - hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa),zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( sx, sy, sz ), sectp, { bcos(sa), bsin(sa),zvel << 6 }, hit, CLIPMASK1); if (isRRRA() && hit.hitSector != nullptr && (((hit.hitSector->lotag == 160 && zvel > 0) || (hit.hitSector->lotag == 161 && zvel < 0)) && hit.actor() == nullptr && hit.hitWall == nullptr)) @@ -280,7 +280,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa { nz = effector->GetOwner()->sector()->int_ceilingz(); } - hitscan({ nx, ny, nz }, effector->GetOwner()->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); + hitscan(vec3_t( nx, ny, nz ), effector->GetOwner()->sector(), { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); break; } } diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index dae22770d..6f12d21b2 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -393,7 +393,7 @@ void AILion::Tick(RunListEvent* ev) { HitInfo hit{}; - hitscan({ x, y, z }, pActor->sector(), { bcos(nScanAngle), bsin(nScanAngle), 0 }, hit, CLIPMASK1); + hitscan(vec3_t( x, y, z ), pActor->sector(), { bcos(nScanAngle), bsin(nScanAngle), 0 }, hit, CLIPMASK1); if (hit.hitWall) { diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index f1ccbcc78..b3b3012ff 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -139,7 +139,7 @@ void BuildSnake(int nPlayer, int zVal) int nAngle = pPlayerActor->int_ang(); HitInfo hit{}; - hitscan({ x, y, z }, pPlayerActor->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1); + hitscan(vec3_t( x, y, z ), pPlayerActor->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1); uint32_t yDiff = abs(hit.int_hitpos().Y - y); uint32_t xDiff = abs(hit.int_hitpos().X - x); diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 4bc803c8b..4c53178e4 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -944,7 +944,7 @@ void CircleCamera(int *nx, int *ny, int *nz, sectortype** vsect, DAngle *nang, f // Make sure sector passed to hitscan is correct //updatesector(*nx, *ny, vsect); - hitscan({ *nx, *ny, *nz }, *vsect, { vx, vy, vz }, hit, CLIPMASK_MISSILE); + hitscan(vec3_t( *nx, *ny, *nz ), *vsect, { vx, vy, vz }, hit, CLIPMASK_MISSILE); actor->spr.cstat = bakcstat; // Restore cstat diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index f0f282385..25cd8aba4 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -131,7 +131,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect, if (clipmask == CLIPMASK_MISSILE) startclipmask = CLIPMASK_WARP_HITSCAN; - hitscan({ x, y, z }, sect, { xvect, yvect, zvect }, hit, startclipmask); + hitscan(vec3_t( x, y, z ), sect, { xvect, yvect, zvect }, hit, startclipmask); if (hit.hitSector == nullptr) return;