- Utilise actor sprite's full precision in instances where angle was converted to Build and back again.

This commit is contained in:
Mitchell Richters 2022-08-28 13:15:31 +10:00 committed by Christoph Oelckers
parent 5c84f93c08
commit d28d6cd4cf
33 changed files with 95 additions and 89 deletions

View file

@ -46,6 +46,7 @@
#include <string.h>
#include "xs_Float.h"
#include "math/cmath.h"
#include "basics.h"
#define EQUAL_EPSILON (1/65536.)
@ -1627,6 +1628,11 @@ typedef TAngle<double> DAngle;
constexpr DAngle nullAngle = DAngle::fromDeg(0.);
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
constexpr DAngle DAngle90 = DAngle::fromBam(ANGLE_90);
constexpr DAngle DAngle180 = DAngle::fromBam(ANGLE_180);
constexpr DAngle DAngle270 = DAngle::fromBam(ANGLE_270);
constexpr DAngle DAngle360 = DAngle::fromBam(ANGLE_MAX);
class Plane
{
public:

View file

@ -102,7 +102,7 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
else
{
// same as wall calculation.
daang = DAngle::fromBuild(act->int_ang() - 512);
daang = act->spr.angle - DAngle90;
newdist = int(np.X * daang.Sin() * (1 << BUILDSINBITS) + np.Y * -daang.Cos() * (1 << BUILDSINBITS));
if (abs(np.X) > abs(np.Y))

View file

@ -6419,7 +6419,7 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
}
auto fired = actSpawnThing(actor->sector(), x, y, z, thingType);
fired->SetOwner(actor);
fired->set_int_ang(actor->int_ang());
fired->spr.angle = actor->spr.angle;
fired->vel.X = MulScale(a6, Cos(fired->int_ang()), 30);
fired->vel.Y = MulScale(a6, Sin(fired->int_ang()), 30);
fired->vel.Z = MulScale(a6, a4, 14);

View file

@ -709,7 +709,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ???
int top, bottom;
GetActorExtents(actor, &top, &bottom);
actor->set_int_pos({ actor2->int_pos().X, actor2->int_pos().Y, actor2->sector()->int_floorz() - (bottom - actor->int_pos().Z) });
actor->set_int_ang(actor2->int_ang());
actor->spr.angle = actor2->spr.angle;
ChangeActorSect(actor, actor2->sector());
sfxPlay3DSound(actor2, 201, -1, 0);
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;

View file

@ -3281,7 +3281,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
{
if (pPlayer)
{
pPlayer->angle.settarget(DAngle::fromBuild(sourceactor->int_ang()));
pPlayer->angle.settarget(sourceactor->spr.angle);
pPlayer->angle.lockinput();
}
else if (isDude) sourceactor->xspr.goalAng = actor->spr.angle = sourceactor->spr.angle;
@ -3402,7 +3402,7 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor)
if (sourceactor->spr.flags & kModernTypeFlag4)
{
pEffect->set_int_ang(sourceactor->int_ang());
pEffect->spr.angle = sourceactor->spr.angle;
}
if (pEffect->spr.cstat & CSTAT_SPRITE_ONE_SIDE)
@ -3835,7 +3835,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector
if (sourceactor->spr.flags & kModernTypeFlag4)
{
spawned->set_int_ang(sourceactor->int_ang());
spawned->spr.angle = sourceactor->spr.angle;
}
// should be: the more is seqs, the shorter is timer
@ -6099,7 +6099,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
if (actor->xspr.data4 != 0) break;
else if (actor->spr.flags & kModernTypeFlag1)
{
pPlayer->angle.settarget(DAngle::fromBuild(actor->int_ang()));
pPlayer->angle.settarget(actor->spr.angle);
pPlayer->angle.lockinput();
}
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))

View file

