From 216fad7e186183c3ad7743d429353c6539d0ef26 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 25 Nov 2022 14:53:27 +1100 Subject: [PATCH] - Rename `PlayerHorizon::horizoff` in preparation for replacement work. --- source/core/gameinput.cpp | 12 ++++++------ source/core/gameinput.h | 8 ++++---- source/games/blood/src/player.cpp | 2 +- source/games/duke/src/gameexec.cpp | 6 +++--- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/prediction.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/sw/src/player.cpp | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 169685b37..88eed570d 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -302,7 +302,7 @@ void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool co // accordingly if (cursectnum == tempsect || (!isBlood() && abs(getflorzofslopeptr(tempsect, rotpt) - k) <= 4)) { - horizoff -= maphoriz(scaleAdjust * ((j - k) * (!isBlood() ? 0.625 : 5.5))); + ZzHORIZOFF -= maphoriz(scaleAdjust * ((j - k) * (!isBlood() ? 0.625 : 5.5))); } } } @@ -310,16 +310,16 @@ void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool co if (climbing) { // tilt when climbing but you can't even really tell it. - if (horizoff > PITCH_HORIZOFFCLIMB) horizoff += getscaledangle(PITCH_HORIZOFFSPEED, scaleAdjust, deltaangle(horizoff, PITCH_HORIZOFFCLIMB), PITCH_HORIZOFFPUSH); + if (ZzHORIZOFF > PITCH_HORIZOFFCLIMB) ZzHORIZOFF += getscaledangle(PITCH_HORIZOFFSPEED, scaleAdjust, deltaangle(ZzHORIZOFF, PITCH_HORIZOFFCLIMB), PITCH_HORIZOFFPUSH); } else { // Make horizoff grow towards 0 since horizoff is not modified when you're not on a slope. - scaletozero(horizoff, PITCH_HORIZOFFSPEED, scaleAdjust, PITCH_HORIZOFFPUSH); + scaletozero(ZzHORIZOFF, PITCH_HORIZOFFSPEED, scaleAdjust, PITCH_HORIZOFFPUSH); } // Clamp off against the maximum allowed pitch. - horizoff = ClampViewPitch(horizoff); + ZzHORIZOFF = ClampViewPitch(ZzHORIZOFF); } } @@ -358,14 +358,14 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, if (arc.BeginObject(keyname)) { arc("horiz", w.ZzHORIZON) - ("horizoff", w.horizoff) + ("horizoff", w.ZzHORIZOFF) ("inputdisabled", w.inputdisabled) .EndObject(); if (arc.isReading()) { w.ZzOLDHORIZON = w.ZzHORIZON; - w.ohorizoff = w.horizoff; + w.ohorizoff = w.ZzHORIZOFF; w.inputdisabled = w.inputdisabled; w.resetadjustment(); } diff --git a/source/core/gameinput.h b/source/core/gameinput.h index c74cd2ec1..8ff83a8a3 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -8,7 +8,7 @@ struct PlayerHorizon { - DAngle ZzHORIZON, ZzOLDHORIZON, horizoff, ohorizoff; + DAngle ZzHORIZON, ZzOLDHORIZON, ZzHORIZOFF, ohorizoff; friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def); @@ -20,17 +20,17 @@ struct PlayerHorizon void backup() { ZzOLDHORIZON = ZzHORIZON; - ohorizoff = horizoff; + ohorizoff = ZzHORIZOFF; } void restore() { ZzHORIZON = ZzOLDHORIZON; - horizoff = ohorizoff; + ZzHORIZOFF = ohorizoff; } // Commonly used getters. DAngle osum() { return ZzOLDHORIZON + ohorizoff; } - DAngle sum() { return ZzHORIZON + horizoff; } + DAngle sum() { return ZzHORIZON + ZzHORIZOFF; } DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); } // Ticrate playsim adjustment helpers. diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 4b279692e..2005ce446 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -821,7 +821,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.ZzHORIZON = pPlayer->horizon.horizoff = nullAngle; + pPlayer->horizon.ZzHORIZON = pPlayer->horizon.ZzHORIZOFF = nullAngle; pPlayer->slope = 0; pPlayer->fragger = nullptr; pPlayer->underwaterTime = 1200; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 3b71fbe30..0a43d837d 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -354,8 +354,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_HORIZOFF: - if (bSet) ps[iPlayer].horizon.horizoff = maphoriz(-lValue); - else SetGameVarID(lVar2, int(ps[iPlayer].horizon.horizoff.Tan() * -128.), sActor, sPlayer); + if (bSet) ps[iPlayer].horizon.ZzHORIZOFF = maphoriz(-lValue); + else SetGameVarID(lVar2, int(ps[iPlayer].horizon.ZzHORIZOFF.Tan() * -128.), sActor, sPlayer); break; case PLAYER_OHORIZOFF: @@ -2250,7 +2250,7 @@ int ParseState::parse(void) ps[g_p].horizon.ZzOLDHORIZON = ps[g_p].horizon.ZzHORIZON = nullAngle; ps[g_p].on_crane = nullptr; ps[g_p].frag_ps = g_p; - ps[g_p].horizon.ohorizoff = ps[g_p].horizon.horizoff = nullAngle; + ps[g_p].horizon.ohorizoff = ps[g_p].horizon.ZzHORIZOFF = nullAngle; 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 bbd8c6383..1635985e5 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -622,7 +622,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz) backupplayer(p); - p->horizon.horizoff = p->horizon.ZzHORIZON = nullAngle; + p->horizon.ZzHORIZOFF = p->horizon.ZzHORIZON = nullAngle; updatesector(p->GetActor()->getPosWithOffsetZ(), &p->cursector); diff --git a/source/games/duke/src/prediction.cpp b/source/games/duke/src/prediction.cpp index 77830e008..fca524628 100644 --- a/source/games/duke/src/prediction.cpp +++ b/source/games/duke/src/prediction.cpp @@ -55,7 +55,7 @@ void resetmys() myxvel = myyvel = myzvel = 0; myang = ps[myconnectindex].angle.ang; myhoriz = omyhoriz = ps[myconnectindex].horizon.ZzHORIZON; - myhorizoff = omyhorizoff = ps[myconnectindex].horizon.horizoff; + myhorizoff = omyhorizoff = ps[myconnectindex].horizon.ZzHORIZOFF; mycursectnum = sectindex(ps[myconnectindex].cursector); myjumpingcounter = ps[myconnectindex].jumping_counter; myjumpingtoggle = ps[myconnectindex].jumping_toggle; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 34c55b660..4ac90d766 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -126,7 +126,7 @@ void resetplayerstats(int snum) p->footprintshade = 0; p->jumping_toggle = 0; p->horizon.ZzOLDHORIZON = p->horizon.ZzHORIZON = DAngle::fromDeg(-17.354); - p->horizon.ohorizoff = p->horizon.horizoff = nullAngle; + p->horizon.ohorizoff = p->horizon.ZzHORIZOFF = nullAngle; p->bobcounter = 0; p->on_ground = 0; p->player_par = 0; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index c1809d169..b2de3e225 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -7083,7 +7083,7 @@ void InitAllPlayers(void) pp->FadeAmt = 0; pp->FadeTics = 0; pp->StartColor = 0; - pp->horizon.horizoff = nullAngle; + pp->horizon.ZzHORIZOFF = nullAngle; INITLIST(&pp->PanelSpriteList); }