Skip to content

Commit

Permalink
- Rename PlayerHorizon::ohoriz in preparation for replacement work.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Nov 26, 2022
1 parent 81bb213 commit 1fd6d25
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/core/gameinput.cpp
Expand Up @@ -362,7 +362,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();
Expand Down
10 changes: 5 additions & 5 deletions source/core/gameinput.h
Expand Up @@ -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);

Expand All @@ -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); }

Expand Down Expand Up @@ -67,7 +67,7 @@ struct PlayerHorizon
else
{
ZzHORIZON = value;
if (backup) ohoriz = ZzHORIZON;
if (backup) ZzOLDHORIZON = ZzHORIZON;
}
}

Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/gameexec.cpp
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/premap.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions source/games/exhumed/src/player.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/sw/src/player.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 1fd6d25

Please sign in to comment.