From d3bc2f39a4f2050206915c5863c57106b6890a94 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 25 Nov 2022 22:28:12 +1100 Subject: [PATCH] - Blood: Remove all remaining angle wrapper usage. --- source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/osdcmd.cpp | 3 ++- source/games/blood/src/player.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index ffe2f5157..0033baab5 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -9278,7 +9278,7 @@ void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng) { PLAYER* pPlayer = getPlayerById(pSpr->spr.type); if (pPlayer) - pPlayer->Angles.ZzANGLE() = nAng; + pPlayer->actor->spr.Angles.Yaw = nAng; else { pSpr->spr.Angles.Yaw = nAng; diff --git a/source/games/blood/src/osdcmd.cpp b/source/games/blood/src/osdcmd.cpp index be40e5834..e9856a38a 100644 --- a/source/games/blood/src/osdcmd.cpp +++ b/source/games/blood/src/osdcmd.cpp @@ -40,7 +40,8 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang) if (ang != DAngle::fromDeg(INT_MIN)) { - pPlayer->Angles.ZzOLDANGLE() = pPlayer->Angles.ZzANGLE() = ang; + pPlayer->actor->spr.Angles.Yaw = ang; + pPlayer->actor->backupang(); } } diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 06c4e8f85..fb00797aa 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -822,7 +822,7 @@ void playerStart(int nPlayer, int bNewLevel) pPlayer->actor->xspr.health = pDudeInfo->startHealth << 4; pPlayer->actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; pPlayer->bloodlust = 0; - pPlayer->Angles.ZzHORIZON() = pPlayer->Angles.ViewAngles.Pitch = nullAngle; + pPlayer->actor->spr.Angles.Pitch = pPlayer->Angles.ViewAngles.Pitch = nullAngle; pPlayer->slope = 0; pPlayer->fragger = nullptr; pPlayer->underwaterTime = 1200; @@ -1544,11 +1544,11 @@ void ProcessInput(PLAYER* pPlayer) DBloodActor* fragger = pPlayer->fragger; if (fragger) { - pPlayer->Angles.addYaw(deltaangle(pPlayer->Angles.ZzANGLE(), (fragger->spr.pos.XY() - actor->spr.pos.XY()).Angle())); + pPlayer->Angles.addYaw(deltaangle(pPlayer->actor->spr.Angles.Yaw, (fragger->spr.pos.XY() - actor->spr.pos.XY()).Angle())); } pPlayer->deathTime += 4; if (!bSeqStat) - pPlayer->Angles.addPitch(deltaangle(pPlayer->Angles.ZzHORIZON(), gi->playerPitchMax() * (1. - BobVal(min((pPlayer->deathTime << 3) + 512, 1536))) * 0.5)); + pPlayer->Angles.addPitch(deltaangle(pPlayer->actor->spr.Angles.Pitch, gi->playerPitchMax() * (1. - BobVal(min((pPlayer->deathTime << 3) + 512, 1536))) * 0.5)); if (pPlayer->curWeapon) pInput->setNewWeapon(pPlayer->curWeapon); if (pInput->actions & SB_OPEN) @@ -1722,7 +1722,7 @@ void ProcessInput(PLAYER* pPlayer) pPlayer->Angles.unlockYaw(); pPlayer->Angles.unlockPitch(); - pPlayer->slope = pPlayer->Angles.ZzHORIZON().Tan(); + pPlayer->slope = pPlayer->actor->spr.Angles.Pitch.Tan(); if (pInput->actions & SB_INVPREV) { pInput->actions &= ~SB_INVPREV;