mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- Rename PlayerHorizon::horizoff
in preparation for replacement work.
This commit is contained in:
parent
0c53990c87
commit
216fad7e18
8 changed files with 18 additions and 18 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue