- Duke: Remove all remaining angle wrapper usage.

This commit is contained in:
Mitchell Richters 2022-11-25 22:30:40 +11:00 committed by Christoph Oelckers
parent d3bc2f39a4
commit dfb55c39ca
18 changed files with 88 additions and 88 deletions

View file

@ -400,7 +400,7 @@ void moveplayers(void)
{
act->restorepos();
act->backupz();
act->spr.Angles.Yaw = p->Angles.ZzOLDANGLE();
act->spr.Angles.Yaw = p->GetActor()->PrevAngles.Yaw;
SetActor(act, act->spr.pos);
}
else
@ -441,7 +441,7 @@ void moveplayers(void)
if (p->actorsqu != nullptr)
{
p->Angles.addYaw(deltaangle(p->Angles.ZzANGLE(), (p->actorsqu->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.25);
p->Angles.addYaw(deltaangle(p->GetActor()->spr.Angles.Yaw, (p->actorsqu->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.25);
}
if (act->spr.extra > 0)
@ -461,7 +461,7 @@ void moveplayers(void)
if (p->wackedbyactor != nullptr && p->wackedbyactor->spr.statnum < MAXSTATUS)
{
p->Angles.addYaw(deltaangle(p->Angles.ZzANGLE(), (p->wackedbyactor->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.5);
p->Angles.addYaw(deltaangle(p->GetActor()->spr.Angles.Yaw, (p->wackedbyactor->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.5);
}
}
}
@ -783,7 +783,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{
// if(actor->spr.pal == 12)
{
auto delta = absangle(ps[p].Angles.ZzANGLE(), (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
auto delta = absangle(ps[p].GetActor()->spr.Angles.Yaw, (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
if (delta < DAngle22_5 / 2 && PlayerInput(p, SB_OPEN))
if (ps[p].toggle_key_flag == 1)
{
@ -793,7 +793,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{
if (act2->spr.picnum == queball || act2->spr.picnum == stripeball)
{
delta = absangle(ps[p].Angles.ZzANGLE(), (act2->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
delta = absangle(ps[p].GetActor()->spr.Angles.Yaw, (act2->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
if (delta < DAngle22_5 / 2)
{
double l;

View file

@ -1663,7 +1663,7 @@ static void greenslime(DDukeActor *actor)
}
else if (xx < 64 && ps[p].quick_kick == 0)
{
auto ang = absangle(ps[p].Angles.ZzANGLE(), (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
auto ang = absangle(ps[p].GetActor()->spr.Angles.Yaw, (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle());
if (ang < DAngle22_5)
ps[p].quick_kick = 14;
}
@ -1719,7 +1719,7 @@ static void greenslime(DDukeActor *actor)
return;
}
actor->spr.pos.Z = ps[p].GetActor()->getOffsetZ() + 8 + ps[p].pyoff - (actor->temp_data[2] + (ps[p].Angles.ZzHORIZON().Tan() * 2048.)) * zinttoworld;
actor->spr.pos.Z = ps[p].GetActor()->getOffsetZ() + 8 + ps[p].pyoff - (actor->temp_data[2] + (ps[p].GetActor()->spr.Angles.Pitch.Tan() * 2048.)) * zinttoworld;
if (actor->temp_data[2] > 512)
actor->temp_data[2] -= 128;
@ -1767,7 +1767,7 @@ static void greenslime(DDukeActor *actor)
double add = (BobVal(actor->temp_data[1]) * 2) * REPEAT_SCALE;
actor->spr.scale = DVector2(0.3125 + add, 0.234375 + add);
actor->spr.pos.XY() = ps[p].GetActor()->spr.pos.XY() + ps[p].Angles.ZzANGLE().ToVector() * 8;
actor->spr.pos.XY() = ps[p].GetActor()->spr.pos.XY() + ps[p].GetActor()->spr.Angles.Yaw.ToVector() * 8;
return;
}

View file

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

View file

@ -280,7 +280,7 @@ void drawoverlays(double interpfrac)
else
{
cposxy = pp->GetActor()->opos.XY();
cang = pp->Angles.ZzOLDANGLE();
cang = pp->GetActor()->PrevAngles.Yaw;
}
DrawOverheadMap(cposxy, cang, interpfrac);
RestoreInterpolations();

View file

@ -346,11 +346,11 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
}
ps[iPlayer].Angles.setPitch(maphoriz(-lValue));
}
else SetGameVarID(lVar2, int(ps[iPlayer].Angles.ZzHORIZON().Tan() * -128.), sActor, sPlayer);
else SetGameVarID(lVar2, int(ps[iPlayer].GetActor()->spr.Angles.Pitch.Tan() * -128.), sActor, sPlayer);
break;
case PLAYER_OHORIZ:
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].Angles.ZzOLDHORIZON().Tan() * -128.), sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].GetActor()->PrevAngles.Pitch.Tan() * -128.), sActor, sPlayer);
break;
case PLAYER_HORIZOFF:
@ -473,11 +473,11 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
case PLAYER_ANG:
if (bSet) ps[iPlayer].Angles.setYaw(mapangle(lValue));
else SetGameVarID(lVar2, ps[iPlayer].Angles.ZzANGLE().Buildang(), sActor, sPlayer);
else SetGameVarID(lVar2, ps[iPlayer].GetActor()->spr.Angles.Yaw.Buildang(), sActor, sPlayer);
break;
case PLAYER_OANG:
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].Angles.ZzOLDANGLE().Buildang(), sActor, sPlayer);
if (!bSet) SetGameVarID(lVar2, ps[iPlayer].GetActor()->PrevAngles.Yaw.Buildang(), sActor, sPlayer);
break;
case PLAYER_ANGVEL: // This no longer exists.
@ -925,7 +925,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
case PLAYER_RETURN_TO_CENTER:
if (bSet) ps[iPlayer].sync.actions |= SB_CENTERVIEW;
else SetGameVarID(lVar2, ps[iPlayer].sync.actions & SB_CENTERVIEW ? int(abs((ps[iPlayer].Angles.ZzHORIZON() * (DAngle::fromDeg(9.) / GetMaxPitch())).Degrees())) : 0, sActor, sPlayer);
else SetGameVarID(lVar2, ps[iPlayer].sync.actions & SB_CENTERVIEW ? int(abs((ps[iPlayer].GetActor()->spr.Angles.Pitch * (DAngle::fromDeg(9.) / GetMaxPitch())).Degrees())) : 0, sActor, sPlayer);
break;
default:
@ -2246,7 +2246,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].Angles.ZzOLDHORIZON() = ps[g_p].Angles.ZzHORIZON() = nullAngle;
ps[g_p].GetActor()->PrevAngles.Pitch = ps[g_p].GetActor()->spr.Angles.Pitch = nullAngle;
ps[g_p].on_crane = nullptr;
ps[g_p].frag_ps = g_p;
ps[g_p].Angles.PrevViewAngles.Pitch = ps[g_p].Angles.ViewAngles.Pitch = nullAngle;
@ -2431,9 +2431,9 @@ int ParseState::parse(void)
{
DAngle ang;
if (g_ac->isPlayer() && ud.multimode > 1)
ang = absangle(ps[otherp].Angles.ZzANGLE(), (ps[g_p].GetActor()->spr.pos.XY() - ps[otherp].GetActor()->spr.pos.XY()).Angle());
ang = absangle(ps[otherp].GetActor()->spr.Angles.Yaw, (ps[g_p].GetActor()->spr.pos.XY() - ps[otherp].GetActor()->spr.pos.XY()).Angle());
else
ang = absangle(ps[g_p].Angles.ZzANGLE(), (g_ac->spr.pos.XY() - ps[g_p].GetActor()->spr.pos.XY()).Angle());
ang = absangle(ps[g_p].GetActor()->spr.Angles.Yaw, (g_ac->spr.pos.XY() - ps[g_p].GetActor()->spr.pos.XY()).Angle());
j = ang < DAngle22_5;
}
@ -2454,7 +2454,7 @@ int ParseState::parse(void)
case concmd_slapplayer:
insptr++;
forceplayerangle(g_p);
ps[g_p].vel.XY() -= ps[g_p].Angles.ZzANGLE().ToVector() * 8;
ps[g_p].vel.XY() -= ps[g_p].GetActor()->spr.Angles.Yaw.ToVector() * 8;
return 0;
case concmd_wackplayer:
insptr++;
@ -2462,7 +2462,7 @@ int ParseState::parse(void)
forceplayerangle(g_p);
else
{
ps[g_p].vel.XY() -= ps[g_p].Angles.ZzANGLE().ToVector() * 64;
ps[g_p].vel.XY() -= ps[g_p].GetActor()->spr.Angles.Yaw.ToVector() * 64;
ps[g_p].jumping_counter = 767;
ps[g_p].jumping_toggle = 1;
}
@ -3130,7 +3130,7 @@ int ParseState::parse(void)
int i;
insptr++;
i = *(insptr++); // ID of def
SetGameVarID(i, ps[g_p].Angles.ZzANGLE().Buildang(), g_ac, g_p);
SetGameVarID(i, ps[g_p].GetActor()->spr.Angles.Yaw.Buildang(), g_ac, g_p);
break;
}
case concmd_setplayerangle:
@ -3138,7 +3138,7 @@ int ParseState::parse(void)
int i;
insptr++;
i = *(insptr++); // ID of def
ps[g_p].Angles.ZzANGLE() = mapangle(GetGameVarID(i, g_ac, g_p).safeValue() & 2047);
ps[g_p].GetActor()->spr.Angles.Yaw = mapangle(GetGameVarID(i, g_ac, g_p).safeValue() & 2047);
break;
}
case concmd_getactorangle:

View file

@ -211,7 +211,7 @@ inline bool playrunning()
inline void doslopetilting(player_struct* p)
{
bool const canslopetilt = p->on_ground && p->insector() && p->cursector->lotag != ST_2_UNDERWATER && (p->cursector->floorstat & CSTAT_SECTOR_SLOPE);
p->Angles.doViewPitch(p->GetActor()->spr.pos.XY(), p->Angles.ZzANGLE(), p->aim_mode == 0, canslopetilt, p->cursector);
p->Angles.doViewPitch(p->GetActor()->spr.pos.XY(), p->GetActor()->spr.Angles.Yaw, p->aim_mode == 0, canslopetilt, p->cursector);
}
//---------------------------------------------------------------------------

View file

@ -284,7 +284,7 @@ void hud_input(int plnum)
p->inven_icon = 3;
auto pactor =
CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ().plusZ(30), TILE_APLAYER, -64, DVector2(0, 0), p->Angles.ZzANGLE(), 0., 0., nullptr, 10);
CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ().plusZ(30), TILE_APLAYER, -64, DVector2(0, 0), p->GetActor()->spr.Angles.Yaw, 0., 0., nullptr, 10);
pactor->temp_data[3] = pactor->temp_data[4] = 0;
p->holoduke_on = pactor;
pactor->spr.yint = plnum;
@ -792,7 +792,7 @@ static void FinalizeInput(player_struct *p, InputPacket& input)
loc.avel = input.avel = 0;
}
if (p->newOwner != nullptr || (p->sync.actions & SB_CENTERVIEW && abs(p->Angles.ZzHORIZON().Degrees()) > 2.2370))
if (p->newOwner != nullptr || (p->sync.actions & SB_CENTERVIEW && abs(p->GetActor()->spr.Angles.Pitch.Degrees()) > 2.2370))
{
loc.horz = input.horz = 0;
}
@ -845,7 +845,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
if (packet)
{
*packet = loc;
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(p->Angles.ZzANGLE()) + p->fric;
auto velvect = DVector2(loc.fvel, loc.svel).Rotated(p->GetActor()->spr.Angles.Yaw) + p->fric;
packet->fvel = (float)velvect.X;
packet->svel = (float)velvect.Y;
loc = {};

View file

@ -213,7 +213,7 @@ double hitawall(player_struct* p, walltype** hitw)
{
HitInfo hit{};
hitscan(p->GetActor()->getPosWithOffsetZ(), p->cursector, DVector3(p->Angles.ZzANGLE().ToVector() * 1024, 0), hit, CLIPMASK0);
hitscan(p->GetActor()->getPosWithOffsetZ(), p->cursector, DVector3(p->GetActor()->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK0);
if (hitw) *hitw = hit.hitWall;
return (hit.hitpos.XY() - p->GetActor()->spr.pos.XY()).Length();
@ -380,7 +380,7 @@ void dokneeattack(int snum, const std::initializer_list<int> & respawnlist)
{
p->oknee_incs = p->knee_incs;
p->knee_incs++;
p->Angles.addPitch(deltaangle(p->Angles.ZzHORIZON(), (p->GetActor()->getPosWithOffsetZ() - p->actorsqu->spr.pos).Pitch() * 1.1875));
p->Angles.addPitch(deltaangle(p->GetActor()->spr.Angles.Pitch, (p->GetActor()->getPosWithOffsetZ() - p->actorsqu->spr.pos).Pitch() * 1.1875));
p->sync.actions |= SB_CENTERVIEW;
if (p->knee_incs > 15)
{
@ -617,7 +617,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
actor->backuploc();
p->Angles.ViewAngles.Pitch = p->Angles.ZzHORIZON() = nullAngle;
p->Angles.ViewAngles.Pitch = p->GetActor()->spr.Angles.Pitch = nullAngle;
updatesector(p->GetActor()->getPosWithOffsetZ(), &p->cursector);

View file

@ -1071,7 +1071,7 @@ void shoot_d(DDukeActor* actor, int atwith)
if (actor->isPlayer())
{
spos = ps[p].GetActor()->getPosWithOffsetZ().plusZ(ps[p].pyoff + 4);
sang = ps[p].Angles.ZzANGLE();
sang = ps[p].GetActor()->spr.Angles.Yaw;
ps[p].crack_time = CRACK_TIME;
@ -1992,7 +1992,7 @@ static void underwater(int snum, ESyncBits actions, double floorz, double ceilin
auto j = spawn(pact, WATERBUBBLE);
if (j)
{
j->spr.pos += (p->Angles.ZzANGLE().ToVector() + DVector2(4 - (global_random & 8), 4 - (global_random & 8))) * 16;
j->spr.pos += (p->GetActor()->spr.Angles.Yaw.ToVector() + DVector2(4 - (global_random & 8), 4 - (global_random & 8))) * 16;
j->spr.scale = DVector2(0.046875, 0.3125);
j->spr.pos.Z = p->GetActor()->getOffsetZ() + 8;
}
@ -2012,7 +2012,7 @@ int operateTripbomb(int snum)
double vel = 1024, zvel = 0;
setFreeAimVelocity(vel, zvel, p->Angles.getPitchWithView(), 16.);
hitscan(p->GetActor()->getPosWithOffsetZ(), p->cursector, DVector3(p->Angles.ZzANGLE().ToVector() * vel, zvel), hit, CLIPMASK1);
hitscan(p->GetActor()->getPosWithOffsetZ(), p->cursector, DVector3(p->GetActor()->spr.Angles.Yaw.ToVector() * vel, zvel), hit, CLIPMASK1);
if (hit.hitSector == nullptr || hit.actor())
return 0;
@ -2209,8 +2209,8 @@ static void operateweapon(int snum, ESyncBits actions)
zvel -= 4;
}
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 16, HEAVYHBOMB, -16, DVector2(0.140625, 0.140625),
p->Angles.ZzANGLE(), vel + p->hbomb_hold_delay * 2, zvel, pact, 1);
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 16, HEAVYHBOMB, -16, DVector2(0.140625, 0.140625),
p->GetActor()->spr.Angles.Yaw, vel + p->hbomb_hold_delay * 2, zvel, pact, 1);
if (isNam())
{

View file

@ -822,7 +822,7 @@ void shoot_r(DDukeActor* actor, int atwith)
{
p = actor->PlayerIndex();
spos = ps[p].GetActor()->getPosWithOffsetZ().plusZ(ps[p].pyoff + 4);
sang = ps[p].Angles.ZzANGLE();
sang = ps[p].GetActor()->spr.Angles.Yaw;
if (isRRRA()) ps[p].crack_time = CRACK_TIME;
}
@ -1283,7 +1283,7 @@ int doincrements_r(player_struct* p)
{
p->noise_radius = 1024;
madenoise(screenpeek);
p->vel.XY() += p->Angles.ZzANGLE().ToVector();
p->vel.XY() += p->GetActor()->spr.Angles.Yaw.ToVector();
}
p->eat -= 4;
if (p->eat < 0)
@ -1472,7 +1472,7 @@ void checkweapons_r(player_struct* p)
}
p->OnMotorcycle = 0;
p->gotweapon[MOTORCYCLE_WEAPON] = false;
p->Angles.ZzHORIZON() = nullAngle;
p->GetActor()->spr.Angles.Pitch = nullAngle;
p->moto_do_bump = 0;
p->MotoSpeed = 0;
p->TiltStatus = 0;
@ -1491,7 +1491,7 @@ void checkweapons_r(player_struct* p)
}
p->OnBoat = 0;
p->gotweapon[BOAT_WEAPON] = false;
p->Angles.ZzHORIZON() = nullAngle;
p->GetActor()->spr.Angles.Pitch = nullAngle;
p->moto_do_bump = 0;
p->MotoSpeed = 0;
p->TiltStatus = 0;
@ -1718,7 +1718,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
}
if (horiz != FRACUNIT)
{
p->Angles.addPitch(deltaangle(p->Angles.ZzHORIZON(), maphoriz(-horiz)));
p->Angles.addPitch(deltaangle(p->GetActor()->spr.Angles.Pitch, maphoriz(-horiz)));
}
const DAngle adjust = mapangle(-510);
@ -1764,15 +1764,15 @@ static void onMotorcycle(int snum, ESyncBits &actions)
}
}
p->vel.XY() += (p->Angles.ZzANGLE() + velAdjustment).ToVector() * currSpeed;
p->Angles.addYaw(deltaangle(p->Angles.ZzANGLE(), p->Angles.ZzANGLE() - DAngle::fromBam(angAdjustment)));
p->vel.XY() += (p->GetActor()->spr.Angles.Yaw + velAdjustment).ToVector() * currSpeed;
p->Angles.addYaw(deltaangle(p->GetActor()->spr.Angles.Yaw, p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment)));
}
else if (p->MotoSpeed >= 20 && p->on_ground == 1 && (p->moto_on_mud || p->moto_on_oil))
{
rng = krand() & 1;
velAdjustment = rng == 0 ? -adjust : adjust;
currSpeed = MulScale(currSpeed, p->moto_on_oil ? 10 : 5, 7);
p->vel.XY() += (p->Angles.ZzANGLE() + velAdjustment).ToVector() * currSpeed;
p->vel.XY() += (p->GetActor()->spr.Angles.Yaw + velAdjustment).ToVector() * currSpeed;
}
p->moto_on_mud = p->moto_on_oil = 0;
@ -1986,7 +1986,7 @@ static void onBoat(int snum, ESyncBits &actions)
}
if (horiz != FRACUNIT)
{
p->Angles.addPitch(deltaangle(p->Angles.ZzHORIZON(), maphoriz(-horiz)));
p->Angles.addPitch(deltaangle(p->GetActor()->spr.Angles.Pitch, maphoriz(-horiz)));
}
if (p->MotoSpeed > 0 && p->on_ground == 1 && (p->vehTurnLeft || p->vehTurnRight))
@ -2008,8 +2008,8 @@ static void onBoat(int snum, ESyncBits &actions)
angAdjustment >>= 6;
}
p->vel.XY() += (p->Angles.ZzANGLE() + velAdjustment).ToVector() * currSpeed;
p->Angles.addYaw(deltaangle(p->Angles.ZzANGLE(), p->Angles.ZzANGLE() - DAngle::fromBam(angAdjustment)));
p->vel.XY() += (p->GetActor()->spr.Angles.Yaw + velAdjustment).ToVector() * currSpeed;
p->Angles.addYaw(deltaangle(p->GetActor()->spr.Angles.Yaw, p->GetActor()->spr.Angles.Yaw - DAngle::fromBam(angAdjustment)));
}
if (p->NotOnWater && p->MotoSpeed > 50)
p->MotoSpeed -= (p->MotoSpeed / 2.);
@ -2311,7 +2311,7 @@ static void underwater(int snum, ESyncBits actions, double floorz, double ceilin
auto j = spawn(pact, WATERBUBBLE);
if (j)
{
j->spr.pos += (p->Angles.ZzANGLE().ToVector() + DVector2(12 - (global_random & 8), 12 - (global_random & 8))) * 16;
j->spr.pos += (p->GetActor()->spr.Angles.Yaw.ToVector() + DVector2(12 - (global_random & 8), 12 - (global_random & 8))) * 16;
j->spr.scale = DVector2(0.046875, 0.03125);
j->spr.pos.Z = p->GetActor()->getOffsetZ() + 8;
j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
@ -2329,7 +2329,7 @@ void onMotorcycleMove(int snum, walltype* wal)
{
auto p = &ps[snum];
auto pact = p->GetActor();
double angleDelta = absangle(p->Angles.ZzANGLE(), wal->delta().Angle()).Degrees();
double angleDelta = absangle(p->GetActor()->spr.Angles.Yaw, wal->delta().Angle()).Degrees();
double damageAmount = p->MotoSpeed * p->MotoSpeed;
const double scale = (180. / 2048.);
@ -2385,7 +2385,7 @@ void onBoatMove(int snum, int psectlotag, walltype* wal)
{
auto p = &ps[snum];
auto pact = p->GetActor();
double angleDelta = absangle(p->Angles.ZzANGLE(), wal->delta().Angle()).Degrees();
double angleDelta = absangle(p->GetActor()->spr.Angles.Yaw, wal->delta().Angle()).Degrees();
const double scale = (90. / 2048.);
p->Angles.addYaw(DAngle::fromDeg(p->MotoSpeed * (krand() & 1 ? -scale : scale)));
@ -2433,7 +2433,7 @@ void onMotorcycleHit(int snum, DDukeActor* victim)
if (numplayers == 1)
{
Collision coll;
DAngle ang = DAngle::fromBuild(p->TiltStatus * 20) + p->Angles.ZzANGLE();
DAngle ang = DAngle::fromBuild(p->TiltStatus * 20) + p->GetActor()->spr.Angles.Yaw;
movesprite_ex(victim, DVector3(ang.ToVector() * 4, victim->vel.Z), CLIPMASK0, coll);
}
}
@ -2467,7 +2467,7 @@ void onBoatHit(int snum, DDukeActor* victim)
if (numplayers == 1)
{
Collision coll;
DAngle ang = DAngle::fromBuild(p->TiltStatus * 20) + p->Angles.ZzANGLE();
DAngle ang = DAngle::fromBuild(p->TiltStatus * 20) + p->GetActor()->spr.Angles.Yaw;
movesprite_ex(victim, DVector3(ang.ToVector() * 2, victim->vel.Z), CLIPMASK0, coll);
}
}
@ -2683,8 +2683,8 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
zvel -= 4;
}
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 16, DYNAMITE, -16, DVector2(0.140625, 0.140625),
p->Angles.ZzANGLE(), (vel + p->hbomb_hold_delay * 2) * 2, zvel, pact, 1);
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 16, DYNAMITE, -16, DVector2(0.140625, 0.140625),
p->GetActor()->spr.Angles.Yaw, (vel + p->hbomb_hold_delay * 2) * 2, zvel, pact, 1);
if (spawned)
{
@ -2735,7 +2735,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
p->visibility = 0;
if (psectlotag != 857)
{
p->vel.XY() -= p->Angles.ZzANGLE().ToVector();
p->vel.XY() -= p->GetActor()->spr.Angles.Yaw.ToVector();
}
}
else if (p->kickback_pic == 2)
@ -2834,12 +2834,12 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (psectlotag != 857)
{
p->vel.XY() -= p->Angles.ZzANGLE().ToVector() * 2;
p->vel.XY() -= p->GetActor()->spr.Angles.Yaw.ToVector() * 2;
}
}
else if (psectlotag != 857)
{
p->vel.XY() -= p->Angles.ZzANGLE().ToVector();
p->vel.XY() -= p->GetActor()->spr.Angles.Yaw.ToVector();
}
}
@ -2925,7 +2925,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
if (psectlotag != 857)
{
p->vel.XY() -= p->Angles.ZzANGLE().ToVector();
p->vel.XY() -= p->GetActor()->spr.Angles.Yaw.ToVector();
}
checkavailweapon(p);
@ -3065,7 +3065,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
}
else if (p->kickback_pic == 12)
{
p->vel.XY() -= p->Angles.ZzANGLE().ToVector();
p->vel.XY() -= p->GetActor()->spr.Angles.Yaw.ToVector();
p->Angles.addPitch(DAngle::fromDeg(-8.88));
p->recoil += 20;
}
@ -3091,7 +3091,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
zvel -= 4;
}
CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 16, POWDERKEG, -16, DVector2(0.140625, 0.140625), p->Angles.ZzANGLE(), vel * 2, zvel, pact, 1);
CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 16, POWDERKEG, -16, DVector2(0.140625, 0.140625), p->GetActor()->spr.Angles.Yaw, vel * 2, zvel, pact, 1);
}
p->kickback_pic++;
if (p->kickback_pic > 20)
@ -3112,7 +3112,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
}
if (p->kickback_pic < 30)
{
p->vel.XY() += p->Angles.ZzANGLE().ToVector();
p->vel.XY() += p->GetActor()->spr.Angles.Yaw.ToVector();
}
p->kickback_pic++;
if (p->kickback_pic > 40)
@ -3996,7 +3996,7 @@ void OffMotorcycle(player_struct *p)
p->VBumpTarget = 0;
p->VBumpNow = 0;
p->TurbCount = 0;
p->vel.XY() = p->Angles.ZzANGLE().ToVector() / 2048.;
p->vel.XY() = p->GetActor()->spr.Angles.Yaw.ToVector() / 2048.;
p->moto_underwater = 0;
auto spawned = spawn(p->GetActor(), EMPTYBIKE);
if (spawned)
@ -4057,7 +4057,7 @@ void OffBoat(player_struct *p)
p->VBumpTarget = 0;
p->VBumpNow = 0;
p->TurbCount = 0;
p->vel.XY() = p->Angles.ZzANGLE().ToVector() / 2048.;
p->vel.XY() = p->GetActor()->spr.Angles.Yaw.ToVector() / 2048.;
p->moto_underwater = 0;
auto spawned = spawn(p->GetActor(), EMPTYBOAT);
if (spawned)

