From 8697e5f0547bb7e0fff2addd72f350bad07285b1 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 27 Sep 2022 12:38:57 +1000 Subject: [PATCH] - Replace all `q16horiz(0)` calls. --- source/core/gameinput.cpp | 2 +- source/core/gameinput.h | 2 +- source/games/blood/src/player.cpp | 2 +- source/games/blood/src/prediction.cpp | 4 ++-- source/games/duke/src/gameexec.cpp | 4 ++-- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/player_r.cpp | 12 ++++++------ source/games/duke/src/premap.cpp | 2 +- source/games/exhumed/src/player.cpp | 8 ++++---- source/games/exhumed/src/view.cpp | 4 ++-- source/games/sw/src/player.cpp | 6 +++--- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 5098e0cec..afdda3476 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -61,7 +61,7 @@ inline static void scaletozero(fixedhoriz& object, const double value, const dou if (auto sgn = object.Sgn()) { object -= getscaledhoriz(value, scaleAdjust, object, push == DBL_MAX ? sgn * (1. / 576.) : push); - if (sgn != object.Sgn()) object = q16horiz(0); + if (sgn != object.Sgn()) object = pitchhoriz(nullAngle.Degrees()); } } diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 965c795a7..0bc4c3dd1 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -88,7 +88,7 @@ struct PlayerHorizon else { horiz = target; - target = q16horiz(0); + target = pitchhoriz(nullAngle.Degrees()); } } else if (adjustment) diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index e9e27d266..c90c86a4a 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -819,7 +819,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->horizon.horiz = pPlayer->horizon.horizoff = q16horiz(0); + pPlayer->horizon.horiz = pPlayer->horizon.horizoff = pitchhoriz(nullAngle.Degrees()); pPlayer->slope = 0; pPlayer->fragger = nullptr; pPlayer->underwaterTime = 1200; diff --git a/source/games/blood/src/prediction.cpp b/source/games/blood/src/prediction.cpp index 527287f5e..52787428c 100644 --- a/source/games/blood/src/prediction.cpp +++ b/source/games/blood/src/prediction.cpp @@ -246,9 +246,9 @@ static void fakeProcessInput(PLAYER* pPlayer, InputPacket* pInput) } else { - predict.horizoff = interpolatedvalue(predict.horizoff, q16horiz(0), 0x4000); + predict.horizoff = interpolatedvalue(predict.horizoff, pitchhoriz(nullAngle.Degrees()), 0x4000); if (abs(predict.horizoff.Degrees()) < 1.79) - predict.horizoff = q16horiz(0); + predict.horizoff = pitchhoriz(nullAngle.Degrees()); } predict.slope = -predict.horiz.Tan() * 16384.; #endif diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index b260c4080..0b2003ceb 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -2243,10 +2243,10 @@ int ParseState::parse(void) ps[g_p].last_extra = g_ac->spr.extra = gs.max_player_health; ps[g_p].wantweaponfire = -1; - ps[g_p].horizon.ohoriz = ps[g_p].horizon.horiz = q16horiz(0); + ps[g_p].horizon.ohoriz = ps[g_p].horizon.horiz = pitchhoriz(nullAngle.Degrees()); ps[g_p].on_crane = nullptr; ps[g_p].frag_ps = g_p; - ps[g_p].horizon.ohorizoff = ps[g_p].horizon.horizoff = q16horiz(0); + ps[g_p].horizon.ohorizoff = ps[g_p].horizon.horizoff = pitchhoriz(nullAngle.Degrees()); ps[g_p].opyoff = 0; ps[g_p].wackedbyactor = nullptr; ps[g_p].shield_amount = gs.max_armour_amount; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 1a2d77b4d..79d22eab0 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -619,7 +619,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz) backupplayer(p); - p->horizon.horizoff = p->horizon.horiz = q16horiz(0); + p->horizon.horizoff = p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); updatesector(p->pos, &p->cursector); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 2bdbb0319..01f15734b 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1515,7 +1515,7 @@ void checkweapons_r(player_struct* p) } p->OnMotorcycle = 0; p->gotweapon[MOTORCYCLE_WEAPON] = false; - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; @@ -1534,7 +1534,7 @@ void checkweapons_r(player_struct* p) } p->OnBoat = 0; p->gotweapon[BOAT_WEAPON] = false; - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; @@ -4044,7 +4044,7 @@ void OnMotorcycle(player_struct *p, DDukeActor* motosprite) p->gotweapon[MOTORCYCLE_WEAPON] = true; p->vel.X = 0; p->vel.Y = 0; - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); } if (!S_CheckActorSoundPlaying(p->GetActor(),186)) S_PlayActorSound(186, p->GetActor()); @@ -4075,7 +4075,7 @@ void OffMotorcycle(player_struct *p) p->gotweapon[MOTORCYCLE_WEAPON] = false; p->curr_weapon = p->last_full_weapon; checkavailweapon(p); - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; @@ -4119,7 +4119,7 @@ void OnBoat(player_struct *p, DDukeActor* boat) p->gotweapon[BOAT_WEAPON] = true; p->vel.X = 0; p->vel.Y = 0; - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); } } @@ -4137,7 +4137,7 @@ void OffBoat(player_struct *p) p->gotweapon[BOAT_WEAPON] = false; p->curr_weapon = p->last_full_weapon; checkavailweapon(p); - p->horizon.horiz = q16horiz(0); + p->horizon.horiz = pitchhoriz(nullAngle.Degrees()); p->moto_do_bump = 0; p->MotoSpeed = 0; p->TiltStatus = 0; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 36611c2f1..1318970b2 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -152,7 +152,7 @@ void resetplayerstats(int snum) p->footprintshade = 0; p->jumping_toggle = 0; p->horizon.ohoriz = p->horizon.horiz = q16horiz(40); - p->horizon.ohorizoff = p->horizon.horizoff = q16horiz(0); + p->horizon.ohorizoff = p->horizon.horizoff = pitchhoriz(nullAngle.Degrees()); p->bobcounter = 0; p->on_ground = 0; p->player_par = 0; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 6d745b8c1..0bc34b697 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -410,7 +410,7 @@ void RestartPlayer(int nPlayer) plr->nThrust.Zero(); - plr->nDestVertPan = plr->horizon.ohoriz = plr->horizon.horiz = q16horiz(0); + plr->nDestVertPan = plr->horizon.ohoriz = plr->horizon.horiz = pitchhoriz(nullAngle.Degrees()); plr->nBreathTimer = 90; plr->nTauntTimer = RandomSize(3) + 3; @@ -506,7 +506,7 @@ void StartDeathSeq(int nPlayer, int nVal) StopFiringWeapon(nPlayer); - PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.horiz = q16horiz(0); + PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.horiz = pitchhoriz(nullAngle.Degrees()); PlayerList[nPlayer].oeyelevel = PlayerList[nPlayer].eyelevel = -55; PlayerList[nPlayer].nInvisible = 0; dVertPan[nPlayer] = 15; @@ -1091,7 +1091,7 @@ void AIPlayer::Tick(RunListEvent* ev) StopLocalSound(); InitSpiritHead(); - PlayerList[nPlayer].nDestVertPan = q16horiz(0); + PlayerList[nPlayer].nDestVertPan = pitchhoriz(nullAngle.Degrees()); PlayerList[nPlayer].horizon.settarget(buildhoriz(currentLevel->ex_ramses_horiz)); } } @@ -1119,7 +1119,7 @@ void AIPlayer::Tick(RunListEvent* ev) } if (zVelB > 2 && !PlayerList[nPlayer].horizon.horiz.Sgn() && cl_slopetilting) { - PlayerList[nPlayer].nDestVertPan = q16horiz(0); + PlayerList[nPlayer].nDestVertPan = pitchhoriz(nullAngle.Degrees()); } } diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index b7bc983e8..0c1a369c9 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -192,7 +192,7 @@ void DrawView(double interpfrac, bool sceneonly) int nEnemyPal = -1; sectortype* pSector = nullptr; DAngle nCameraang, rotscrnang; - fixedhoriz nCamerapan = q16horiz(0); + fixedhoriz nCamerapan = pitchhoriz(nullAngle.Degrees()); DoInterpolations(interpfrac); @@ -259,7 +259,7 @@ void DrawView(double interpfrac, bool sceneonly) if (nSnakeCam >= 0 && !sceneonly) { - nCamerapan = q16horiz(0); + nCamerapan = pitchhoriz(nullAngle.Degrees()); } else { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 2e729e9d9..e117738a8 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -6157,7 +6157,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) plActor->spr.xrepeat = PLAYER_NINJA_XREPEAT; plActor->spr.yrepeat = PLAYER_NINJA_YREPEAT; - pp->horizon.horiz = q16horiz(0); + pp->horizon.horiz = pitchhoriz(nullAngle.Degrees()); DoPlayerResetMovement(pp); plActor->user.ID = NINJA_RUN_R0; PlayerDeathReset(pp); @@ -7174,7 +7174,7 @@ void InitAllPlayers(void) extern bool NewGame; //int fz,cz; - pfirst->horizon.horiz = q16horiz(0); + pfirst->horizon.horiz = pitchhoriz(nullAngle.Degrees()); // Initialize all [MAX_SW_PLAYERS] arrays here! for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++) @@ -7218,7 +7218,7 @@ void InitAllPlayers(void) pp->FadeAmt = 0; pp->FadeTics = 0; pp->StartColor = 0; - pp->horizon.horizoff = q16horiz(0); + pp->horizon.horizoff = pitchhoriz(nullAngle.Degrees()); INITLIST(&pp->PanelSpriteList); }