- use explicit types in hitscan calls

This commit is contained in:
Christoph Oelckers 2022-08-20 15:47:52 +02:00
parent 5455ce42c0
commit 4d02cdcce9
10 changed files with 17 additions and 17 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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 &&

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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)
{

View file

@ -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);

View file

@ -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

View file

@ -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;