From 58c1efb8deffab8bbddd463624e579dfe7199837 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 25 Nov 2022 22:32:28 +1100 Subject: [PATCH] - Exhumed: Remove all remaining angle wrapper usage. --- source/games/exhumed/src/gun.cpp | 6 +++--- source/games/exhumed/src/osdcmds.cpp | 2 +- source/games/exhumed/src/player.cpp | 18 +++++++++--------- source/games/exhumed/src/sequence.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 044ac2296..fd7f207fb 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -729,7 +729,7 @@ loc_flag: // loc_27266: case kWeaponSword: { - nHeight += PlayerList[nLocalPlayer].Angles.ZzHORIZON().Tan() * 32.; + nHeight += PlayerList[nLocalPlayer].pActor->spr.Angles.Pitch.Tan() * 32.; thePos.Z += nHeight; @@ -834,7 +834,7 @@ loc_flag: } case kWeaponPistol: { - double h = PlayerList[nLocalPlayer].Angles.ZzHORIZON().Tan() * 2.; + double h = PlayerList[nLocalPlayer].pActor->spr.Angles.Pitch.Tan() * 2.; nHeight += h; DExhumedActor* target = nullptr; @@ -858,7 +858,7 @@ loc_flag: case kWeaponGrenade: { - ThrowGrenade(nPlayer, nHeight - 10, PlayerList[nLocalPlayer].Angles.ZzHORIZON().Tan()); + ThrowGrenade(nPlayer, nHeight - 10, PlayerList[nLocalPlayer].pActor->spr.Angles.Pitch.Tan()); break; } case kWeaponStaff: diff --git a/source/games/exhumed/src/osdcmds.cpp b/source/games/exhumed/src/osdcmds.cpp index 86e50e978..45a18fa47 100644 --- a/source/games/exhumed/src/osdcmds.cpp +++ b/source/games/exhumed/src/osdcmds.cpp @@ -48,7 +48,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang) if (ang != DAngle::fromDeg(INT_MIN)) { - nPlayer->Angles.ZzOLDANGLE() = nPlayer->Angles.ZzANGLE() = ang; + nPlayer->pActor->PrevAngles.Yaw = nPlayer->pActor->spr.Angles.Yaw = ang; } } diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 0fe41cf32..2c595cef5 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -408,7 +408,7 @@ void RestartPlayer(int nPlayer) plr->nThrust.Zero(); - plr->nDestVertPan = plr->Angles.ZzOLDHORIZON() = plr->Angles.ZzHORIZON() = nullAngle; + plr->nDestVertPan = plr->pActor->PrevAngles.Pitch = plr->pActor->spr.Angles.Pitch = nullAngle; plr->nBreathTimer = 90; plr->nTauntTimer = RandomSize(3) + 3; @@ -504,7 +504,7 @@ void StartDeathSeq(int nPlayer, int nVal) StopFiringWeapon(nPlayer); - PlayerList[nPlayer].Angles.ZzOLDHORIZON() = PlayerList[nPlayer].Angles.ZzHORIZON() = nullAngle; + PlayerList[nPlayer].pActor->PrevAngles.Pitch = PlayerList[nPlayer].pActor->spr.Angles.Pitch = nullAngle; pActor->oviewzoffset = pActor->viewzoffset = -55; PlayerList[nPlayer].nInvisible = 0; dVertPan[nPlayer] = 15; @@ -1114,7 +1114,7 @@ void AIPlayer::Tick(RunListEvent* ev) zVelB = -zVelB; } - if (zVelB > 2 && !PlayerList[nPlayer].Angles.ZzHORIZON().Sgn() && cl_slopetilting) { + if (zVelB > 2 && !PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() && cl_slopetilting) { PlayerList[nPlayer].nDestVertPan = nullAngle; } } @@ -2480,12 +2480,12 @@ sectdone: if (actions & (SB_AIM_UP | SB_AIM_DOWN) || sPlayerInput[nPlayer].pan) { - pPlayer->nDestVertPan = pPlayer->Angles.ZzHORIZON(); + pPlayer->nDestVertPan = pPlayer->pActor->spr.Angles.Pitch; pPlayer->bPlayerPan = pPlayer->bLockPan = true; } else if (actions & (SB_LOOK_UP | SB_LOOK_DOWN | SB_CENTERVIEW)) { - pPlayer->nDestVertPan = pPlayer->Angles.ZzHORIZON(); + pPlayer->nDestVertPan = pPlayer->pActor->spr.Angles.Pitch; pPlayer->bPlayerPan = pPlayer->bLockPan = false; } @@ -2496,7 +2496,7 @@ sectdone: if (cl_slopetilting && !pPlayer->bPlayerPan && !pPlayer->bLockPan) { - if (double nVertPan = deltaangle(pPlayer->Angles.ZzHORIZON(), pPlayer->nDestVertPan).Tan() * 32.) + if (double nVertPan = deltaangle(pPlayer->pActor->spr.Angles.Pitch, pPlayer->nDestVertPan).Tan() * 32.) { pPlayer->Angles.addPitch(maphoriz(abs(nVertPan) >= 4 ? clamp(nVertPan, -4., 4.) : nVertPan * 2.)); } @@ -2616,7 +2616,7 @@ sectdone: } else { - if (PlayerList[nPlayer].Angles.ZzHORIZON().Sgn() > 0) + if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0) { PlayerList[nPlayer].Angles.setPitch(nullAngle); pPlayerActor->viewzoffset -= dVertPan[nPlayer]; @@ -2625,11 +2625,11 @@ sectdone: { PlayerList[nPlayer].Angles.addPitch(maphoriz(-dVertPan[nPlayer])); - if (PlayerList[nPlayer].Angles.ZzHORIZON().Degrees() <= 38) + if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= 38) { PlayerList[nPlayer].Angles.setPitch(DAngle::fromDeg(-37.72)); } - else if (PlayerList[nPlayer].Angles.ZzHORIZON().Sgn() >= 0) + else if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() >= 0) { if (!(pPlayerActor->sector()->Flag & kSectUnderwater)) { diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index b9a8a0c31..41d0a4be3 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -414,7 +414,7 @@ void seq_DrawPilotLightSeq(double xOffset, double yOffset) double x = ChunkXpos[nFrameBase] + (160 + xOffset); double y = ChunkYpos[nFrameBase] + (100 + yOffset); - hud_drawsprite(x, y, 65536, fmod(-2 * PlayerList[nLocalPlayer].Angles.ZzANGLE().Buildfang(), kAngleMask + 1), nTile, 0, 0, 1); + hud_drawsprite(x, y, 65536, fmod(-2 * PlayerList[nLocalPlayer].pActor->spr.Angles.Yaw.Buildfang(), kAngleMask + 1), nTile, 0, 0, 1); nFrameBase++; } }