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

This commit is contained in:
Mitchell Richters 2022-11-25 14:51:53 +11:00 committed by Christoph Oelckers
parent 401a829d54
commit 0c53990c87
6 changed files with 12 additions and 12 deletions

View file

@ -364,7 +364,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w,
if (arc.isReading())
{
w.ohoriz = w.ZzHORIZON;
w.ZzOLDHORIZON = w.ZzHORIZON;
w.ohorizoff = w.horizoff;
w.inputdisabled = w.inputdisabled;
w.resetadjustment();

View file

@ -8,7 +8,7 @@
struct PlayerHorizon
{
DAngle ZzHORIZON, ohoriz, horizoff, ohorizoff;
DAngle ZzHORIZON, ZzOLDHORIZON, horizoff, ohorizoff;
friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def);
@ -19,17 +19,17 @@ struct PlayerHorizon
// Interpolation helpers.
void backup()
{
ohoriz = ZzHORIZON;
ZzOLDHORIZON = ZzHORIZON;
ohorizoff = horizoff;
}
void restore()
{
ZzHORIZON = ohoriz;
ZzHORIZON = ZzOLDHORIZON;
horizoff = ohorizoff;
}
// Commonly used getters.
DAngle osum() { return ohoriz + ohorizoff; }
DAngle osum() { return ZzOLDHORIZON + ohorizoff; }
DAngle sum() { return ZzHORIZON + horizoff; }
DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); }
@ -67,7 +67,7 @@ struct PlayerHorizon
else
{
ZzHORIZON = value;
if (backup) ohoriz = ZzHORIZON;
if (backup) ZzOLDHORIZON = ZzHORIZON;
}
}

View file

@ -350,7 +350,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_OHORIZ:
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohoriz.Tan() * -128.), sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ZzOLDHORIZON.Tan() * -128.), sActor, sPlayer);
break;
case PLAYER_HORIZOFF:
@ -2247,7 +2247,7 @@ 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.ZzHORIZON = nullAngle;
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;

View file

@ -125,7 +125,7 @@ void resetplayerstats(int snum)
p->footprintpal = 0;
p->footprintshade = 0;
p->jumping_toggle = 0;
p->horizon.ohoriz = 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->bobcounter = 0;
p->on_ground = 0;

View file

@ -407,7 +407,7 @@ void RestartPlayer(int nPlayer)
plr->nThrust.Zero();
plr->nDestVertPan = plr->horizon.ohoriz = plr->horizon.ZzHORIZON = nullAngle;
plr->nDestVertPan = plr->horizon.ZzOLDHORIZON = plr->horizon.ZzHORIZON = nullAngle;
plr->nBreathTimer = 90;
plr->nTauntTimer = RandomSize(3) + 3;
@ -503,7 +503,7 @@ void StartDeathSeq(int nPlayer, int nVal)
StopFiringWeapon(nPlayer);
PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.ZzHORIZON = nullAngle;
PlayerList[nPlayer].horizon.ZzOLDHORIZON = PlayerList[nPlayer].horizon.ZzHORIZON = nullAngle;
pActor->oviewzoffset = pActor->viewzoffset = -55;
PlayerList[nPlayer].nInvisible = 0;
dVertPan[nPlayer] = 15;

View file

@ -7048,7 +7048,7 @@ void InitAllPlayers(void)
for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++)
{
pp->angle.ang = pp->angle.oang = pfirst->angle.ang;
pp->horizon.ZzHORIZON = pp->horizon.ohoriz = pfirst->horizon.ZzHORIZON;
pp->horizon.ZzHORIZON = pp->horizon.ZzOLDHORIZON = pfirst->horizon.ZzHORIZON;
pp->cursector = pfirst->cursector;
// set like this so that player can trigger something on start of the level
pp->lastcursector = pfirst->cursector+1;