View file

@ -342,8 +342,8 @@ void operateweapon_ww(int snum, ESyncBits actions)
zvel -= 4;
}
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 16, HEAVYHBOMB, -16, DVector2(0.140625, 0.140625),
p->Angles.ZzANGLE(), vel + p->hbomb_hold_delay * 2, zvel, pact, 1);
auto spawned = CreateActor(p->cursector, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 16, HEAVYHBOMB, -16, DVector2(0.140625, 0.140625),
p->GetActor()->spr.Angles.Yaw, vel + p->hbomb_hold_delay * 2, zvel, pact, 1);
if (spawned)
{

View file

@ -53,8 +53,8 @@ void resetmys()
{
mypos = omypos = ps[myconnectindex].GetActor()->getPosWithOffsetZ();
myxvel = myyvel = myzvel = 0;
myang = ps[myconnectindex].Angles.ZzANGLE();
myhoriz = omyhoriz = ps[myconnectindex].Angles.ZzHORIZON();
myang = ps[myconnectindex].GetActor()->spr.Angles.Yaw;
myhoriz = omyhoriz = ps[myconnectindex].GetActor()->spr.Angles.Pitch;
myhorizoff = omyhorizoff = ps[myconnectindex].Angles.ViewAngles.Pitch;
mycursectnum = sectindex(ps[myconnectindex].cursector);
myjumpingcounter = ps[myconnectindex].jumping_counter;

View file

@ -72,7 +72,7 @@ void pickrandomspot(int snum)
p->GetActor()->spr.pos = po[i].opos;
p->GetActor()->backuppos();
p->setbobpos();
p->Angles.ZzOLDANGLE() = p->Angles.ZzANGLE() = po[i].oa;
p->GetActor()->PrevAngles.Yaw = p->GetActor()->spr.Angles.Yaw = po[i].oa;
p->setCursector(po[i].os);
}

View file

@ -1296,8 +1296,8 @@ void moveclouds(double interpfrac)
cloudclock = myclock + 6;
// cloudx/y were an array, but all entries were always having the same value so a single pair is enough.
cloudx += (float)ps[screenpeek].Angles.ZzANGLE().Cos() * 0.5f;
cloudy += (float)ps[screenpeek].Angles.ZzANGLE().Sin() * 0.5f;
cloudx += (float)ps[screenpeek].GetActor()->spr.Angles.Yaw.Cos() * 0.5f;
cloudy += (float)ps[screenpeek].GetActor()->spr.Angles.Yaw.Sin() * 0.5f;
for (int i = 0; i < numclouds; i++)
{
// no clamping here!

View file

@ -681,7 +681,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
if (wal->twoSided())
wal->nextWall()->cstat = 0;
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].Angles.ZzANGLE(), 0., 0., spr, 3);
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].GetActor()->spr.Angles.Yaw, 0., 0., spr, 3);
if (spawned)
{
spawned->spr.lotag = SE_128_GLASS_BREAKING;
@ -875,15 +875,15 @@ void checkplayerhurt_d(player_struct* p, const Collision& coll)
p->hurt_delay = 16;
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
p->vel.XY() = -p->Angles.ZzANGLE().ToVector() * 16;
p->vel.XY() = -p->GetActor()->spr.Angles.Yaw.ToVector() * 16;
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 2, -1);
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2, -1);
break;
case BIGFORCE:
p->hurt_delay = 26;
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 2, -1);
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2, -1);
break;
}
@ -1515,17 +1515,17 @@ void checksectors_d(int snum)
return;
}
if (p->newOwner != nullptr)
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
else
{
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -976,7 +976,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
if (wal->twoSided())
wal->nextWall()->cstat = 0;
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].Angles.ZzANGLE(), 0., 0., spr, 3);
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].GetActor()->spr.Angles.Yaw, 0., 0., spr, 3);
if (spawned)
{
spawned->spr.lotag = SE_128_GLASS_BREAKING;
@ -997,7 +997,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
if (wal->twoSided())
wal->nextWall()->cstat = 0;
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].Angles.ZzANGLE(), 0., 0., spr, 3);
auto spawned = CreateActor(sptr, pos, SECTOREFFECTOR, 0, DVector2(0, 0), ps[0].GetActor()->spr.Angles.Yaw, 0., 0., spr, 3);
if (spawned)
{
spawned->spr.lotag = SE_128_GLASS_BREAKING;
@ -1339,7 +1339,7 @@ void checkplayerhurt_r(player_struct* p, const Collision &coll)
{
case BIGFORCE:
p->hurt_delay = 26;
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->Angles.ZzANGLE().ToVector() * 2, -1);
fi.checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2, -1);
break;
}
@ -2379,21 +2379,21 @@ void checksectors_r(int snum)
}
return;
}
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near , 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near , 80., NT_Lotag | NT_Hitag);
}
if (p->newOwner != nullptr)
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPrevPosWithOffsetZ(), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
else
{
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ(), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(8), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->Angles.ZzOLDANGLE(), near, 80., NT_Lotag | NT_Hitag);
neartag(p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector(), p->GetActor()->PrevAngles.Yaw, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -427,7 +427,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
if (actj->isPlayer())
{
snum = actj->PlayerIndex();
ang = ps[snum].Angles.ZzANGLE() - mapangle((krand() & 63) + 8); //Fine tune
ang = ps[snum].GetActor()->spr.Angles.Yaw - mapangle((krand() & 63) + 8); //Fine tune
act->temp_data[0] = krand() & 1;
act->spr.pos.Z = 3 + ps[snum].GetActor()->getOffsetZ() + ps[snum].pyoff + (ps[snum].Angles.getPitchWithView().Tan() * 8.) + (!isshell ? 3 : 0);

View file

@ -863,7 +863,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, settargetangle, dukeplayer_settargeta
double dukeplayer_angle(player_struct* self)
{
return self->Angles.ZzANGLE().Degrees();
return self->GetActor()->spr.Angles.Yaw.Degrees();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, angle, dukeplayer_angle)