@ -810,7 +810,7 @@ void playerStart(int nPlayer, int bNewLevel)
actor->add_int_z(-(bottom - actor->int_pos().Z));
actor->spr.pal = 11 + (pPlayer->teamId & 3);
actor->set_int_ang(pStartZone->ang);
pPlayer->angle.ang = DAngle::fromBuild(actor->int_ang());
pPlayer->angle.ang = actor->spr.angle;
actor->spr.type = kDudePlayer1 + nPlayer;
actor->spr.clipdist = pDudeInfo->clipdist;
actor->spr.flags = 15;
@ -1518,7 +1518,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
auto plActor = pPlayer->actor;
int const florhit = pPlayer->actor->hit.florhit.type;
bool const va = plActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
pPlayer->horizon.calcviewpitch(plActor->int_pos().vec2, DAngle::fromBuild(plActor->int_ang()), va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
pPlayer->horizon.calcviewpitch(plActor->int_pos().vec2, plActor->spr.angle, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
}
//---------------------------------------------------------------------------

View file

@ -1636,7 +1636,7 @@ void OperateTeleport(sectortype* pSector)
}
actor->set_int_xy(destactor->int_pos().X, destactor->int_pos().Y);
actor->add_int_z(destactor->sector()->int_floorz() - pSector->int_floorz());
actor->set_int_ang(destactor->int_ang());
actor->spr.angle = destactor->spr.angle;
ChangeActorSect(actor, destactor->sector());
sfxPlay3DSound(destactor, 201, -1, 0);
actor->vel.X = actor->vel.Y = actor->vel.Z = 0;
@ -1646,7 +1646,7 @@ void OperateTeleport(sectortype* pSector)
{
playerResetInertia(pPlayer);
pPlayer->zViewVel = pPlayer->zWeaponVel = 0;
pPlayer->angle.settarget(DAngle::fromBuild(actor->int_ang()), true);
pPlayer->angle.settarget(actor->spr.angle, true);
}
}
}

View file

@ -278,8 +278,8 @@ void lotsofstuff(DDukeActor* actor, int n, int spawntype)
void ms(DDukeActor* const actor)
{
//T1,T2 and T3 are used for all the sector moving stuff!!!
actor->spr.pos.X += actor->spr.xvel * DAngle::fromBuild(actor->int_ang()).Cos() * inttoworld;
actor->spr.pos.Y += actor->spr.xvel * DAngle::fromBuild(actor->int_ang()).Sin() * inttoworld;
actor->spr.pos.X += actor->spr.xvel * actor->spr.angle.Cos() * inttoworld;
actor->spr.pos.Y += actor->spr.xvel * actor->spr.angle.Sin() * inttoworld;
int j = actor->temp_data[1];
int k = actor->temp_data[2];
@ -704,7 +704,7 @@ void movecrane(DDukeActor *actor, int crane)
actor->SetActiveCrane(true);
ps[p].on_crane = actor;
S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].GetActor());
ps[p].angle.settarget(DAngle::fromBuild(actor->int_ang() + 1024));
ps[p].angle.settarget(actor->spr.angle + DAngle180);
}
else
{
@ -1317,7 +1317,7 @@ void movetongue(DDukeActor *actor, int tongue, int jaw)
return;
}
actor->set_int_ang(Owner->int_ang());
actor->spr.angle = Owner->spr.angle;
actor->spr.pos = Owner->spr.pos.plusZ(Owner->isPlayer() ? -34 : 0);
for (int k = 0; k < actor->temp_data[0]; k++)

View file

