- Rename PlayerAngle::oang in preparation for replacement work.

This commit is contained in:
Mitchell Richters 2022-11-25 16:26:47 +11:00 committed by Christoph Oelckers
parent bd063de5f5
commit 50cf22ec53
13 changed files with 35 additions and 35 deletions

View file

@ -343,7 +343,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, Pl
if (arc.isReading())
{
w.oang = w.ZzANGLE;
w.ZzOLDANGLE = w.ZzANGLE;
w.olook_ang = w.look_ang;
w.orotscrnang = w.rotscrnang;
w.inputdisabled = w.inputdisabled;

View file

@ -100,7 +100,7 @@ private:
struct PlayerAngle
{
DAngle ZzANGLE, oang, look_ang, olook_ang, rotscrnang, orotscrnang, spin;
DAngle ZzANGLE, ZzOLDANGLE, look_ang, olook_ang, rotscrnang, orotscrnang, spin;
friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, PlayerAngle* def);
@ -110,22 +110,22 @@ struct PlayerAngle
// Interpolation helpers.
void backup()
{
oang = ZzANGLE;
ZzOLDANGLE = ZzANGLE;
olook_ang = look_ang;
orotscrnang = rotscrnang;
}
void restore()
{
ZzANGLE = oang;
ZzANGLE = ZzOLDANGLE;
look_ang = olook_ang;
rotscrnang = orotscrnang;
}
// Commonly used getters.
DAngle osum() { return oang + olook_ang; }
DAngle osum() { return ZzOLDANGLE + olook_ang; }
DAngle sum() { return ZzANGLE + look_ang; }
DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); }
DAngle interpolatedang(double const interpfrac) { return interpolatedvalue(oang, ZzANGLE, interpfrac); }
DAngle interpolatedang(double const interpfrac) { return interpolatedvalue(ZzOLDANGLE, ZzANGLE, interpfrac); }
DAngle interpolatedlookang(double const interpfrac) { return interpolatedvalue(olook_ang, look_ang, interpfrac); }
DAngle interpolatedrotscrn(double const interpfrac) { return interpolatedvalue(orotscrnang, rotscrnang, interpfrac); }
DAngle renderlookang(double const interpfrac) { return !SyncInput() ? look_ang : interpolatedlookang(interpfrac); }
@ -179,7 +179,7 @@ struct PlayerAngle
else
{
ZzANGLE = value;
if (backup) oang = ZzANGLE;
if (backup) ZzOLDANGLE = ZzANGLE;
}
}

View file

@ -40,7 +40,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
if (ang != DAngle::fromDeg(INT_MIN))
{
pPlayer->angle.oang = pPlayer->angle.ZzANGLE = ang;
pPlayer->angle.ZzOLDANGLE = pPlayer->angle.ZzANGLE = ang;
}
}

View file

@ -401,7 +401,7 @@ void moveplayers(void)
{
act->restorepos();
act->backupz();
act->spr.Angles.Yaw = p->angle.oang;
act->spr.Angles.Yaw = p->angle.ZzOLDANGLE;
SetActor(act, act->spr.pos);
}
else

View file

@ -123,7 +123,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
if (ang != DAngle::fromDeg(INT_MIN))
{
p->angle.oang = p->angle.ZzANGLE = ang;
p->angle.ZzOLDANGLE = p->angle.ZzANGLE = ang;
}
}

View file

@ -274,13 +274,13 @@ void drawoverlays(double interpfrac)
else
{
cposxy = interpolatedvalue(pp->GetActor()->getPrevPosWithOffsetZ(), pp->GetActor()->getPosWithOffsetZ(), interpfrac).XY();
cang = !SyncInput() ? pp->angle.ZzANGLE : interpolatedvalue(pp->angle.oang, pp->angle.ZzANGLE, interpfrac);
cang = !SyncInput() ? pp->angle.ZzANGLE : interpolatedvalue(pp->angle.ZzOLDANGLE, pp->angle.ZzANGLE, interpfrac);
}
}
else
{
cposxy = pp->GetActor()->opos.XY();
cang = pp->angle.oang;
cang = pp->angle.ZzOLDANGLE;
}
DrawOverheadMap(cposxy, cang, interpfrac);
RestoreInterpolations();

View file

@ -477,7 +477,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_OANG:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].angle.oang.Buildang(), sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].angle.ZzOLDANGLE.Buildang(), sActor, sPlayer);
break;
case PLAYER_ANGVEL: // This no longer exists.

View file

@ -72,7 +72,7 @@ void pickrandomspot(int snum)
p->GetActor()->spr.pos = po[i].opos;
p->GetActor()->backuppos();
p->setbobpos();
p->angle.oang = p->angle.ZzANGLE = po[i].oa;
p->angle.ZzOLDANGLE = p->angle.ZzANGLE = po[i].oa;
p->setCursector(po[i].os);
}
@ -626,7 +626,7 @@ void resetpspritevars(int g, const DVector3& startpos)
act->SetOwner(act);
ps[j].setbobpos();
ps[j].angle.oang = ps[j].angle.ZzANGLE = act->spr.Angles.Yaw; // check me out later.
ps[j].angle.ZzOLDANGLE = ps[j].angle.ZzANGLE = act->spr.Angles.Yaw; // check me out later.
updatesector(act->spr.pos, &ps[j].cursector);

View file

@ -1516,17 +1516,17 @@ void checksectors_d(int snum)
return;
}
if (p->newOwner != nullptr)
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
else
{
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -2379,21 +2379,21 @@ void checksectors_r(int snum)
}
return;
}
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near , 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near , 80., NT_Lotag | NT_Hitag);
}
if (p->newOwner != nullptr)
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
else
{
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->angle.ZzOLDANGLE, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -48,7 +48,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
if (ang != DAngle::fromDeg(INT_MIN))
{
nPlayer->angle.oang = nPlayer->angle.ZzANGLE = ang;
nPlayer->angle.ZzOLDANGLE = nPlayer->angle.ZzANGLE = ang;
}
}

View file

@ -66,7 +66,7 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
if (ang != DAngle::fromDeg(INT_MIN))
{
Player->angle.oang = Player->angle.ZzANGLE = ang;
Player->angle.ZzOLDANGLE = Player->angle.ZzANGLE = ang;
}
}

View file

@ -1311,7 +1311,7 @@ void DoPlayerTeleportPause(PLAYER* pp)
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
{
pp->angle.ZzANGLE = pp->angle.oang = ang;
pp->angle.ZzANGLE = pp->angle.ZzOLDANGLE = ang;
pp->actor->spr.pos = pos;
pp->actor->backuppos();
@ -5122,7 +5122,7 @@ void DoPlayerBeginOperate(PLAYER* pp)
pp->sop = pp->sop_control = sop;
sop->controller = pp->actor;
pp->angle.oang = pp->angle.ZzANGLE = sop->ang;
pp->angle.ZzOLDANGLE = pp->angle.ZzANGLE = sop->ang;
pp->actor->spr.pos.XY() = sop->pmid.XY();
updatesector(pp->actor->getPosWithOffsetZ(), &pp->cursector);
calcSlope(pp->cursector, pp->actor->getPosWithOffsetZ(), &cz, &fz);
@ -5212,7 +5212,7 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop)
auto save_sect = pp->cursector;
pp->angle.oang = pp->angle.ZzANGLE = sop->ang;
pp->angle.ZzOLDANGLE = pp->angle.ZzANGLE = sop->ang;
pp->actor->spr.pos.XY() = sop->pmid.XY();
updatesector(pp->actor->getPosWithOffsetZ(), &pp->cursector);
calcSlope(pp->cursector, pp->actor->getPosWithOffsetZ(), &cz, &fz);
@ -5334,9 +5334,9 @@ void DoPlayerStopOperate(PLAYER* pp)
{
DSWActor* rsp = pp->remoteActor;
if (TEST_BOOL1(rsp))
pp->angle.ZzANGLE = pp->angle.oang = rsp->spr.Angles.Yaw; // check me out later.
pp->angle.ZzANGLE = pp->angle.ZzOLDANGLE = rsp->spr.Angles.Yaw; // check me out later.
else
pp->angle.ZzANGLE = pp->angle.oang = (pp->sop_remote->pmid.XY() - pp->actor->spr.pos.XY()).Angle();
pp->angle.ZzANGLE = pp->angle.ZzOLDANGLE = (pp->sop_remote->pmid.XY() - pp->actor->spr.pos.XY()).Angle();
}
if (pp->sop_control)
@ -7047,7 +7047,7 @@ void InitAllPlayers(void)
// Initialize all [MAX_SW_PLAYERS] arrays here!
for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++)
{
pp->angle.ZzANGLE = pp->angle.oang = pfirst->angle.ZzANGLE;
pp->angle.ZzANGLE = pp->angle.ZzOLDANGLE = pfirst->angle.ZzANGLE;
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
@ -7203,7 +7203,7 @@ void PlayerSpawnPosition(PLAYER* pp)
ASSERT(spawn_sprite != nullptr);
pp->angle.ZzANGLE = pp->angle.oang = spawn_sprite->spr.Angles.Yaw; // check me out later.
pp->angle.ZzANGLE = pp->angle.ZzOLDANGLE = spawn_sprite->spr.Angles.Yaw; // check me out later.
pp->setcursector(spawn_sprite->sector());
if (pp->actor)