Skip to content

Commit

Permalink
- Rename PlayerHorizon::ohorizoff 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 d55ac0a commit 0b3900d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/core/gameinput.cpp
Expand Up @@ -363,7 +363,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w,
if (arc.isReading())
{
w.ZzOLDHORIZON = w.ZzHORIZON;
w.ohorizoff = w.ZzHORIZOFF;
w.ZzOHORIZOFF = w.ZzHORIZOFF;
w.inputdisabled = w.inputdisabled;
w.resetadjustment();
}
Expand Down
8 changes: 4 additions & 4 deletions source/core/gameinput.h
Expand Up @@ -8,7 +8,7 @@

struct PlayerHorizon
{
DAngle ZzHORIZON, ZzOLDHORIZON, ZzHORIZOFF, ohorizoff;
DAngle ZzHORIZON, ZzOLDHORIZON, ZzHORIZOFF, ZzOHORIZOFF;

friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def);

Expand All @@ -20,16 +20,16 @@ struct PlayerHorizon
void backup()
{
ZzOLDHORIZON = ZzHORIZON;
ohorizoff = ZzHORIZOFF;
ZzOHORIZOFF = ZzHORIZOFF;
}
void restore()
{
ZzHORIZON = ZzOLDHORIZON;
ZzHORIZOFF = ohorizoff;
ZzHORIZOFF = ZzOHORIZOFF;
}

// Commonly used getters.
DAngle osum() { return ZzOLDHORIZON + ohorizoff; }
DAngle osum() { return ZzOLDHORIZON + ZzOHORIZOFF; }
DAngle sum() { return ZzHORIZON + ZzHORIZOFF; }
DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); }

Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/gameexec.cpp
Expand Up @@ -359,7 +359,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;

case PLAYER_OHORIZOFF:
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohorizoff.Tan() * -128.), sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ZzOHORIZOFF.Tan() * -128.), sActor, sPlayer);
break;

case PLAYER_INVDISPTIME:
Expand Down Expand Up @@ -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.ZzHORIZOFF = nullAngle;
ps[g_p].horizon.ZzOHORIZOFF = 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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/premap.cpp
Expand Up @@ -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.ZzHORIZOFF = nullAngle;
p->horizon.ZzOHORIZOFF = p->horizon.ZzHORIZOFF = nullAngle;
p->bobcounter = 0;
p->on_ground = 0;
p->player_par = 0;
Expand Down

0 comments on commit 0b3900d

Please sign in to comment.