@ -831,7 +831,7 @@ static void movetripbomb(DDukeActor *actor)
auto spawned = spawn(actor, EXPLOSION2);
if (spawned)
{
spawned->set_int_ang(actor->int_ang());
spawned->spr.angle = actor->spr.angle;
spawned->spr.xvel = 348;
ssp(spawned, CLIPMASK0);
}
@ -1797,7 +1797,7 @@ void movetransports_d(void)
ps[k].GetActor()->spr.extra = 0;
}
ps[p].angle.ang = DAngle::fromBuild(Owner->int_ang());
ps[p].angle.ang = Owner->spr.angle;
if (Owner->GetOwner() != Owner)
{
@ -1979,7 +1979,7 @@ void movetransports_d(void)
if (k && sectlotag == 1 && act2->spr.statnum == 4)
{
k->spr.xvel = act2->spr.xvel >> 1;
k->set_int_ang(act2->int_ang());
k->spr.angle = act2->spr.angle;
ssp(k, CLIPMASK0);
}
}
@ -1992,7 +1992,7 @@ void movetransports_d(void)
if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1))
{
act2->add_int_pos({ (Owner->int_pos().X - act->int_pos().X),(Owner->int_pos().Y - act->int_pos().Y), -(act->int_pos().Z - Owner->sector()->int_floorz()) });
act2->set_int_ang(Owner->int_ang());
act2->spr.angle = Owner->spr.angle;
act2->backupang();

View file

@ -1447,7 +1447,7 @@ void movetransports_r(void)
ps[k].GetActor()->spr.extra = 0;
}
ps[p].angle.ang = DAngle::fromBuild(Owner->int_ang());
ps[p].angle.ang = Owner->spr.angle;
if (Owner->GetOwner() != Owner)
{
@ -1658,7 +1658,7 @@ void movetransports_r(void)
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
{
spawned->spr.xvel = act2->spr.xvel >> 1;
spawned->set_int_ang(act2->int_ang());
spawned->spr.angle = act2->spr.angle;
ssp(spawned, CLIPMASK0);
}
}
@ -1671,7 +1671,7 @@ void movetransports_r(void)
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
{
act2->add_int_pos({ (Owner->int_pos().X - act->int_pos().X), (Owner->int_pos().Y - act->int_pos().Y), -(act->int_pos().Z - Owner->sector()->int_floorz()) });
act2->set_int_ang(Owner->int_ang());
act2->spr.angle = Owner->spr.angle;
act2->backupang();
@ -2175,7 +2175,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3190)->set_int_ang(act->int_ang());
spawn(act, RRTILE3190)->spr.angle = act->spr.angle;
act->spr.lotag = 128;
}
break;
@ -2183,7 +2183,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3192)->set_int_ang(act->int_ang());
spawn(act, RRTILE3192)->spr.angle = act->spr.angle;
act->spr.lotag = 256;
}
break;
@ -2208,7 +2208,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3120)->set_int_ang(act->int_ang());
spawn(act, RRTILE3120)->spr.angle = act->spr.angle;
act->spr.lotag = 448;
}
break;
@ -2216,7 +2216,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3122)->set_int_ang(act->int_ang());
spawn(act, RRTILE3122)->spr.angle = act->spr.angle;
act->spr.lotag = 64;
}
break;
@ -2224,7 +2224,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3123)->set_int_ang(act->int_ang());
spawn(act, RRTILE3123)->spr.angle = act->spr.angle;
act->spr.lotag = 512;
}
break;
@ -2232,7 +2232,7 @@ void rr_specialstats()
act->spr.lotag--;
if (act->spr.lotag < 0)
{
spawn(act, RRTILE3124)->set_int_ang(act->int_ang());
spawn(act, RRTILE3124)->spr.angle = act->spr.angle;
act->spr.lotag = 224;
}
break;
@ -2292,7 +2292,7 @@ void rr_specialstats()
{
if (act2->spr.picnum == RRTILE297)
{
ps[p].angle.ang = DAngle::fromBuild(act2->int_ang());
ps[p].angle.ang = act2->spr.angle;
ps[p].getposfromactor(act2, -36);
ps[p].backupxyz();
ps[p].setbobpos();
@ -2589,7 +2589,7 @@ static int henstand(DDukeActor *actor)
{
ns->spr.xvel = 32;
ns->spr.lotag = 40;
ns->set_int_ang(actor->int_ang());
ns->spr.angle = actor->spr.angle;
}
}
}

View file

@ -220,8 +220,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
t->set_int_ang(getangle(x - t->int_pos().X, y - t->int_pos().Y));
t->pos.X = OwnerAc->spr.pos.X + DAngle::fromBuild(t->int_ang()).Cos();
t->pos.Y = OwnerAc->spr.pos.Y + DAngle::fromBuild(t->int_ang()).Sin();
t->pos.X = OwnerAc->spr.pos.X + t->angle.Cos();
t->pos.Y = OwnerAc->spr.pos.Y + t->angle.Sin();
}
}
break;
@ -705,7 +705,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->picnum = OwnerAc->dispicnum;
t->pal = OwnerAc->spr.pal;
t->shade = OwnerAc->spr.shade;
t->set_int_ang(OwnerAc->int_ang());
t->angle = OwnerAc->spr.angle;
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
}
}

View file

