From 8bc34f3dacf9cd1231837d17723395d2f8cad2d0 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 30 Sep 2022 21:51:37 +1000 Subject: [PATCH] - Handle all remaining `VecToAngle()` calls. --- source/games/blood/src/actor.cpp | 2 +- source/games/blood/src/ai.cpp | 2 +- source/games/blood/src/aizomba.cpp | 2 +- source/games/blood/src/callback.cpp | 2 +- source/games/blood/src/nnexts.cpp | 8 ++++---- source/games/blood/src/weapon.cpp | 2 +- source/games/duke/src/actors.cpp | 2 +- source/games/duke/src/actors_d.cpp | 2 +- source/games/duke/src/actors_r.cpp | 4 ++-- source/games/duke/src/animatesprites_d.cpp | 8 ++++---- source/games/duke/src/animatesprites_r.cpp | 18 +++++++++--------- source/games/duke/src/player_d.cpp | 10 +++++----- source/games/duke/src/player_r.cpp | 6 +++--- source/games/exhumed/src/anubis.cpp | 4 ++-- source/games/exhumed/src/fish.cpp | 4 ++-- source/games/exhumed/src/gun.cpp | 2 +- source/games/exhumed/src/lavadude.cpp | 2 +- source/games/exhumed/src/lion.cpp | 4 ++-- source/games/exhumed/src/move.cpp | 2 +- source/games/exhumed/src/mummy.cpp | 2 +- source/games/exhumed/src/object.cpp | 2 +- source/games/exhumed/src/roach.cpp | 4 ++-- source/games/exhumed/src/scorp.cpp | 4 ++-- source/games/exhumed/src/set.cpp | 2 +- source/games/exhumed/src/spider.cpp | 2 +- source/games/sw/src/actor.cpp | 4 ++-- source/games/sw/src/ai.cpp | 16 ++++++++-------- source/games/sw/src/bunny.cpp | 4 ++-- source/games/sw/src/draw.cpp | 2 +- source/games/sw/src/game.h | 6 +++--- source/games/sw/src/morph.cpp | 2 +- source/games/sw/src/player.cpp | 8 ++++---- source/games/sw/src/ripper.cpp | 2 +- source/games/sw/src/ripper2.cpp | 2 +- source/games/sw/src/skull.cpp | 4 ++-- source/games/sw/src/track.cpp | 22 +++++++++++----------- source/games/sw/src/weapon.cpp | 10 +++++----- source/games/sw/src/weapon.h | 4 ++-- 38 files changed, 94 insertions(+), 94 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 8f751e61d..dc3152541 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4681,7 +4681,7 @@ static Collision MoveThing(DBloodActor* actor) } } if (actor->vel.X != 0 || actor->vel.Y != 0) - actor->spr.angle = VecToAngle(actor->vel); + actor->spr.angle = actor->vel.Angle(); return lhit; } diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 0f3623ccc..eb2fd2f8f 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -353,7 +353,7 @@ void aiActivateDude(DBloodActor* actor) assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); if (!actor->xspr.state) { - aiChooseDirection(actor, VecToAngle(actor->xspr.TargetPos - actor->spr.pos)); + aiChooseDirection(actor, (actor->xspr.TargetPos - actor->spr.pos).Angle()); actor->xspr.state = 1; } switch (actor->spr.type) diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index 56529a2e0..198df1e28 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -265,7 +265,7 @@ static void entryAIdle(DBloodActor* actor) static void entryEStand(DBloodActor* actor) { sfxPlay3DSound(actor, 1100, -1, 0); - actor->spr.angle = VecToAngle(actor->xspr.TargetPos - actor->spr.pos); + actor->spr.angle = (actor->xspr.TargetPos - actor->spr.pos).Angle(); } END_BLD_NS diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index d721acdd9..e13b7eb84 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -730,7 +730,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused evPostActor(actor, 0, kCallbackRemove); return; } - actor->spr.angle = VecToAngle(Owner->spr.pos - actor->spr.pos); + actor->spr.angle = (Owner->spr.pos - actor->spr.pos).Angle(); if (actor->hasX()) { if (actor->xspr.data1 == 0) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 33f6ea2b6..9e39f5e3c 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1338,7 +1338,7 @@ void nnExtProcessSuperSprites() debrisMove(i); if (!debrisactor->vel.XY().isZero()) - debrisactor->xspr.goalAng = VecToAngle(debrisactor->vel); + debrisactor->xspr.goalAng = debrisactor->vel.Angle(); debrisactor->norm_ang(); DAngle ang = debrisactor->spr.angle; @@ -3100,7 +3100,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi pSprite->vel == vv; } - auto vAng = VecToAngle(pSprite->vel); + auto vAng = pSprite->vel.Angle(); if (toAng) { @@ -3113,7 +3113,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi pSprite->vel.XY() = pt; - vAng = VecToAngle(pSprite->vel); + vAng = pSprite->vel.Angle(); } if (chgDstAng) @@ -8949,7 +8949,7 @@ void aiPatrolThink(DBloodActor* actor) } } - nnExtAiSetDirection(actor, VecToAngle(markeractor->spr.pos - actor->spr.pos)); + nnExtAiSetDirection(actor, (markeractor->spr.pos - actor->spr.pos).Angle()); if (aiPatrolMoving(actor->xspr.aiState) && !reached) return; else if (uwater) aiPatrolState(actor, kAiStatePatrolMoveW); diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 1ddeb060f..64728e905 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -480,7 +480,7 @@ void UpdateAimVector(PLAYER* pPlayer) if (lpos.Z - zRange > bottom || lpos.Z + zRange < top) continue; - DAngle angle = VecToAngle(pos2 - pos); + DAngle angle = (pos2 - pos).Angle(); DAngle deltaangle = absangle(angle, plActor->spr.angle); if (deltaangle > DAngle::fromBuild(pWeaponTrack->angleRange)) continue; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 68f12d3ac..692b5efb0 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -3284,7 +3284,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER) if (x < 512) { auto ang = actor->spr.angle; - actor->spr.angle = VecToAngle(actor->spr.pos.XY() - ps[p].pos); + actor->spr.angle = (actor->spr.pos.XY() - ps[p].pos).Angle(); fi.shoot(actor, FIRELASER); actor->spr.angle = ang; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 3262d7a0b..ddd4425b1 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -350,7 +350,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector())) { - act2->hitang = VecToAngle(act2->spr.pos - actor->spr.pos); + act2->hitang = (act2->spr.pos - actor->spr.pos).Angle(); if (actor->spr.picnum == RPG && act2->spr.extra > 0) act2->attackertype = RPG; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index d4dc66134..7f4dddc5b 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -301,7 +301,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h continue; } - act2->hitang = VecToAngle(act2->spr.pos - actor->spr.pos); + act2->hitang = (act2->spr.pos - actor->spr.pos).Angle(); if (actor->spr.picnum == RPG && act2->spr.extra > 0) act2->attackertype = RPG; @@ -934,7 +934,7 @@ static void chickenarrow(DDukeActor* actor) if (actor->seek_actor && actor->spr.hitag > 5) { DAngle ang, ang2; - ang = VecToAngle(ts->spr.pos - actor->spr.pos); + ang = (ts->spr.pos - actor->spr.pos).Angle(); ang2 = deltaangle(ang, actor->spr.angle); // this was quite broken in the original code. Fixed so that it seeks properly if (abs(ang2) < DAngle1 * 17.5) diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index b77ccf814..d4990bede 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -262,7 +262,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; } - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -280,7 +280,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; } - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) @@ -508,7 +508,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case 5: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation1(h->spr.angle, kang); if (k > 4) { @@ -518,7 +518,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 7: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index dd4e8fd30..e5f2466ce 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -256,7 +256,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else if (OwnerAc->spr.picnum == MAMA) { - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation1(h->spr.angle, kang); if (k > 4) { @@ -274,7 +274,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case EMPTYBIKE: if (!isRRRA()) goto default_case; - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -286,7 +286,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case EMPTYBOAT: if (!isRRRA()) goto default_case; - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -297,7 +297,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->picnum = EMPTYBOAT + k; break; case RPG: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -309,7 +309,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case RPG2: if (!isRRRA()) goto default_case; - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -322,7 +322,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case RECON: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) @@ -641,7 +641,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case 5: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation1(h->spr.angle, kang); if (k > 4) { @@ -651,7 +651,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 7: - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation2(h->spr.angle, kang); if (k > 6) { @@ -668,7 +668,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi bg = badguy(h); if (bg && h->spr.statnum == 2 && h->spr.extra > 0) { - kang = VecToAngle(h->spr.pos - viewVec); + kang = (h->spr.pos - viewVec).Angle(); k = angletorotation1(h->spr.angle, kang); if (k > 4) { diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 0767a198f..f95ccce4b 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -357,7 +357,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int } double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length(); zvel = ((aimed->spr.pos.Z - pos.Z - dal) * 16) / dist; - ang = VecToAngle(aimed->spr.pos - pos); + ang = (aimed->spr.pos - pos).Angle(); } if (isWW2GI()) @@ -401,7 +401,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int } else { - ang = VecToAngle(ps[j].pos - pos) + DAngle22_5 / 2 - randomAngle(22.5); + ang = (ps[j].pos - pos).Angle() + DAngle22_5 / 2 - randomAngle(22.5); } } @@ -908,8 +908,8 @@ static void shootlaser(DDukeActor* actor, int p, DVector3 pos, DAngle ang) bomb->vel.X = -1.25; ssp(bomb, CLIPMASK0); bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL; - auto delta = hit.hitWall->delta(); - bomb->spr.angle = VecToAngle(-delta.X, -delta.Y) - DAngle90; + auto delta = -hit.hitWall->delta(); + bomb->spr.angle = delta.Angle() - DAngle90; bomb->temp_angle = bomb->spr.angle; if (p >= 0) @@ -2815,7 +2815,7 @@ void processinput_d(int snum) } else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(pact->spr.pos.Z - clz.actor()->spr.pos.Z) < 84) { - auto ang = VecToAngle(clz.actor()->spr.pos - p->pos); + auto ang = (clz.actor()->spr.pos - p->pos).Angle(); p->vel.XY() -= ang.ToVector(); } } diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 816608420..681cec4a7 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -216,7 +216,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 5; double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length(); zvel = ((aimed->spr.pos.Z - pos.Z - dal) * 16) / dist; - ang = VecToAngle(aimed->spr.pos - pos); + ang = (aimed->spr.pos - pos).Angle(); } if (atwith == SHOTSPARK1) @@ -254,7 +254,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int else { zvel += 0.5 - krandf(1); - ang = VecToAngle(ps[j].pos - pos) + DAngle22_5 / 2 - randomAngle(22.5); + ang = (ps[j].pos - pos).Angle() + DAngle22_5 / 2 - randomAngle(22.5); } } @@ -3471,7 +3471,7 @@ void processinput_r(int snum) } else if (badguy(clz.actor()) && clz.actor()->spr.xrepeat > 24 && abs(pact->spr.pos.Z - clz.actor()->spr.pos.Z) < 84) { - auto ang = VecToAngle(clz.actor()->spr.pos - p->pos); + auto ang = (clz.actor()->spr.pos - p->pos).Angle(); p->vel.XY() -= ang.ToVector(); } if (clz.actor()->spr.picnum == LADDER) diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 9a1600b04..41be07550 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -189,7 +189,7 @@ void AIAnubis::Tick(RunListEvent* ev) { if (move.actor() == pTarget) { - auto nAngDiff = absangle(ap->spr.angle, VecToAngle(pTarget->spr.pos - ap->spr.pos)); + auto nAngDiff = absangle(ap->spr.angle, (pTarget->spr.pos - ap->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { ap->nAction = 2; @@ -224,7 +224,7 @@ void AIAnubis::Tick(RunListEvent* ev) { ap->vel.X = 0; ap->vel.Y = 0; - ap->spr.angle = VecToAngle(pTarget->spr.pos - ap->spr.pos); + ap->spr.angle = (pTarget->spr.pos - ap->spr.pos).Angle(); ap->nAction = 3; ap->nFrame = 0; diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 68d8f0bc0..3f0c5ccbc 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -394,7 +394,7 @@ void AIFish::Tick(RunListEvent* ev) pActor->nAction = 2; pActor->nFrame = 0; - DAngle nAngle = VecToAngle(pTargetActor->spr.pos - pActor->spr.pos); + DAngle nAngle = (pTargetActor->spr.pos - pActor->spr.pos).Angle(); pActor->vel.Z = nAngle.Sin() * 2; pActor->nCount = RandomSize(6) + 90; @@ -508,7 +508,7 @@ void AIFish::Tick(RunListEvent* ev) if (pHitAct->spr.statnum == 100) { pActor->pTarget = coll.actor(); - pActor->spr.angle = VecToAngle(pHitAct->spr.pos - pActor->spr.pos); + pActor->spr.angle = (pHitAct->spr.pos - pActor->spr.pos).Angle(); if (nAction != 3) { diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index d830f1464..82aa9097d 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -861,7 +861,7 @@ loc_flag: DExhumedActor* t = sPlayerInput[nPlayer].pTarget; // only autoaim if target is in front of the player. assert(t->sector()); - DAngle angletotarget = VecToAngle(t->spr.pos - pPlayerActor->spr.pos); + DAngle angletotarget = (t->spr.pos - pPlayerActor->spr.pos).Angle(); DAngle anglediff = absangle(pPlayerActor->spr.angle, angletotarget); if (anglediff < DAngle90) { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index da918cae7..76e427470 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -305,7 +305,7 @@ void AILavaDude::Tick(RunListEvent* ev) { if (coll.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 9ff88503a..4489e3d01 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -302,7 +302,7 @@ void AILion::Tick(RunListEvent* ev) } else { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 3; @@ -427,7 +427,7 @@ void AILion::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 3; diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 37c55c03e..90e94f17b 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -589,7 +589,7 @@ DAngle GetAngleToSprite(DExhumedActor* a1, DExhumedActor* a2) if (!a1 || !a2) return -minAngle; - return VecToAngle(a2->spr.pos - a1->spr.pos); + return (a2->spr.pos - a1->spr.pos).Angle(); } //--------------------------------------------------------------------------- diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 5eab47299..4e9ec08da 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -284,7 +284,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 9b320affb..00d900641 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2493,7 +2493,7 @@ void DoMovingSects() int nTrail = sMoveSect[i].nTrailPoint; // TrailPoint *pTrail = &sTrailPoint[nTrail]; - auto nAngle = VecToAngle(sTrailPoint[nTrail].pos - pBlockInfo->pos); + auto nAngle = (sTrailPoint[nTrail].pos - pBlockInfo->pos).Angle(); auto vel = nAngle.ToVector() * sMoveSect[i].nMoveDist; auto delta = sTrailPoint[nTrail].pos - pBlockInfo->pos; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 432ea646d..73b5b1b81 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -301,7 +301,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); + pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nFrame = 0; } @@ -330,7 +330,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); + pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nFrame = 0; } diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 871dae040..462074ec5 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -274,7 +274,7 @@ void AIScorp::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; @@ -460,7 +460,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) { pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); + pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nIndex = RandomSize(2) + RandomSize(3); diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index f64798d00..296a4b229 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -466,7 +466,7 @@ void AISet::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - auto nAngDiff = absangle(pActor->spr.angle, VecToAngle(pTarget->spr.pos - pActor->spr.pos)); + auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 4; diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 92253cab8..8a853abb7 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -317,7 +317,7 @@ void AISpider::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(spp->spr.angle, VecToAngle(pTarget->spr.pos - spp->spr.pos)); + auto nAngDiff = absangle(spp->spr.angle, (pTarget->spr.pos - spp->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { spp->nAction = 2; diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 1bd87430a..52966fb18 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -223,7 +223,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) } actor->user.ActorActionFunc = nullptr; // Get angle to player - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos.Y) + DAngle180; + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos.Y).Angle() + DAngle180; break; case UZI_SMOKE+1: // Shotgun @@ -246,7 +246,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) DoActorBeginJump(actor); actor->user.ActorActionFunc = nullptr; // Get angle to player - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos) + DAngle180; + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle() + DAngle180; break; default: diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index c0d838d00..094388254 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -837,7 +837,7 @@ int DoActorCantMoveCloser(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, MID_SPEED); actor->user.Flags |= (SPR_FIND_PLAYER); @@ -889,7 +889,7 @@ int DoActorMoveCloser(DSWActor* actor) else { // turn to face player - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos); + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); } } @@ -1086,7 +1086,7 @@ int InitActorRunAway(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, FAST_SPEED); actor->user.Flags |= (SPR_RUN_AWAY); } @@ -1173,7 +1173,7 @@ int InitActorAttack(DSWActor* actor) //NewStateGroup(actor, actor->user.ActorActionSet->Stand); // face player when attacking - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos); + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); // If it's your own kind, lay off! if (actor->user.ID == actor->user.targetActor->user.ID && !actor->user.targetActor->user.PlayerP) @@ -1262,7 +1262,7 @@ int InitActorEvade(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, FAST_SPEED); // NOT doing a RUN_AWAY actor->user.Flags &= ~(SPR_RUN_AWAY); @@ -1289,7 +1289,7 @@ int InitActorWanderAround(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, NORM_SPEED); } @@ -1312,7 +1312,7 @@ int InitActorFindPlayer(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, MID_SPEED); actor->user.Flags |= (SPR_FIND_PLAYER); @@ -1497,7 +1497,7 @@ DAngle FindNewAngle(DSWActor* actor, int dir, double DistToMove) DistToMove *= .375; // Find angle to from the player - auto oang = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos); + auto oang = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); // choose a random angle array switch (dir) diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index 535c1ad28..90a65d886 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -851,7 +851,7 @@ int DoBunnyBeginJumpAttack(DSWActor* actor) { DSWActor* target = actor->user.targetActor; - DAngle tang = VecToAngle(target->spr.pos - actor->spr.pos); + DAngle tang = (target->spr.pos - actor->spr.pos).Angle(); Collision coll = move_sprite(actor, DVector3(tang.ToVector() * 8, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS); @@ -1116,7 +1116,7 @@ int DoBunnyRipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face bunny - target->spr.angle = VecToAngle(actor->spr.pos - target->spr.pos); + target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); return 0; } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 98c617e4d..010ed7af3 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -113,7 +113,7 @@ int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view) // Get which of the 8 angles of the sprite to draw (0-7) // rotation ranges from 0-7 - DAngle angle2 = VecToAngle(tsp->pos.X - view.X, tsp->pos.Y - view.Y); + DAngle angle2 = (tsp->pos - view).Angle(); rotation = (tsp->angle + DAngle180 + DAngle22_5 * 0.5 - angle2).Buildang() & 2047; rotation = (rotation >> 8) & 7; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index c46a5e8d5..31d5162e1 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1917,12 +1917,12 @@ inline bool SectorIsUnderwaterArea(sectortype* sect) inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, DAngle range) { - return absangle(VecToAngle(a->spr.pos - pp->pos), pp->angle.ang) < range; + return absangle((a->spr.pos - pp->pos).Angle(), pp->angle.ang) < range; } inline bool FacingRange(DSWActor* a1, DSWActor* a2, DAngle range) { - return absangle(VecToAngle(a1->spr.pos - a2->spr.pos), a2->spr.angle) < range; + return absangle((a1->spr.pos - a2->spr.pos).Angle(), a2->spr.angle) < range; } inline void SET_BOOL1(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL1; } inline void SET_BOOL2(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL2; } @@ -2040,7 +2040,7 @@ inline void SetActorSizeX(DSWActor* sp) inline bool Facing(DSWActor* actor1, DSWActor* actor2) { - return absangle(VecToAngle(actor1->spr.pos - actor2->spr.pos), actor2->spr.angle) < DAngle90; + return absangle((actor1->spr.pos - actor2->spr.pos).Angle(), actor2->spr.angle) < DAngle90; } // Given a z height and sprite return the correct y repeat value diff --git a/source/games/sw/src/morph.cpp b/source/games/sw/src/morph.cpp index 1058227d1..73ad914c7 100644 --- a/source/games/sw/src/morph.cpp +++ b/source/games/sw/src/morph.cpp @@ -338,7 +338,7 @@ void MorphTornado(SECTOR_OBJECT* sop) if ((sop->pmid - mpos).Length() > sop->morph_dist_max + sop->scale_dist) { // find and reverse angle - sop->morph_ang = VecToAngle(mpos - sop->pmid) + DAngle180; + sop->morph_ang = (mpos - sop->pmid).Angle() + DAngle180; // move back some from last point mpos = spos + sop->morph_ang.ToVector() * sop->morph_speed * 2; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 8e355b332..c78e53c4d 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1196,7 +1196,7 @@ DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets) } // Get the angle to the player - DAngle angle2 = VecToAngle(itActor->spr.pos - actor->spr.pos); + DAngle angle2 = (itActor->spr.pos - actor->spr.pos).Angle(); // Get the angle difference @@ -2543,7 +2543,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad) double const vel = pp->vect.Length() * 8; if (vel < 70.3125) { - DoActorBeginSlide(actor, VecToAngle(pp->vect.X, pp->vect.Y), vel); + DoActorBeginSlide(actor, pp->vect.Angle(), vel); if (DoActorSlide(actor)) continue; } @@ -6239,7 +6239,7 @@ void DoPlayerDeathCheckKick(PLAYER* pp) { pp->KillerActor = itActor; - plActor->user.slide_ang = VecToAngle(plActor->spr.pos - itActor->spr.pos); + plActor->user.slide_ang = (plActor->spr.pos - itActor->spr.pos).Angle(); plActor->user.slide_ang += RandomAngle(22.5) - DAngle22_5 / 2; plActor->user.slide_vel = itActor->vel.X * 2; @@ -7108,7 +7108,7 @@ void domovethings(void) // auto tracking mode for single player multi-game if (numplayers <= 1 && PlayerTrackingMode && pnum == screenpeek && screenpeek != myconnectindex) { - Player[screenpeek].angle.settarget(VecToAngle(Player[myconnectindex].pos - Player[screenpeek].pos)); + Player[screenpeek].angle.settarget((Player[myconnectindex].pos - Player[screenpeek].pos).Angle()); } if (!(pp->Flags & PF_DEAD)) diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 3a4a04f70..52363f0de 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1200,7 +1200,7 @@ int DoRipperRipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face ripper - target->spr.angle = VecToAngle(actor->spr.pos - target->spr.pos); + target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); return 0; } diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index d4881cd31..5a9754691 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1204,7 +1204,7 @@ int DoRipper2RipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face ripper2 - target->spr.angle = VecToAngle(actor->spr.pos - target->spr.pos); + target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); return 0; } diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index addb1e18a..dc17a22cd 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -492,7 +492,7 @@ int DoSkullWait(DSWActor* actor) if (dist < 500) { - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos); + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); actor->vel.X = 8 + RandomRangeF(16); actor->user.jump_speed = -700; NewStateGroup(actor, sg_SkullJump); @@ -891,7 +891,7 @@ int DoBettyWait(DSWActor* actor) if (dist < 8000) { - actor->spr.angle = VecToAngle(actor->user.targetActor->spr.pos - actor->spr.pos); + actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); actor->vel.X = 8 + RandomRangeF(16); actor->user.jump_speed = -700; NewStateGroup(actor, sg_BettyJump); diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index b509d0a6e..a29dcc7a0 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1396,7 +1396,7 @@ void PlaceSectorObjectsOnTracks(void) NextTrackPoint(sop); - sop->ang = VecToAngle((tpoint + sop->point)->pos - sop->pmid); + sop->ang = ((tpoint + sop->point)->pos - sop->pmid).Angle(); sop->ang_moving = sop->ang_tgt = sop->ang; } @@ -1459,7 +1459,7 @@ void PlaceActorsOnTracks(void) } // check angle in the "forward" direction - actor->spr.angle = VecToAngle((tpoint + actor->user.point)->pos - actor->spr.pos); + actor->spr.angle = ((tpoint + actor->user.point)->pos - actor->spr.pos).Angle(); } } @@ -1793,7 +1793,7 @@ void RefreshPoints(SECTOR_OBJECT* sop, const DVector2& move, bool dynamic) { if (!(wal.extra & WALLFX_DONT_SCALE)) { - auto ang = VecToAngle(pos - sop->pmid); + auto ang = (pos - sop->pmid).Angle(); if (sop->scale_type == SO_SCALE_RANDOM_POINT) { @@ -2190,7 +2190,7 @@ DVector2 DoTrack(SECTOR_OBJECT* sop, short locktics) // calculate an angle to the target if (sop->vel) - sop->ang_moving = sop->ang_tgt = VecToAngle(tpoint->pos - sop->pmid); + sop->ang_moving = sop->ang_tgt = (tpoint->pos - sop->pmid).Angle(); // NOTE: Jittery ride - try new value out here // NOTE: Put a loop around this (locktics) to make it more acuruate @@ -2450,7 +2450,7 @@ DVector2 DoTrack(SECTOR_OBJECT* sop, short locktics) sop->target_dist = (sop->pmid.XY() - tpoint->pos.XY()).Length(); // calculate a new angle to the target - sop->ang_moving = sop->ang_tgt = VecToAngle(tpoint->pos - sop->pmid); + sop->ang_moving = sop->ang_tgt = (tpoint->pos - sop->pmid).Angle(); if ((sop->flags & SOBJ_ZDIFF_MODE)) { @@ -2728,7 +2728,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop) } } - sop->ang_tgt = VecToAngle(actor->user.targetActor->spr.pos - sop->pmid); + sop->ang_tgt = (actor->user.targetActor->spr.pos - sop->pmid).Angle(); // get delta to target angle delta_ang = deltaangle(sop->ang, sop->ang_tgt); @@ -2767,7 +2767,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); } else { @@ -2784,7 +2784,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = VecToAngle(tp->pos - actor->spr.pos); + actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); } else { @@ -3371,7 +3371,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG))) { - actor->spr.angle = VecToAngle(tpoint->pos - actor->spr.pos); + actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); } double dist = (actor->spr.pos.XY() - tpoint->pos.XY()).Length(); @@ -3387,7 +3387,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG))) { // calculate a new angle to the target - actor->spr.angle = VecToAngle(tpoint->pos - actor->spr.pos); + actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); } if (actor->user.Flags & (SPR_ZDIFF_MODE)) @@ -3433,7 +3433,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) actor->vel.Z = 0; - actor->spr.angle = VecToAngle(tpoint->pos - actor->spr.pos); + actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); ActorLeaveTrack(actor); actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index b6bd54d7d..d67e0954b 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -5495,7 +5495,7 @@ int PlayerCheckDeath(PLAYER* pp, DSWActor* weapActor) DoPlayerBeginDie(pp); // for death direction - actor->user.slide_ang = VecToAngle(actor->spr.pos - weapActor->spr.pos); + actor->user.slide_ang = (actor->spr.pos - weapActor->spr.pos).Angle(); // for death velocity actor->user.slide_vel = actor->user.LastDamage * (5 / 16.); @@ -7890,7 +7890,7 @@ int MissileSeek(DSWActor* actor, int16_t delay_tics, DAngle aware_range/*, int16 if (goal != nullptr) { // move to correct angle - auto ang2tgt = VecToAngle(goal->spr.pos - actor->spr.pos); + auto ang2tgt = (goal->spr.pos - actor->spr.pos).Angle(); auto delta_ang = clamp(deltaangle(ang2tgt, actor->spr.angle), -DAngle45 / 8, DAngle45 / 8); actor->spr.angle -= delta_ang; @@ -7934,7 +7934,7 @@ int ComboMissileSeek(DSWActor* actor, int16_t delay_tics, DAngle aware_range/*, if (goal != nullptr) { // move to correct angle - auto ang2tgt = VecToAngle(goal->spr.pos - actor->spr.pos); + auto ang2tgt = (goal->spr.pos - actor->spr.pos).Angle(); auto delta_ang = clamp(deltaangle(ang2tgt, actor->spr.angle), -DAngle45 / 8, DAngle45 / 8); actor->spr.angle -= delta_ang; UpdateChangeXY(actor); @@ -7949,7 +7949,7 @@ int ComboMissileSeek(DSWActor* actor, int16_t delay_tics, DAngle aware_range/*, void SetAngleFromChange(DSWActor* actor) { - actor->spr.angle = VecToAngle(actor->user.change); + actor->spr.angle = actor->user.change.Angle(); } //--------------------------------------------------------------------------- @@ -15851,7 +15851,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp) { picked = ts->actor; - angle = VecToAngle(picked->spr.pos - npos); + angle = (picked->spr.pos - npos).Angle(); ts++; } diff --git a/source/games/sw/src/weapon.h b/source/games/sw/src/weapon.h index 29916dd2c..792ecd7ff 100644 --- a/source/games/sw/src/weapon.h +++ b/source/games/sw/src/weapon.h @@ -35,12 +35,12 @@ constexpr double HORIZ_MULTF = 64.; inline DAngle AngToSprite(DSWActor* actor, DSWActor* other) { - return VecToAngle(actor->spr.pos - other->spr.pos); + return (actor->spr.pos - other->spr.pos).Angle(); } inline DAngle AngToPlayer(PLAYER* player, DSWActor* other) { - return VecToAngle(player->pos - other->spr.pos); + return (player->pos - other->spr.pos).Angle(); }