- Rename PlayerHorizon::horizoff in preparation for replacement work.

This commit is contained in:
Mitchell Richters 2022-11-25 14:53:27 +11:00 committed by Christoph Oelckers
parent 0c53990c87
commit 216fad7e18
8 changed files with 18 additions and 18 deletions

View file

@ -302,7 +302,7 @@ void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool co
// accordingly // accordingly
if (cursectnum == tempsect || (!isBlood() && abs(getflorzofslopeptr(tempsect, rotpt) - k) <= 4)) 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) if (climbing)
{ {
// tilt when climbing but you can't even really tell it. // 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 else
{ {
// Make horizoff grow towards 0 since horizoff is not modified when you're not on a slope. // 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. // 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)) if (arc.BeginObject(keyname))
{ {
arc("horiz", w.ZzHORIZON) arc("horiz", w.ZzHORIZON)
("horizoff", w.horizoff) ("horizoff", w.ZzHORIZOFF)
("inputdisabled", w.inputdisabled) ("inputdisabled", w.inputdisabled)
.EndObject(); .EndObject();
if (arc.isReading()) if (arc.isReading())
{ {
w.ZzOLDHORIZON = w.ZzHORIZON; w.ZzOLDHORIZON = w.ZzHORIZON;
w.ohorizoff = w.horizoff; w.ohorizoff = w.ZzHORIZOFF;
w.inputdisabled = w.inputdisabled; w.inputdisabled = w.inputdisabled;
w.resetadjustment(); w.resetadjustment();
} }

View file

@ -8,7 +8,7 @@
struct PlayerHorizon struct PlayerHorizon
{ {
DAngle ZzHORIZON, ZzOLDHORIZON, horizoff, ohorizoff; DAngle ZzHORIZON, ZzOLDHORIZON, ZzHORIZOFF, ohorizoff;
friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def); friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def);
@ -20,17 +20,17 @@ struct PlayerHorizon
void backup() void backup()
{ {
ZzOLDHORIZON = ZzHORIZON; ZzOLDHORIZON = ZzHORIZON;
ohorizoff = horizoff; ohorizoff = ZzHORIZOFF;
} }
void restore() void restore()
{ {
ZzHORIZON = ZzOLDHORIZON; ZzHORIZON = ZzOLDHORIZON;
horizoff = ohorizoff; ZzHORIZOFF = ohorizoff;
} }
// Commonly used getters. // Commonly used getters.
DAngle osum() { return ZzOLDHORIZON + ohorizoff; } 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); } DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); }
// Ticrate playsim adjustment helpers. // Ticrate playsim adjustment helpers.

View file

@ -821,7 +821,7 @@ void playerStart(int nPlayer, int bNewLevel)
pPlayer->actor->xspr.health = pDudeInfo->startHealth << 4; pPlayer->actor->xspr.health = pDudeInfo->startHealth << 4;
pPlayer->actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; pPlayer->actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
pPlayer->bloodlust = 0; pPlayer->bloodlust = 0;
pPlayer->horizon.ZzHORIZON = pPlayer->horizon.horizoff = nullAngle; pPlayer->horizon.ZzHORIZON = pPlayer->horizon.ZzHORIZOFF = nullAngle;
pPlayer->slope = 0; pPlayer->slope = 0;
pPlayer->fragger = nullptr; pPlayer->fragger = nullptr;
pPlayer->underwaterTime = 1200; pPlayer->underwaterTime = 1200;

View file

@ -354,8 +354,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break; break;
case PLAYER_HORIZOFF: case PLAYER_HORIZOFF:
if (bSet) ps[iPlayer].horizon.horizoff = maphoriz(-lValue); if (bSet) ps[iPlayer].horizon.ZzHORIZOFF = maphoriz(-lValue);
else SetGameVarID(lVar2, int(ps[iPlayer].horizon.horizoff.Tan() * -128.), sActor, sPlayer); else SetGameVarID(lVar2, int(ps[iPlayer].horizon.ZzHORIZOFF.Tan() * -128.), sActor, sPlayer);
break; break;
case PLAYER_OHORIZOFF: 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].horizon.ZzOLDHORIZON = ps[g_p].horizon.ZzHORIZON = nullAngle;
ps[g_p].on_crane = nullptr; ps[g_p].on_crane = nullptr;
ps[g_p].frag_ps = g_p; 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].opyoff = 0;
ps[g_p].wackedbyactor = nullptr; ps[g_p].wackedbyactor = nullptr;
ps[g_p].shield_amount = gs.max_armour_amount; ps[g_p].shield_amount = gs.max_armour_amount;

View file

@ -622,7 +622,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
backupplayer(p); backupplayer(p);
p->horizon.horizoff = p->horizon.ZzHORIZON = nullAngle; p->horizon.ZzHORIZOFF = p->horizon.ZzHORIZON = nullAngle;
updatesector(p->GetActor()->getPosWithOffsetZ(), &p->cursector); updatesector(p->GetActor()->getPosWithOffsetZ(), &p->cursector);

View file

@ -55,7 +55,7 @@ void resetmys()
myxvel = myyvel = myzvel = 0; myxvel = myyvel = myzvel = 0;
myang = ps[myconnectindex].angle.ang; myang = ps[myconnectindex].angle.ang;
myhoriz = omyhoriz = ps[myconnectindex].horizon.ZzHORIZON; myhoriz = omyhoriz = ps[myconnectindex].horizon.ZzHORIZON;
myhorizoff = omyhorizoff = ps[myconnectindex].horizon.horizoff; myhorizoff = omyhorizoff = ps[myconnectindex].horizon.ZzHORIZOFF;
mycursectnum = sectindex(ps[myconnectindex].cursector); mycursectnum = sectindex(ps[myconnectindex].cursector);
myjumpingcounter = ps[myconnectindex].jumping_counter; myjumpingcounter = ps[myconnectindex].jumping_counter;
myjumpingtoggle = ps[myconnectindex].jumping_toggle; myjumpingtoggle = ps[myconnectindex].jumping_toggle;

View file

@ -126,7 +126,7 @@ void resetplayerstats(int snum)
p->footprintshade = 0; p->footprintshade = 0;
p->jumping_toggle = 0; p->jumping_toggle = 0;
p->horizon.ZzOLDHORIZON = p->horizon.ZzHORIZON = DAngle::fromDeg(-17.354); 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->bobcounter = 0;
p->on_ground = 0; p->on_ground = 0;
p->player_par = 0; p->player_par = 0;

View file

@ -7083,7 +7083,7 @@ void InitAllPlayers(void)
pp->FadeAmt = 0; pp->FadeAmt = 0;
pp->FadeTics = 0; pp->FadeTics = 0;
pp->StartColor = 0; pp->StartColor = 0;
pp->horizon.horizoff = nullAngle; pp->horizon.ZzHORIZOFF = nullAngle;
INITLIST(&pp->PanelSpriteList); INITLIST(&pp->PanelSpriteList);
} }