@ -214,8 +214,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
t->set_int_ang(getangle(x - t->int_pos().X, y - t->int_pos().Y));
t->pos.X = OwnerAc->spr.pos.X + DAngle::fromBuild(t->int_ang()).Cos();
t->pos.Y = OwnerAc->spr.pos.Y + DAngle::fromBuild(t->int_ang()).Sin();
t->pos.X = OwnerAc->spr.pos.X + t->angle.Cos();
t->pos.Y = OwnerAc->spr.pos.Y + t->angle.Sin();
}
}
break;
@ -938,7 +938,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->picnum = OwnerAc->dispicnum;
t->pal = OwnerAc->spr.pal;
t->shade = OwnerAc->spr.shade;
t->set_int_ang(OwnerAc->int_ang());
t->angle = OwnerAc->spr.angle;
t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat;
}
}

View file

@ -894,7 +894,7 @@ void shoot_r(DDukeActor* actor, int atwith)
if (j)
{
j->spr.xvel = 32;
j->set_int_ang(actor->int_ang());
j->spr.angle = actor->spr.angle;
j->add_int_z(-(5 << 8));
}
break;
@ -905,7 +905,7 @@ void shoot_r(DDukeActor* actor, int atwith)
if (j)
{
j->spr.xvel = 250;
j->set_int_ang(actor->int_ang());
j->spr.angle = actor->spr.angle;
j->add_int_z(-(15 << 8));
}
break;
@ -4047,7 +4047,7 @@ void OnMotorcycle(player_struct *p, DDukeActor* motosprite)
{
p->pos.X = motosprite->spr.pos.X;
p->pos.Y = motosprite->spr.pos.Y;
p->angle.ang = DAngle::fromBuild(motosprite->int_ang());
p->angle.ang = motosprite->spr.angle;
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
deletesprite(motosprite);
}
@ -4127,7 +4127,7 @@ void OnBoat(player_struct *p, DDukeActor* boat)
{
p->pos.X = boat->spr.pos.X;
p->pos.Y = boat->spr.pos.Y;
p->angle.ang = DAngle::fromBuild(boat->int_ang());
p->angle.ang = boat->spr.angle;
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
deletesprite(boat);
}

View file

@ -661,7 +661,7 @@ void resetpspritevars(int g)
ps[j].backupxyz();
ps[j].setbobpos();
act->backuppos();
ps[j].angle.oang = ps[j].angle.ang = DAngle::fromBuild(act->int_ang());
ps[j].angle.oang = ps[j].angle.ang = act->spr.angle;
updatesector(act->int_pos().X, act->int_pos().Y, &ps[j].cursector);

View file

@ -258,7 +258,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
if (act->spr.yvel < 0) act->spr.yvel = -100;
else if (act->spr.yvel > 199) act->spr.yvel = 300;
cang = DAngle::fromBuild(interpolatedangle(ud.cameraactor->tempang, act->int_ang(), smoothratio));
cang = interpolatedangle(DAngle::fromBuild(ud.cameraactor->tempang), act->spr.angle, smoothratio);
auto bh = buildhoriz(act->spr.yvel);
auto cstat = act->spr.cstat;

View file

@ -1059,7 +1059,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (krand() & 3)
{
targ->spr.xvel = 164;
targ->set_int_ang(proj->int_ang());
targ->spr.angle = proj->spr.angle;
}
else
{

View file

@ -2100,7 +2100,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
if (krand() & 3)
{
targ->spr.xvel = 164;
targ->set_int_ang(proj->int_ang());
targ->spr.angle = proj->spr.angle;
}
}
break;

View file

