Skip to content

Commit

Permalink
- Exhumed: Remove all remaining angle wrapper usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Nov 26, 2022
1 parent 81b5c30 commit 690b283
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions source/games/exhumed/src/gun.cpp
Expand Up @@ -729,7 +729,7 @@ void MoveWeapons(int nPlayer)
// loc_27266:
case kWeaponSword:
{
nHeight += PlayerList[nLocalPlayer].Angles.ZzHORIZON().Tan() * 32.;
nHeight += PlayerList[nLocalPlayer].pActor->spr.Angles.Pitch.Tan() * 32.;

thePos.Z += nHeight;

Expand Down Expand Up @@ -834,7 +834,7 @@ void MoveWeapons(int nPlayer)
}
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;
Expand All @@ -858,7 +858,7 @@ void MoveWeapons(int nPlayer)

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:
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/osdcmds.cpp
Expand Up @@ -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;
}
}

Expand Down
18 changes: 9 additions & 9 deletions source/games/exhumed/src/player.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -2480,12 +2480,12 @@ void AIPlayer::Tick(RunListEvent* ev)

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

Expand All @@ -2496,7 +2496,7 @@ void AIPlayer::Tick(RunListEvent* ev)

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.addToPitch(maphoriz(abs(nVertPan) >= 4 ? clamp(nVertPan, -4., 4.) : nVertPan * 2.));
}
Expand Down Expand Up @@ -2616,7 +2616,7 @@ void AIPlayer::Tick(RunListEvent* ev)
}
else
{
if (PlayerList[nPlayer].Angles.ZzHORIZON().Sgn() > 0)
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0)
{
PlayerList[nPlayer].Angles.setNewPitch(nullAngle);
pPlayerActor->viewzoffset -= dVertPan[nPlayer];
Expand All @@ -2625,11 +2625,11 @@ void AIPlayer::Tick(RunListEvent* ev)
{
PlayerList[nPlayer].Angles.addToPitch(maphoriz(-dVertPan[nPlayer]));

if (PlayerList[nPlayer].Angles.ZzHORIZON().Degrees() <= 38)
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= 38)
{
PlayerList[nPlayer].Angles.setNewPitch(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))
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/sequence.cpp
Expand Up @@ -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++;
}
}
Expand Down

0 comments on commit 690b283

Please sign in to comment.