@ -287,7 +287,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act)
act->timetosleep = 0;
if (actj)
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
}
}
@ -324,7 +324,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
act->spr.shade = -127;
act->spr.cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.xvel = 128;
ChangeActorStat(act, STAT_MISC);
@ -407,7 +407,7 @@ void initfootprint(DDukeActor* actj, DDukeActor* act)
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR;
if ((ps[actj->spr.yvel].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
}
act->set_int_z(sect->int_floorz());

View file

@ -201,7 +201,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case TONGUE:
if (actj)
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.pos.Z -= gs.playerheight;
act->spr.zvel = 256 - (krand() & 511);
act->spr.xvel = 64 - (krand() & 127);
@ -607,7 +607,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (actj)
{
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.shade = -64;
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
}
@ -683,7 +683,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == WATERBUBBLE)
{
if (actj)
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.xrepeat = act->spr.yrepeat = 4;
}
else act->spr.xrepeat = act->spr.yrepeat = 32;
@ -1105,7 +1105,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case STEAM:
if (actj)
{
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.xvel = -8;

View file

@ -283,7 +283,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case TONGUE:
if (actj)
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.pos.Z -= gs.playerheight;
act->spr.zvel = 256 - (krand() & 511);
act->spr.xvel = 64 - (krand() & 127);
@ -617,7 +617,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case SMALLSMOKE:
if (actj)
{
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.shade = -64;
act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip();
}
@ -688,7 +688,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
if (act->spr.picnum == WATERBUBBLE)
{
if (actj)
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.xrepeat = act->spr.yrepeat = 1 + (krand() & 7);
}
else
@ -1355,7 +1355,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case STEAM:
if (actj)
{
act->set_int_ang(actj->int_ang());
act->spr.angle = actj->spr.angle;
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.xvel = -8;

View file

@ -112,7 +112,7 @@ void BuildGrenade(int nPlayer)
pActor->spr.clipdist = 30;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->set_int_ang(pPlayerActor->int_ang());
pActor->spr.angle = pPlayerActor->spr.angle;
pActor->spr.intowner = nPlayer;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;

View file

@ -265,8 +265,8 @@ void RestartPlayer(int nPlayer)
pActor->set_int_pos(nNStartSprite->int_pos());
ChangeActorSect(pActor, nNStartSprite->sector());
plr->angle.ang = DAngle::fromBuild(nNStartSprite->int_ang() & kAngleMask);
pActor->set_int_ang(plr->angle.ang.Buildang());
plr->angle.ang = nNStartSprite->spr.angle.Normalized360();
pActor->spr.angle = plr->angle.ang;
floorsprt = insertActor(pActor->sector(), 0);
@ -317,7 +317,7 @@ void RestartPlayer(int nPlayer)
pDActor->spr.xoffset = 0;
pDActor->spr.yoffset = 0;
pDActor->spr.shade = pActor->spr.shade;
pDActor->set_int_ang(pActor->int_ang());
pDActor->spr.angle = pActor->spr.angle;
pDActor->spr.cstat = pActor->spr.cstat;
pDActor->spr.lotag = runlist_HeadRun() + 1;
@ -2576,7 +2576,7 @@ sectdone:
if (pPlayerActor->sector()->pAbove != nullptr)
{
pDopple->set_int_ang(pPlayerActor->int_ang());
pDopple->spr.angle = pPlayerActor->spr.angle;
ChangeActorSect(pDopple, pPlayerActor->sector()->pAbove);
pDopple->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
}

View file

@ -212,7 +212,7 @@ void BuildSnake(int nPlayer, int zVal)
pActor->spr.pal = 0;
pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0;
pActor->set_int_ang(pPlayerActor->int_ang());
pActor->spr.angle = pPlayerActor->spr.angle;
pActor->spr.xvel = 0;
pActor->spr.yvel = 0;
pActor->spr.zvel = 0;

View file

@ -211,7 +211,7 @@ void DrawView(double smoothRatio, bool sceneonly)
playerY = pActor->int_pos().Y;
playerZ = pActor->int_pos().Z;
pSector = pActor->sector();
nAngle = DAngle::fromBuild(pActor->int_ang());
nAngle = pActor->spr.angle;
rotscrnang = nullAngle;
SetGreenPal();

View file

@ -158,7 +158,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->spr.xvel = 200 + RandomRange(200);
actor->user.jump_speed = -200 - RandomRange(250);
DoActorBeginJump(actor);
actor->set_int_ang(weapActor->int_ang());
actor->spr.angle = weapActor->spr.angle;
}
}
else
@ -177,7 +177,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->user.ActorActionFunc = nullptr;
//actor->user.ActorActionFunc = NullAnimator;
if (!sw_ninjahack)
actor->set_int_ang(weapActor->int_ang());
actor->spr.angle = weapActor->spr.angle;
break;
case COOLG_RUN_R0:
@ -259,7 +259,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->spr.xvel = 300 + RandomRange(400);
actor->user.jump_speed = -300 - RandomRange(350);
DoActorBeginJump(actor);
actor->set_int_ang(weapActor->int_ang());
actor->spr.angle = weapActor->spr.angle;
break;
}
break;

View file

@ -1025,10 +1025,10 @@ int DoBunnyQuickJump(DSWActor* actor)
}
actor->copyXY(hitActor);
actor->set_int_ang(hitActor->int_ang());
actor->spr.angle = hitActor->spr.angle;
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + 1024));
HelpMissileLateral(actor, 2000);
actor->set_int_ang(hitActor->int_ang());
actor->spr.angle = hitActor->spr.angle;
actor->user.Vis = actor->int_ang(); // Remember angles for later
hitActor->user.Vis = hitActor->int_ang();

View file

@ -526,7 +526,7 @@ DSWActor* CopySprite(sprt const* tsp, sectortype* newsector)
actorNew->spr.yrepeat = tsp->yrepeat;
actorNew->spr.xoffset = tsp->xoffset;
actorNew->spr.yoffset = tsp->yoffset;
actorNew->set_int_ang(tsp->int_ang());
actorNew->spr.angle = tsp->angle;
actorNew->spr.xvel = tsp->xvel;
actorNew->spr.yvel = tsp->yvel;
actorNew->spr.zvel = tsp->zvel;
@ -1101,7 +1101,7 @@ void CameraView(PLAYER* pp, int *tx, int *ty, int *tz, sectortype** tsect, DAngl
while (auto actor = it.Next())
{
ang = VecToAngle(*tx - actor->int_pos().X, *ty - actor->int_pos().Y);
ang_test = deltaangle(ang, DAngle::fromBuild(actor->int_ang())) < DAngle::fromBuild(actor->spr.lotag);
ang_test = deltaangle(ang, actor->spr.angle) < DAngle::fromBuild(actor->spr.lotag);
FAFcansee_test =
(FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), *tx, *ty, *tz, pp->cursector) ||
@ -1447,7 +1447,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
{
DSWActor* ractor = pp->remoteActor;
if (TEST_BOOL1(ractor))
tang = DAngle::fromBuild(ractor->int_ang());
tang = ractor->spr.angle;
else
tang = VecToAngle(pp->sop_remote->pmid.X - tx, pp->sop_remote->pmid.Y - ty);
}

View file

@ -2195,7 +2195,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
if (ShellNum == -3)
{
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
HelpMissileLateral(actorNew,2500);
actorNew->set_int_ang(NORM_ANGLE(actorNew->spr.int_ang() - 512));
HelpMissileLateral(actorNew,1000); // Was 1500
@ -2203,7 +2203,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
}
else
{
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
HelpMissileLateral(actorNew,2500);
actorNew->set_int_ang(NORM_ANGLE(actorNew->spr.int_ang() + 512));
HelpMissileLateral(actorNew,1500);
@ -2218,7 +2218,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
break;
case SHOT_SHELL:
actorNew->add_int_z(-Z(13));
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
HelpMissileLateral(actorNew,2500);
actorNew->set_int_ang(NORM_ANGLE(actorNew->spr.int_ang() + 512));
HelpMissileLateral(actorNew,1300);

View file

@ -3349,7 +3349,7 @@ void DoPlayerClimb(PLAYER* pp)
pp->LadderPosition.X = lActor->int_pos().X + nx * 5;
pp->LadderPosition.Y = lActor->int_pos().Y + ny * 5;
pp->angle.settarget(DAngle::fromBuild(lActor->int_ang() + 1024));
pp->angle.settarget(lActor->spr.angle + DAngle180);
}
}
}
@ -3731,7 +3731,7 @@ bool PlayerOnLadder(PLAYER* pp)
pp->LadderPosition.X = lActor->int_pos().X + nx * 5;
pp->LadderPosition.Y = lActor->int_pos().Y + ny * 5;
pp->angle.settarget(DAngle::fromBuild(lActor->int_ang() + 1024));
pp->angle.settarget(lActor->spr.angle + DAngle180);
return true;
}
@ -5117,7 +5117,7 @@ void DoPlayerStopOperate(PLAYER* pp)
{
DSWActor* rsp = pp->remoteActor;
if (TEST_BOOL1(rsp))
pp->angle.ang = pp->angle.oang = DAngle::fromBuild(rsp->int_ang());
pp->angle.ang = pp->angle.oang = rsp->spr.angle;
else
pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->pmid.X - pp->pos.X, pp->sop_remote->pmid.Y - pp->pos.Y);
}
@ -6861,7 +6861,7 @@ void PlayerSpawnPosition(PLAYER* pp)
ASSERT(spawn_sprite != nullptr);
pp->pos = pp->opos = spawn_sprite->int_pos();
pp->angle.ang = pp->angle.oang = DAngle::fromBuild(spawn_sprite->int_ang());
pp->angle.ang = pp->angle.oang = spawn_sprite->spr.angle;
pp->setcursector(spawn_sprite->sector());
getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz);

View file

@ -603,7 +603,7 @@ void GameInterface::UpdateSounds(void)
{
DSWActor* rsp = pp->remoteActor;
if (TEST_BOOL1(rsp))
tang = DAngle::fromBuild(rsp->int_ang());
tang = rsp->spr.angle;
else
tang = VecToAngle(pp->sop_remote->pmid.X - pp->pos.X, pp->sop_remote->pmid.Y - pp->pos.Y);
}

View file

@ -3729,7 +3729,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew->spr.cstat = 0;
actorNew->spr.extra = 0;
actorNew->set_int_pos({ actor->int_pos().X, actor->int_pos().Y, ActorLowerZ(actor) + Z(10) });
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
// vel
SP_TAG7(actorNew) = 10;
@ -3792,16 +3792,16 @@ int SpawnItemsMatch(short match)
case 90:
spawnedActor = BunnyHatch2(itActor);
spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER8; // Boy
spawnedActor->set_int_ang(itActor->int_ang());
spawnedActor->spr.angle = itActor->spr.angle;
break;
case 91:
spawnedActor = BunnyHatch2(itActor);
spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER0; // Girl
spawnedActor->set_int_ang(itActor->int_ang());
spawnedActor->spr.angle = itActor->spr.angle;
break;
case 92:
spawnedActor = BunnyHatch2(itActor);
spawnedActor->set_int_ang(itActor->int_ang());
spawnedActor->spr.angle = itActor->spr.angle;
break;
case 40:

View file

@ -304,7 +304,7 @@ DSWActor* TrackClonePoint(DSWActor* actor)
actorNew->spr.cstat = 0;
actorNew->spr.extra = 0;
actorNew->spr.pos = actor->spr.pos;
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.lotag = actor->spr.lotag;
actorNew->spr.hitag = actor->spr.hitag;
@ -1225,7 +1225,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
KillActor(actor);
break;
case SO_LIMIT_TURN:
sop->limit_ang_center = DAngle::fromBuild(actor->int_ang());
sop->limit_ang_center = actor->spr.angle;
sop->limit_ang_delta = DAngle::fromBuild(actor->spr.lotag);
KillActor(actor);
break;

View file

@ -7943,7 +7943,7 @@ int DoPlasmaFountain(DSWActor* actor)
// move with sprite
SetActorZ(actor, attachActor->int_pos());
actor->set_int_ang(attachActor->int_ang());
actor->spr.angle = attachActor->spr.angle;
actor->user.Counter++;
if (actor->user.Counter > 3)
@ -9492,7 +9492,7 @@ int DoUziBullet(DSWActor* actor)
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
SetOwner(GetOwner(actor), actorNew);
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 128 >> 2;
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
@ -9503,7 +9503,7 @@ int DoUziBullet(DSWActor* actor)
actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
actorNew->spr.yrepeat = UZI_SPARK_REPEAT;
SetOwner(GetOwner(actor), actorNew);
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
}
@ -15047,7 +15047,7 @@ int BulletHitSprite(DSWActor* actor, DSWActor* hitActor, int hit_x, int hit_y, i
}
SetOwner(actor, actorNew);
actorNew->set_int_ang(actor->int_ang());
actorNew->spr.angle = actor->spr.angle;
SetActorZ(actorNew, &hit_pos);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -17606,7 +17606,7 @@ int QueueFootPrint(DSWActor* actor)
spawnedActor->spr.clipdist = 0;
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = actor->spr.pos;
spawnedActor->set_int_ang(actor->int_ang());
spawnedActor->spr.angle = actor->spr.angle;
spawnedActor->user.Flags &= ~(SPR_SHADOW);
switch (FootMode)
{