diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 046d6c2ad..b02cae2a4 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -379,7 +379,7 @@ void DCoreActor::initFromSprite(spritetype* mspr) #define setter(flag, var) if (!(actorinfo->DefaultFlags & flag)) spr.var = mspr->var; setter(DEFF_PICNUM, picnum); - setter(DEFF_ANG, angle); + setter(DEFF_ANG, Angles.Yaw); setter(DEFF_INTANG, intangle); setter(DEFF_XVEL, xint); setter(DEFF_YVEL, yint); diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 986a0fd58..0b7c4912a 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -628,7 +628,7 @@ void DrawOverheadMap(const DVector2& plxy, const DAngle pl_angle, double const i void DrawAutomapAlignmentFacing(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col) { auto v1 = OutAutomapVector(bpos, cangvect, czoom, xydim); - auto v2 = OutAutomapVector(spr.angle.ToVector() * 8., cangvect, czoom); + auto v2 = OutAutomapVector(spr.Angles.Yaw.ToVector() * 8., cangvect, czoom); auto v3 = v2.Rotated90CW(); auto v4 = v1 + v2; @@ -651,7 +651,7 @@ void DrawAutomapAlignmentWall(const spritetype& spr, const DVector2& bpos, const if ((spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff; - auto sprvec = spr.angle.ToVector().Rotated90CW() * xrep; + auto sprvec = spr.Angles.Yaw.ToVector().Rotated90CW() * xrep; auto b1 = bpos - sprvec * ((xspan * 0.5) + xoff); auto b2 = b1 + sprvec * xspan; @@ -687,7 +687,7 @@ void DrawAutomapAlignmentFloor(const spritetype& spr, const DVector2& bpos, cons if ((spr.cstat & CSTAT_SPRITE_XFLIP) > 0) xoff = -xoff; if ((spr.cstat & CSTAT_SPRITE_YFLIP) > 0) yoff = -yoff; - auto sprvec = spr.angle.ToVector(); + auto sprvec = spr.Angles.Yaw.ToVector(); auto xscale = sprvec.Rotated90CW() * xspan * xrep; auto yscale = sprvec * yspan * yrep; auto xybase = DVector2(((xspan * 0.5) + xoff) * xrep, ((yspan * 0.5) + yoff) * yrep); diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 68e40ea0b..729c664c4 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -83,12 +83,12 @@ public: constexpr int int_ang() const { - return spr.angle.Buildang(); + return spr.Angles.Yaw.Buildang(); } void norm_ang() { - spr.angle = spr.angle.Normalized360(); + spr.Angles.Yaw = spr.Angles.Yaw.Normalized360(); } DVector3 interpolatedpos(double const interpfrac) @@ -98,7 +98,7 @@ public: DAngle interpolatedangle(double const interpfrac) { - return interpolatedvalue(oang, spr.angle, interpfrac); + return interpolatedvalue(oang, spr.Angles.Yaw, interpfrac); } void backupz() @@ -120,7 +120,7 @@ public: void backupang() { - oang = spr.angle; + oang = spr.Angles.Yaw; } void backuploc() diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index 46c0279e5..7be3ad294 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -86,7 +86,7 @@ bool calcChaseCamPos(DVector3& ppos, DCoreActor* act, sectortype** psect, DAngle else { // same as wall calculation. - hpos.*c -= npos.*c * npos.XY().dot((act->spr.angle - DAngle90).ToVector().Rotated90CW()) * (1. / 1024.); + hpos.*c -= npos.*c * npos.XY().dot((act->spr.Angles.Yaw - DAngle90).ToVector().Rotated90CW()) * (1. / 1024.); } } @@ -215,7 +215,7 @@ void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVect xoffset = tex->GetDisplayLeftOffset() + spr->xoffset; } - auto p = spr->angle.ToVector().Rotated90CW() * spr->scale.X; + auto p = spr->Angles.Yaw.ToVector().Rotated90CW() * spr->scale.X; if (spr->cstat & CSTAT_SPRITE_XFLIP) xoffset = -xoffset; double origin = (width * 0.5) + xoffset; @@ -264,8 +264,8 @@ void TGetFlatSpritePosition(const spritetypebase* spr, const DVector2& pos, DVec double sprcenterx = (width * 0.5) + leftofs; double sprcentery = (height * 0.5) + topofs; - double cosang = spr->angle.Cos(); - double sinang = spr->angle.Sin(); + double cosang = spr->Angles.Yaw.Cos(); + double sinang = spr->Angles.Yaw.Sin(); double cosangslope = cosang / sloperatio; double sinangslope = sinang / sloperatio; @@ -953,7 +953,7 @@ bool checkRangeOfFloorSprite(DCoreActor* itActor, const DVector3& pos, double ma GetFlatSpritePosition(itActor, itActor->spr.pos.XY(), out); // expand the area to cover 'maxdist' units more on each side. (i.e. move the edges out) - auto expand = (itActor->spr.angle - DAngle45).ToVector() * (maxdist + 0.25); // that's surely not accurate but here we must match Build's original value. + auto expand = (itActor->spr.Angles.Yaw - DAngle45).ToVector() * (maxdist + 0.25); // that's surely not accurate but here we must match Build's original value. out[0] += expand; out[1] += expand.Rotated90CCW(); out[2] -= expand; @@ -1353,7 +1353,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor) tspr->yoffset = actor->spr.yoffset; tspr->sectp = actor->spr.sectp; tspr->statnum = actor->spr.statnum; - tspr->angle = actor->spr.angle; + tspr->Angles.Yaw = actor->spr.Angles.Yaw; tspr->xint = actor->spr.xint; tspr->yint = actor->spr.yint; tspr->inittype = actor->spr.inittype; // not used by tsprites. diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 12ba90cf4..47db29e56 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -414,7 +414,7 @@ inline int tspriteGetSlope(const tspritetype* spr) inline double spriteGetZOfSlopef(const spritetypebase* tspr, const DVector2& pos, int heinum) { if (heinum == 0) return tspr->pos.Z; - return tspr->pos.Z + heinum * -tspr->angle.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR); + return tspr->pos.Z + heinum * -tspr->Angles.Yaw.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR); } //========================================================================== diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index 59c8b8074..e49dc2cbd 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -316,7 +316,7 @@ static void ReadSpriteV7(FileReader& fr, spritetype& spr, int& secno) secno = fr.ReadInt16(); spr.statnum = fr.ReadInt16(); spr.intangle = fr.ReadInt16(); - spr.angle = mapangle(spr.intangle); + spr.Angles.Yaw = mapangle(spr.intangle); spr.intowner = fr.ReadInt16(); spr.xint = fr.ReadInt16(); spr.yint = fr.ReadInt16(); @@ -344,7 +344,7 @@ static void ReadSpriteV6(FileReader& fr, spritetype& spr, int& secno) spr.yoffset = fr.ReadInt8(); spr.picnum = fr.ReadInt16(); spr.intangle = fr.ReadInt16(); - spr.angle = mapangle(spr.intangle); + spr.Angles.Yaw = mapangle(spr.intangle); spr.xint = fr.ReadInt16(); spr.yint = fr.ReadInt16(); spr.inittype = fr.ReadInt16(); @@ -373,7 +373,7 @@ static void ReadSpriteV5(FileReader& fr, spritetype& spr, int& secno) spr.scale = DVector2(x * REPEAT_SCALE, y * REPEAT_SCALE); spr.picnum = fr.ReadInt16(); spr.intangle = fr.ReadInt16(); - spr.angle = mapangle(spr.intangle); + spr.Angles.Yaw = mapangle(spr.intangle); spr.xint = fr.ReadInt16(); spr.yint = fr.ReadInt16(); spr.inittype = fr.ReadInt16(); diff --git a/source/core/maptypes.h b/source/core/maptypes.h index a8b602d8d..b6ce28f45 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -448,7 +448,7 @@ struct spritetypebase DVector3 pos; sectortype* sectp; - DAngle angle; + DRotator Angles; DVector2 scale; ESpriteFlags cstat; diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index 571ea8c8e..0c49933f7 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -686,7 +686,7 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal) if ((actor->spr.cstat & (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_MASK)) != (CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL) || (r_voxels && tiletovox[actor->spr.picnum] >= 0 && voxmodels[tiletovox[actor->spr.picnum]]) || (r_voxels && gi->Voxelize(actor->spr.picnum) > -1) || - (actor->spr.angle.Cos() * viewvec.X) + (actor->spr.angle.Sin() * viewvec.Y) < 0) + (actor->spr.Angles.Yaw.Cos() * viewvec.X) + (actor->spr.Angles.Yaw.Sin() * viewvec.Y) < 0) if (!renderAddTsprite(di->tsprites, actor)) break; } diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 0d83021d4..02a788e58 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -317,11 +317,11 @@ void HWDrawInfo::DispatchSprites() if (actor->sprext.renderflags & SPREXT_AWAY1) { - tspr->pos.XY() += tspr->angle.ToVector() * 0.125; + tspr->pos.XY() += tspr->Angles.Yaw.ToVector() * 0.125; } else if (actor->sprext.renderflags & SPREXT_AWAY2) { - tspr->pos.XY() -= tspr->angle.ToVector() * 0.125; + tspr->pos.XY() -= tspr->Angles.Yaw.ToVector() * 0.125; } switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) diff --git a/source/core/rendering/scene/hw_sprites.cpp b/source/core/rendering/scene/hw_sprites.cpp index be025920a..eef286c2a 100644 --- a/source/core/rendering/scene/hw_sprites.cpp +++ b/source/core/rendering/scene/hw_sprites.cpp @@ -462,7 +462,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s visibility = sectorVisibility(sector); voxel = vox; - auto ang = spr->angle + ownerActor->sprext.rot.Yaw; + auto ang = spr->Angles.Yaw + ownerActor->sprext.rot.Yaw; if ((spr->clipdist & TSPR_MDLROTATE) || rotate) { int myclock = (PlayClock << 3) + MulScale(4 << 3, (int)di->Viewpoint.TicFrac, 16); diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index d24d18688..efdfa22fb 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -62,13 +62,13 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos) { // Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results. auto d = wal.delta(); - auto deltaang = absangle(d.Angle(), tspr->angle); + auto deltaang = absangle(d.Angle(), tspr->Angles.Yaw); const DAngle maxangdelta = DAngle360 / 1024; // angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned. if (deltaang >= DAngle90 - maxangdelta && deltaang <= DAngle90 + maxangdelta) { - if (!((tspr->angle.Buildang()) & 510)) + if (!((tspr->Angles.Yaw.Buildang()) & 510)) { // orthogonal lines do not check the actual position so that certain off-sector sprites get handled properly. // In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector. @@ -1101,7 +1101,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec int HWWall::CheckWallSprite(tspritetype* spr, tspritetype* last) { // If the position changed we need to recalculate everything. - if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->angle != last->angle) return 3; + if (spr->pos.XY() != last->pos.XY() || spr->sectp != last->sectp || spr->Angles.Yaw != last->Angles.Yaw) return 3; // if the horizontal orientation changes we need to recalculate the walls this attaches to, but not the positioning. if (spr->scale.X != last->scale.X || spr->xoffset != last->xoffset || spr->picnum != last->picnum || ((spr->cstat ^ last->cstat) & CSTAT_SPRITE_XFLIP)) return 2; diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index b2400824f..03739571d 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -421,7 +421,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet ("yoffset", c.yoffset, def->yoffset) ("statnum", c.statnum) ("sectnum", c.sectp) - ("angle", c.angle, def->angle) + ("angles", c.Angles, def->Angles) ("ang", c.intangle, def->intangle) ("owner", c.intowner, def->intowner) ("xvel", c.xint, def->xint) @@ -636,7 +636,7 @@ void DCoreActor::Serialize(FSerializer& arc) if (arc.isReading()) { spsmooth = {}; - backuppos(); + backuploc(); } } diff --git a/source/core/thingdef_properties.cpp b/source/core/thingdef_properties.cpp index 17104f508..ed947d797 100644 --- a/source/core/thingdef_properties.cpp +++ b/source/core/thingdef_properties.cpp @@ -331,7 +331,7 @@ DEFINE_PROPERTY(statnum, I, CoreActor) DEFINE_PROPERTY(angle, F, CoreActor) { PROP_INT_PARM(i, 0); - defaults->spr.angle = DAngle::fromDeg(i); + defaults->spr.Angles.Yaw = DAngle::fromDeg(i); bag.Info->ActorInfo()->DefaultFlags |= DEFF_ANG; } diff --git a/source/core/vmexports.cpp b/source/core/vmexports.cpp index 765acad2b..fa8de0ce4 100644 --- a/source/core/vmexports.cpp +++ b/source/core/vmexports.cpp @@ -136,7 +136,7 @@ DEFINE_FIELD_NAMED_X(walltype, walltype, yrepeat, yrepeat) DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, sectp, sector) DEFINE_FIELD_X(tspritetype, tspritetype, cstat) DEFINE_FIELD_X(tspritetype, tspritetype, statnum) -DEFINE_FIELD_X(tspritetype, tspritetype, angle) +DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, Angles.Yaw, angle) DEFINE_FIELD_X(tspritetype, tspritetype, xint) DEFINE_FIELD_X(tspritetype, tspritetype, yint) DEFINE_FIELD_X(tspritetype, tspritetype, inittype) @@ -629,7 +629,7 @@ DEFINE_FIELD_NAMED(DCoreActor, sprext.renderflags, renderflags) DEFINE_FIELD_NAMED(DCoreActor, sprext.alpha, alpha) DEFINE_FIELD_NAMED(DCoreActor, time, spawnindex) DEFINE_FIELD(DCoreActor, spritesetindex) -DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle) +DEFINE_FIELD_NAMED(DCoreActor, spr.Angles.Yaw, angle) DEFINE_FIELD(DCoreActor, vel) DEFINE_FIELD(DCoreActor, viewzoffset) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index b14b06ec2..32c421da7 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2704,13 +2704,13 @@ static void actNapalmMove(DBloodActor* actor) int spawnparam[2]; spawnparam[0] = actor->xspr.data4 >> 1; spawnparam[1] = actor->xspr.data4 - spawnparam[0]; - auto ang = actor->spr.angle; + auto ang = actor->spr.Angles.Yaw; actor->vel.Zero(); for (int i = 0; i < 2; i++) { double t1 = RandomD(3.2) + 3.2; auto rndang = Random2A(0x71); - actor->spr.angle = (ang + rndang).Normalized360(); + actor->spr.Angles.Yaw = (ang + rndang).Normalized360(); auto spawned = actFireThing(actor, 0., 0., -0.5774, kThingNapalmBall, t1); spawned->SetOwner(actor->GetOwner()); seqSpawn(61, spawned, nNapalmClient); @@ -2942,7 +2942,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType) else { seqKill(actor); - DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->spr.pos, actor->spr.angle); + DBloodActor* pEffect = gFX.fxSpawnActor((FX_ID)52, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw); if (pEffect != nullptr) { pEffect->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING; @@ -3835,7 +3835,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) if (missileActor->hasX()) { actPostSprite(missileActor, kStatDecoration); - if (missileActor->spr.angle == DAngle180) sfxPlay3DSound(missileActor, 307, -1, 0); + if (missileActor->spr.Angles.Yaw == DAngle180) sfxPlay3DSound(missileActor, 307, -1, 0); missileActor->spr.type = kSpriteDecoration; seqSpawn(9, missileActor, -1); } @@ -3854,7 +3854,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) if (pWallHit) { auto pFX = gFX.fxSpawnActor(FX_52, missileActor->sector(), missileActor->spr.pos); - if (pFX) pFX->spr.angle = (pWallHit->delta().Angle() + DAngle90).Normalized360(); + if (pFX) pFX->spr.Angles.Yaw = (pWallHit->delta().Angle() + DAngle90).Normalized360(); } break; } @@ -3947,7 +3947,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) missileActor->spr.picnum = 2123; missileActor->SetTarget(actorHit); missileActor->xspr.TargetPos.Z = (missileActor->spr.pos.Z - actorHit->spr.pos.Z); - missileActor->xspr.goalAng = (missileActor->spr.pos.XY() - actorHit->spr.pos.XY()).Angle() - actorHit->spr.angle; + missileActor->xspr.goalAng = (missileActor->spr.pos.XY() - actorHit->spr.pos.XY()).Angle() - actorHit->spr.Angles.Yaw; missileActor->xspr.state = 1; actPostSprite(missileActor, kStatFlare); missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -4074,8 +4074,8 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) static void actKickObject(DBloodActor* kicker, DBloodActor* kicked) { double nSpeed = max(kicker->vel.XY().Length() * 2, FixedToFloat(0xaaaaa)); - kicked->vel.X = nSpeed * (kicker->spr.angle + Random2A(85)).Cos(); - kicked->vel.Y = nSpeed * (kicker->spr.angle + Random2A(85)).Sin(); + kicked->vel.X = nSpeed * (kicker->spr.Angles.Yaw + Random2A(85)).Cos(); + kicked->vel.Y = nSpeed * (kicker->spr.Angles.Yaw + Random2A(85)).Sin(); kicked->vel.Z = nSpeed * -0.5; kicked->spr.flags = 7; } @@ -4677,7 +4677,7 @@ static Collision MoveThing(DBloodActor* actor) } } if (actor->vel.X != 0 || actor->vel.Y != 0) - actor->spr.angle = actor->vel.Angle(); + actor->spr.Angles.Yaw = actor->vel.Angle(); return lhit; } @@ -5891,7 +5891,7 @@ static void actCheckTraps() { auto pos = actor->spr.pos; double t = actor->xspr.data1 * (128. / 120.); - auto vec = actor->spr.angle.ToVector() * t; + auto vec = actor->spr.Angles.Yaw.ToVector() * t; for (int i = 0; i < 2; i++) { auto pFX = gFX.fxSpawnActor(FX_32, actor->sector(), pos); @@ -5903,7 +5903,7 @@ static void actCheckTraps() } pos += vec / 2; } - actFireVector(actor, 0., 0., DVector3(actor->spr.angle.ToVector(), Random2F(0x8888) * 4), kVectorTchernobogBurn, actor->xspr.data1 << 5); + actFireVector(actor, 0., 0., DVector3(actor->spr.Angles.Yaw.ToVector(), Random2F(0x8888) * 4), kVectorTchernobogBurn, actor->xspr.data1 << 5); } break; } @@ -6081,7 +6081,7 @@ void actCheckFlares() if (target->hasX() && target->xspr.health > 0) { DVector3 pos = target->spr.pos; - pos.XY() += (actor->xspr.goalAng + target->spr.angle).ToVector() * target->clipdist * 0.5; + pos.XY() += (actor->xspr.goalAng + target->spr.Angles.Yaw).ToVector() * target->clipdist * 0.5; pos.Z += actor->xspr.TargetPos.Z; SetActor(actor, pos); actor->vel = target->vel; @@ -6169,7 +6169,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist) { auto spawned = actSpawnSprite(source, kStatDude); if (!spawned) return nullptr; - DAngle angle = source->spr.angle; + DAngle angle = source->spr.Angles.Yaw; int nDude = nType - kDudeBase; auto pos = source->spr.pos; @@ -6181,7 +6181,7 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist) spawned->spr.type = nType; if (!VanillaMode()) spawned->spr.inittype = nType; - spawned->spr.angle = angle; + spawned->spr.Angles.Yaw = angle; SetActor(spawned, pos); spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1; @@ -6329,16 +6329,16 @@ DBloodActor* actFireThing(DBloodActor* actor, double xyoff, double zoff, double { assert(thingType >= kThingBase && thingType < kThingMax); - DVector3 vect = actor->spr.pos.plusZ(zoff) + (actor->spr.angle + DAngle90).ToVector() * xyoff + actor->spr.angle.ToVector() * actor->clipdist; + DVector3 vect = actor->spr.pos.plusZ(zoff) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * xyoff + actor->spr.Angles.Yaw.ToVector() * actor->clipdist; if (HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, actor->clipdist * 0.25) != -1) { - vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * actor->clipdist * 2; + vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * actor->clipdist * 2; } auto fired = actSpawnThing(actor->sector(), vect, thingType); fired->SetOwner(actor); - fired->spr.angle = actor->spr.angle; - fired->vel = DVector3(fired->spr.angle.ToVector() * nSpeed, nSpeed * zvel * 4) + actor->vel * 0.5; + fired->spr.Angles.Yaw = actor->spr.Angles.Yaw; + fired->vel = DVector3(fired->spr.Angles.Yaw.ToVector() * nSpeed, nSpeed * zvel * 4) + actor->vel * 0.5; return fired; } @@ -6437,10 +6437,10 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect bool impact = false; const MissileType* pMissileInfo = &missileInfo[nType - kMissileBase]; - auto vect = actor->spr.pos.plusZ(zoff) + (actor->spr.angle + DAngle90).ToVector() * xyoff; + auto vect = actor->spr.pos.plusZ(zoff) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * xyoff; double clipdist = pMissileInfo->fClipDist() + actor->clipdist; - vect += actor->spr.angle.ToVector() * clipdist; + vect += actor->spr.Angles.Yaw.ToVector() * clipdist; int hit = HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, clipdist * 4); if (hit != -1) @@ -6448,11 +6448,11 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect if (hit == 3 || hit == 0) { impact = true; - vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * 1; + vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * 1; } else { - vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * pMissileInfo->fClipDist() * 2; + vect.XY() = gHitInfo.hitpos.XY() - actor->spr.Angles.Yaw.ToVector() * pMissileInfo->fClipDist() * 2; } } auto spawned = actSpawnSprite(actor->sector(), vect, 5, 1); @@ -6466,7 +6466,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect spawned->spr.scale = DVector2(pMissileInfo->xrepeat * REPEAT_SCALE, pMissileInfo->yrepeat * REPEAT_SCALE); spawned->spr.picnum = pMissileInfo->picnum; - spawned->spr.angle = actor->spr.angle += mapangle(pMissileInfo->angleOfs); + spawned->spr.Angles.Yaw = actor->spr.Angles.Yaw += mapangle(pMissileInfo->angleOfs); spawned->vel = dv * pMissileInfo->fVelocity(); spawned->SetOwner(actor); spawned->spr.cstat |= CSTAT_SPRITE_BLOCK; @@ -6663,7 +6663,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nnSurf].fx1, pSector, ppos); if (pFX) { - pFX->spr.angle = pWall->normalAngle(); + pFX->spr.Angles.Yaw = pWall->normalAngle(); pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; pFX->spr.cstat2 |= CSTAT2_SPRITE_DECAL; } @@ -6760,7 +6760,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 if (pFX) { pFX->vel.Z = FixedToFloat(0x2222); - pFX->spr.angle = pWall->normalAngle(); + pFX->spr.Angles.Yaw = pWall->normalAngle(); pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; pFX->spr.cstat2 |= CSTAT2_SPRITE_DECAL; } diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 5a7b0d44b..e0a05a99c 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -249,38 +249,38 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double nRan void aiChooseDirection(DBloodActor* actor, DAngle direction) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); - DAngle vc = deltaangle(actor->spr.angle, direction); + DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction); auto almost60deg = DAngle::fromBuild(341); // 60° does not work correctly - this is a little bit less, actually. DAngle v8 = vc.Sgn() == -1 ? -almost60deg : almost60deg; - double range = actor->vel.XY().dot(actor->spr.angle.ToVector()) * 120; + double range = actor->vel.XY().dot(actor->spr.Angles.Yaw.ToVector()) * 120; - if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range)) - actor->xspr.goalAng = actor->spr.angle + vc; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle + vc / 2; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle - vc / 2; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range)) - actor->xspr.goalAng = actor->spr.angle + v8; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle, range)) - actor->xspr.goalAng = actor->spr.angle; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range)) - actor->xspr.goalAng = actor->spr.angle - v8; + if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + v8; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - v8; //else if (actor->spr.flags&2) //actor->xspr.goalAng = actor->spr.angle+341; else // Weird.. - actor->xspr.goalAng = actor->spr.angle + almost60deg; + actor->xspr.goalAng = actor->spr.Angles.Yaw + almost60deg; if (Chance(0x8000)) actor->xspr.dodgeDir = 1; else actor->xspr.dodgeDir = -1; actor->xspr.goalAng = actor->xspr.goalAng.Normalized360(); - if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) { actor->xspr.dodgeDir = -actor->xspr.dodgeDir; - if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) actor->xspr.dodgeDir = 0; } } @@ -295,12 +295,12 @@ void aiMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > DAngle60) return; - actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed(); + actor->vel.XY() += actor->spr.Angles.Yaw.ToVector() * pDudeInfo->FrontSpeed(); } //--------------------------------------------------------------------------- @@ -313,9 +313,9 @@ void aiMoveTurn(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); } //--------------------------------------------------------------------------- @@ -328,9 +328,9 @@ void aiMoveDodge(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir) { AdjustVelocity(actor, ADJUSTER{ @@ -1505,7 +1505,7 @@ void aiThinkTarget(DBloodActor* actor) if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { aiSetTarget(actor, pPlayer->actor); @@ -1549,7 +1549,7 @@ void aiLookForTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { aiSetTarget(actor, pPlayer->actor); diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index 56e06d678..86f2415a8 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -72,7 +72,7 @@ void batBiteSeqCallback(int, DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (pDudeInfoT->eyeHeight * pTarget->spr.scale.Y); - actFireVector(actor, 0., 0., DVector3(actor->spr.angle.ToVector() * 64, height2 - height), kVectorBatBite); + actFireVector(actor, 0., 0., DVector3(actor->spr.Angles.Yaw.ToVector() * 64, height2 - height), kVectorBatBite); } static void batThinkTarget(DBloodActor* actor) @@ -107,7 +107,7 @@ static void batThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { aiSetTarget(actor, pPlayer->actor); @@ -139,7 +139,7 @@ static void batThinkGoto(DBloodActor* actor) auto nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &batSearch); batThinkTarget(actor); } @@ -165,7 +165,7 @@ static void batThinkPonder(DBloodActor* actor) double nDist = dvec.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle()); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (getDudeInfo(pTarget->spr.type)->eyeHeight * pTarget->spr.scale.Y); double top, bottom; @@ -200,9 +200,9 @@ static void batMoveDodgeUp(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ if (actor->xspr.dodgeDir > 0) t2 += pDudeInfo->sideSpeed; @@ -217,9 +217,9 @@ static void batMoveDodgeDown(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) return; AdjustVelocity(actor, ADJUSTER{ @@ -259,7 +259,7 @@ static void batThinkChase(DBloodActor* actor) double nDist = dvec.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvec.Angle()); double height = pDudeInfo->eyeHeight * actor->spr.scale.Y; // Should be dudeInfo[pTarget->spr.type-kDudeBase] double height2 = pDudeInfo->eyeHeight * pTarget->spr.scale.Y; @@ -298,14 +298,14 @@ static void batMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X; double nDist = dvec.Length(); if ((unsigned int)Random(64) < 32 && nDist <= 0x20) @@ -323,9 +323,9 @@ static void batMoveSwoop(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -347,13 +347,13 @@ static void batMoveFly(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X; diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index c80d15a9f..94f23183e 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -67,7 +67,7 @@ void SlashSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); DVector3 dv; - dv.XY() = actor->spr.angle.ToVector(); + dv.XY() = actor->spr.Angles.Yaw.ToVector(); // Correct ? dv.Z = (actor->spr.pos.Z - target->spr.pos.Z) / 64; @@ -90,7 +90,7 @@ void StompSeqCallback(int, DBloodActor* actor) const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic auto sectorMap = GetClosestSpriteSectors(pSector, actor->spr.pos.XY(), nDist, nullptr, newSectCheckMethod); - int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0); + int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), CLIPMASK1, 0); DBloodActor* actorh = nullptr; actHitcodeToData(hit, &gHitInfo, &actorh); @@ -179,7 +179,7 @@ static void beastThinkGoto(DBloodActor* actor) auto nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { if (pXSector && pXSector->Underwater) aiNewState(actor, &beastSwimSearch); @@ -232,7 +232,7 @@ static void beastThinkChase(DBloodActor* actor) double nDist = dv.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, dv.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dv.Angle()); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -328,7 +328,7 @@ static void beastThinkSwimGoto(DBloodActor* actor) auto nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &beastSwimSearch); aiThinkTarget(actor); } @@ -363,7 +363,7 @@ static void beastThinkSwimChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -391,30 +391,30 @@ static void beastMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > DAngle60) return; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if (nDist <= 0x40 && Random(64) < 32) return; - actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed(); + actor->vel.XY() += actor->spr.Angles.Yaw.ToVector() * pDudeInfo->FrontSpeed(); } static void sub_628A0(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if (Random(64) < 32 && nDist <= 0x40) @@ -434,9 +434,9 @@ static void sub_62AE0(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) @@ -464,14 +464,14 @@ static void sub_62D7C(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 3e234ffdd..05bd6b720 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -82,7 +82,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor) DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y); - DVector3 vect(actor->spr.angle.ToVector() * 1024, height2 - height); + DVector3 vect(actor->spr.Angles.Yaw.ToVector() * 1024, height2 - height); actFireVector(actor, 0., 0., vect, kVectorBoneelBite); } @@ -118,7 +118,7 @@ static void eelThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; @@ -152,7 +152,7 @@ static void eelThinkGoto(DBloodActor* actor) auto nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &eelSearch); eelThinkTarget(actor); } @@ -180,7 +180,7 @@ static void eelThinkPonder(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (getDudeInfo(target->spr.type)->eyeHeight * target->spr.scale.Y); double top, bottom; @@ -215,9 +215,9 @@ static void eelMoveDodgeUp(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ if (actor->xspr.dodgeDir > 0) t2 += FixedToFloat(pDudeInfo->sideSpeed); @@ -232,9 +232,9 @@ static void eelMoveDodgeDown(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) return; AdjustVelocity(actor, ADJUSTER{ @@ -275,7 +275,7 @@ static void eelThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double top, bottom; double top2, bottom2; @@ -308,14 +308,14 @@ static void eelMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2); if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if (nDist <= 57.5625) @@ -333,9 +333,9 @@ static void eelMoveSwoop(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2); if (abs(nAng) > DAngle60) return; @@ -354,9 +354,9 @@ static void eelMoveAscend(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2); if (abs(nAng) > DAngle60) return; diff --git a/source/games/blood/src/aiburn.cpp b/source/games/blood/src/aiburn.cpp index 39c75b5bc..8c8348c47 100644 --- a/source/games/blood/src/aiburn.cpp +++ b/source/games/blood/src/aiburn.cpp @@ -88,7 +88,7 @@ static void burnThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { switch (actor->spr.type) { @@ -194,7 +194,7 @@ static void burnThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index 8210b0ec2..4f883b94d 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -59,7 +59,7 @@ AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, & void SeqAttackCallback(int, DBloodActor* actor) { - DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random2F(1500, 4); vect.Y += Random2F(1500, 4); vect.Z += Random2F(1500, 8); @@ -97,7 +97,7 @@ static void calebThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { if (pXSector && pXSector->Underwater) aiNewState(actor, &tinycalebSwimSearch); @@ -151,7 +151,7 @@ static void calebThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -216,7 +216,7 @@ static void calebThinkSwimGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &tinycalebSwimSearch); aiThinkTarget(actor); } @@ -250,7 +250,7 @@ static void calebThinkSwimChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) @@ -276,14 +276,14 @@ static void sub_65D04(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if (Random(64) < 32 && nDist <= 0x40) @@ -304,9 +304,9 @@ static void sub_65F44(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -332,13 +332,13 @@ static void sub_661E0(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 91c50af01..0fd8d8f73 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -68,7 +68,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor) auto target = actor->GetTarget(); DVector3 vec; - vec.XY() = actor->spr.angle.ToVector() * 64; + vec.XY() = actor->spr.Angles.Yaw.ToVector() * 64; vec.Z = target->spr.pos.Z - actor->spr.pos.Z; actFireVector(actor, Cerberus_XYOff, -Cerberus_ZOff, vec, kVectorCerberusHack); actFireVector(actor, -Cerberus_XYOff, 0, vec, kVectorCerberusHack); @@ -84,7 +84,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor) DVector3 pos(actor->spr.pos.XY(), height); //auto pos = actor->spr.pos.plusZ(height); // what it probably should be - DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); double nClosest = 0x7fffffff; BloodStatIterator it(kStatDude); while (auto actor2 = it.Next()) @@ -99,7 +99,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; double top, bottom; @@ -110,7 +110,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z; @@ -145,7 +145,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor) DVector3 pos(actor->spr.pos.XY(), height); //auto pos = actor->spr.pos.plusZ(height); // what it probably should be - DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); DVector3 Aim2(Aim.XY(), 0); double nClosest = 0x7fffffff; @@ -164,7 +164,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; @@ -177,7 +177,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { DUDEINFO* pDudeInfo2 = getDudeInfo(actor2->spr.type); @@ -249,7 +249,7 @@ static void cerberusThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; @@ -280,7 +280,7 @@ static void cerberusThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { switch (actor->spr.type) { case kDudeCerberusTwoHead: @@ -351,7 +351,7 @@ static void cerberusThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 96e7d0777..a18fd7f55 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -75,7 +75,7 @@ AISTATE cultistSwimRecoil = { kAiStateRecoil, 5, -1, 0, NULL, NULL, NULL, &culti void TommySeqCallback(int, DBloodActor* actor) { - DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14); @@ -87,7 +87,7 @@ void TeslaSeqCallback(int, DBloodActor* actor) { if (Chance(gCultTeslaFireChance[gGameOptions.nDifficulty])) { - DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14); @@ -98,7 +98,7 @@ void TeslaSeqCallback(int, DBloodActor* actor) void ShotSeqCallback(int, DBloodActor* actor) { - DVector3 vect(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 vect(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); vect.X += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Y += Random3F((5 - gGameOptions.nDifficulty) * 1000, 14); vect.Z += Random3F((5 - gGameOptions.nDifficulty) * 500, 14); @@ -188,7 +188,7 @@ static void cultThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 320 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { switch (actor->xspr.medium) { @@ -263,7 +263,7 @@ static void cultThinkChase(DBloodActor* actor) } if (nDist > 0 && nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 828ff6ea8..c91540c01 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -83,7 +83,7 @@ void SlashFSeqCallback(int, DBloodActor* actor) DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y); - DVector3 vec(actor->spr.angle.ToVector() * 64, height - height2); + DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, height - height2); actFireVector(actor, 0, 0, vec, kVectorGargSlash); double r1 = RandomF(50, 8); @@ -107,7 +107,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight); DVector3 pos(actor->spr.pos.XY(), height); - DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); double nClosest = 0x7fffffff; BloodStatIterator it(kStatDude); @@ -124,7 +124,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; @@ -137,7 +137,7 @@ void BlastSSeqCallback(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z; @@ -205,7 +205,7 @@ static void gargThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; @@ -242,7 +242,7 @@ static void gargThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &gargoyleFSearch); aiThinkTarget(actor); } @@ -254,9 +254,9 @@ static void gargMoveDodgeUp(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ if (actor->xspr.dodgeDir > 0) t2 += FixedToFloat(pDudeInfo->sideSpeed); @@ -274,9 +274,9 @@ static void gargMoveDodgeDown(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) return; AdjustVelocity(actor, ADJUSTER{ @@ -320,7 +320,7 @@ static void gargThinkChase(DBloodActor* actor) double nDist = dxy.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, dxyAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dxyAngle); double height = pDudeInfo->eyeHeight * actor->spr.scale.Y; // Should be dudeInfo[target->spr.type-kDudeBase] double height2 = pDudeInfo->eyeHeight * target->spr.scale.Y; @@ -489,14 +489,14 @@ static void gargMoveForward(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if ((unsigned int)Random(64) < 32 && nDist <= 0x40) @@ -517,9 +517,9 @@ static void gargMoveSlow(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -552,9 +552,9 @@ static void gargMoveSwoop(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -587,13 +587,13 @@ static void gargMoveFly(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index ea7c33a77..dbfbc3e26 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -68,7 +68,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor) DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y); - DVector3 dv(actor->spr.angle.ToVector() * 64, height - height2); + DVector3 dv(actor->spr.Angles.Yaw.ToVector() * 64, height - height2); sfxPlay3DSound(actor, 1406, 0, 0); actFireVector(actor, 0, 0, dv, kVectorGhost); @@ -94,7 +94,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor) double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight); DVector3 pos(actor->spr.pos.XY(), height); - DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); double nClosest = 0x7fffffff; BloodStatIterator it(kStatDude); @@ -111,7 +111,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; @@ -124,7 +124,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z; @@ -186,7 +186,7 @@ static void ghostThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle()); if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; @@ -222,7 +222,7 @@ static void ghostThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &ghostSearch); aiThinkTarget(actor); } @@ -234,9 +234,9 @@ static void ghostMoveDodgeUp(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ if (actor->xspr.dodgeDir > 0) t2 += FixedToFloat(pDudeInfo->sideSpeed); @@ -254,9 +254,9 @@ static void ghostMoveDodgeDown(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) return; AdjustVelocity(actor, ADJUSTER{ @@ -299,7 +299,7 @@ static void ghostThinkChase(DBloodActor* actor) double nDist = dxy.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, dxyAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dxyAngle); double height = pDudeInfo->eyeHeight * actor->spr.scale.Y; // Should be dudeInfo[target->spr.type-kDudeBase] double height2 = pDudeInfo->eyeHeight * target->spr.scale.Y; @@ -385,14 +385,14 @@ static void ghostMoveForward(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if ((unsigned int)Random(64) < 32 && nDist <= 0x40) @@ -412,9 +412,9 @@ static void ghostMoveSlow(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -443,9 +443,9 @@ static void ghostMoveSwoop(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { @@ -473,13 +473,13 @@ static void ghostMoveFly(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index 280088a80..2d7f6ad10 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -61,7 +61,7 @@ void GillBiteSeqCallback(int, DBloodActor* actor) { if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - DVector3 vec(actor->spr.angle.ToVector() * 64, actor->spr.pos.Z - target->spr.pos.Z); + DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, actor->spr.pos.Z - target->spr.pos.Z); vec.X += Random3F(2000, 8); vec.Y += Random3F(2000, 8); actFireVector(actor, 0, 0, vec, kVectorGillBite); @@ -87,7 +87,7 @@ static void gillThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { if (pXSector && pXSector->Underwater) aiNewState(actor, &gillBeastSwimSearch); @@ -136,7 +136,7 @@ static void gillThinkChase(DBloodActor* actor) double nDist = dv.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -200,7 +200,7 @@ static void gillThinkSwimGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &gillBeastSwimSearch); aiThinkTarget(actor); } @@ -234,7 +234,7 @@ static void gillThinkSwimChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double top, bottom; GetActorExtents(actor, &top, &bottom); @@ -264,14 +264,14 @@ static void sub_6CB00(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2); if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if (Random(64) < 32 && nDist <= 0x40) @@ -292,9 +292,9 @@ static void sub_6CD74(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2); if (abs(nAng) > DAngle60) { @@ -319,13 +319,13 @@ static void sub_6D03C(DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = FixedToFloat((pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2); if (abs(nAng) > DAngle60) { - actor->spr.angle += DAngle90; + actor->spr.Angles.Yaw += DAngle90; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); diff --git a/source/games/blood/src/aihand.cpp b/source/games/blood/src/aihand.cpp index 58ac8529f..2dda123bd 100644 --- a/source/games/blood/src/aihand.cpp +++ b/source/games/blood/src/aihand.cpp @@ -70,7 +70,7 @@ static void handThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &handSearch); aiThinkTarget(actor); } @@ -103,7 +103,7 @@ static void handThinkChase(DBloodActor* actor) } if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aihound.cpp b/source/games/blood/src/aihound.cpp index 71bb051f3..0cd8c076f 100644 --- a/source/games/blood/src/aihound.cpp +++ b/source/games/blood/src/aihound.cpp @@ -51,14 +51,14 @@ void houndBiteSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - DVector3 vec(actor->spr.angle.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z); + DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z); if (target->IsPlayerActor() || gModernMap) // allow to hit non-player targets actFireVector(actor, 0, 0, vec, kVectorHoundBite); } void houndBurnSeqCallback(int, DBloodActor* actor) { - actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileFlameHound); + actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileFlameHound); } static void houndThinkSearch(DBloodActor* actor) @@ -79,7 +79,7 @@ static void houndThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &houndSearch); aiThinkTarget(actor); } @@ -115,7 +115,7 @@ static void houndThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aiinnoc.cpp b/source/games/blood/src/aiinnoc.cpp index 82cbf7cca..ab7326ac0 100644 --- a/source/games/blood/src/aiinnoc.cpp +++ b/source/games/blood/src/aiinnoc.cpp @@ -54,7 +54,7 @@ static void innocThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &innocentSearch); aiThinkTarget(actor); } @@ -88,7 +88,7 @@ static void innocThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index 84d27c4bb..239500a9d 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -140,7 +140,7 @@ static void aiPodMove(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) { switch (actor->spr.type) { case kDudePodGreen: @@ -198,7 +198,7 @@ static void aiPodChase(DBloodActor* actor) } if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index bd570b4ee..bd296888a 100644 --- a/source/games/blood/src/airat.cpp +++ b/source/games/blood/src/airat.cpp @@ -48,7 +48,7 @@ void ratBiteSeqCallback(int, DBloodActor* actor) auto target = actor->GetTarget(); if (target->IsPlayerActor()) { - DVector3 vec(actor->spr.angle.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z); + DVector3 vec(actor->spr.Angles.Yaw.ToVector() * 64, target->spr.pos.Z - actor->spr.pos.Z); actFireVector(actor, 0, 0, vec, kVectorRatBite); } } @@ -67,7 +67,7 @@ static void ratThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &ratSearch); aiThinkTarget(actor); } @@ -100,7 +100,7 @@ static void ratThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index ce106cfc6..a8d23a543 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -59,7 +59,7 @@ static void spidBlindEffect(DBloodActor* actor, int nBlind, int max) void SpidBiteSeqCallback(int, DBloodActor* actor) { - DVector3 vec(actor->spr.angle.ToVector(), 0); + DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0); vec.X += Random2F(2000, 14); vec.Y += Random2F(2000, 14); @@ -107,7 +107,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) void SpidJumpSeqCallback(int, DBloodActor* actor) { - DVector3 vec(actor->spr.angle.ToVector(), 0); + DVector3 vec(actor->spr.Angles.Yaw.ToVector(), 0); vec.X += Random2F(200, 14); vec.Y += Random2F(200, 14); @@ -143,7 +143,7 @@ void SpidBirthSeqCallback(int, DBloodActor* actor) DBloodActor* spawned = nullptr; if (target->IsPlayerActor() && pDudeExtraE->birthCounter < 10) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); if (nDist < 0x1a0 && nDist > 0x140 && nDeltaAngle < pDudeInfo->Periphery()) spawned = actSpawnDude(actor, kDudeSpiderRed, actor->clipdist * 0.25); else if (nDist < 0x140 && nDist > 0xc0 && nDeltaAngle < pDudeInfo->Periphery()) @@ -175,7 +175,7 @@ static void spidThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &spidSearch); aiThinkTarget(actor); } @@ -208,7 +208,7 @@ static void spidThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 3f0701275..ad1b3290a 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -65,7 +65,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; DVector3 pos(actor->spr.pos.XY(), height); - DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); double nClosest = 0x7fffffff; BloodStatIterator it(kStatDude); @@ -82,7 +82,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; @@ -95,7 +95,7 @@ void tchernobogBurnSeqCallback(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z; @@ -123,7 +123,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor) double height = actor->spr.scale.Y * pDudeInfo->eyeHeight * 0.25; DVector3 pos(actor->spr.pos.XY(), height); - DVector3 Aim(actor->spr.angle.ToVector(), -actor->dudeSlope); + DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), -actor->dudeSlope); DVector3 Aim2(Aim.XY(), 0); double nClosest = 0x7fffffff; @@ -138,7 +138,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor) pos += actor2->vel * nDist * (65536. / 0x1aaaaa); DVector3 tvec = pos; - tvec.XY() += actor->spr.angle.ToVector() * nDist; + tvec.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; tvec.Z += actor->dudeSlope * nDist; double tsr = nDist * 9.23828125; @@ -151,7 +151,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor) if (nDist2 < nClosest) { DAngle nAngle = (pos2.XY() - pos.XY()).Angle(); - DAngle nDeltaAngle = absangle(nAngle, actor->spr.angle); + DAngle nDeltaAngle = absangle(nAngle, actor->spr.Angles.Yaw); if (nDeltaAngle <= DAngle45) { double tz1 = actor2->spr.pos.Z - actor->spr.pos.Z; @@ -212,7 +212,7 @@ static void sub_725A4(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery()) { pDudeExtraE->thinkTime = 0; @@ -243,7 +243,7 @@ static void sub_72850(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &tchernobogSearch); aiThinkTarget(actor); } @@ -280,7 +280,7 @@ static void tchernobogThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index e165f6051..676f074ab 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -140,7 +140,7 @@ static bool genDudeAdjustSlope(DBloodActor* actor, double dist, int weaponType, for (int i = -8191; i < 8192; i += by) { double ii = i / 16384.; - HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), ii), clipMask, dist * 16); // this originally passed a badly scaled 'dist'. + HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), ii), clipMask, dist * 16); // this originally passed a badly scaled 'dist'. if (!fStart && actor->GetTarget() == gHitInfo.actor()) fStart = ii; else if (fStart && actor->GetTarget() != gHitInfo.actor()) { @@ -202,7 +202,7 @@ void punchCallback(int, DBloodActor* actor) if (!playGenDudeSound(actor, kGenDudeSndAttackMelee)) sfxPlay3DSound(actor, 530, 1, 0); - actFireVector(actor, 0, 0, DVector3(actor->spr.angle.ToVector() * 64, nZOffset1 - nZOffset2), kVectorGenDudePunch); + actFireVector(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector() * 64, nZOffset1 - nZOffset2), kVectorGenDudePunch); } } @@ -226,7 +226,7 @@ void genDudeAttack1(int, DBloodActor* actor) if (pExtra->weaponType == kGenDudeWeaponHitscan) { - dv = DVector3(actor->spr.angle.ToVector(), actor->dudeSlope); + dv = DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); // dispersal modifiers here in case if non-melee enemy if (!dudeIsMelee(actor)) { @@ -265,7 +265,7 @@ void genDudeAttack1(int, DBloodActor* actor) } else if (pExtra->weaponType == kGenDudeWeaponMissile) { - dv = DVector3(actor->spr.angle.ToVector(), actor->dudeSlope); + dv = DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope); // dispersal modifiers here dv.X += Random3F(dispersion, 14); @@ -427,7 +427,7 @@ static void unicultThinkGoto(DBloodActor* actor) aiChooseDirection(actor, nAngle); // if reached target, change to search mode - if (nDist < 320 && absangle(actor->spr.angle, nAngle) < getDudeInfo(actor->spr.type)->Periphery()) + if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < getDudeInfo(actor->spr.type)->Periphery()) { if (spriteIsUnderwater(actor, false)) aiGenDudeNewState(actor, &genDudeSearchW); else aiGenDudeNewState(actor, &genDudeSearchL); @@ -515,7 +515,7 @@ static void unicultThinkChase(DBloodActor* actor) } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - DAngle losAngle = absangle(actor->spr.angle, nAngle); + DAngle losAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (dist > pDudeInfo->SeeDist() || !cansee(target->spr.pos, target->sector(), @@ -750,9 +750,9 @@ static void unicultThinkChase(DBloodActor* actor) double targetDist = -1; int hit = -1; if (weaponType == kGenDudeWeaponHitscan) - hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), CLIPMASK1, dist); + hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), CLIPMASK1, dist); else if (weaponType == kGenDudeWeaponMissile) - hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), CLIPMASK0, dist); + hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), CLIPMASK0, dist); if (hit >= 0) { @@ -865,7 +865,7 @@ static void unicultThinkChase(DBloodActor* actor) else if (weaponType == kGenDudeWeaponHitscan && hscn) { if (genDudeAdjustSlope(actor, dist, weaponType)) break; - VectorScan(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), dist, 1); + VectorScan(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), dist, 1); if (actor == gHitInfo.actor()) break; bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType); @@ -926,7 +926,7 @@ static void unicultThinkChase(DBloodActor* actor) if (hit == 4 && weaponType == kGenDudeWeaponHitscan && hscn) { bool masked = (pHWall->cstat & CSTAT_WALL_MASKED); - if (masked) VectorScan(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), actor->dudeSlope), dist, 1); + if (masked) VectorScan(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope), dist, 1); if ((actor != gHitInfo.actor()) && (pHWall->type != kWallGib || !masked || pXHWall == NULL || !pXHWall->triggerVector || pXHWall->locked)) { @@ -1120,14 +1120,14 @@ void aiGenDudeMoveForward(DBloodActor* actor) if (pExtra->canFly) { - auto nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); + auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); double nAccel = pDudeInfo->FrontSpeed() * 4; if (abs(nAng) > DAngle60) return; if (actor->GetTarget() == nullptr) - actor->spr.angle += DAngle45; + actor->spr.Angles.Yaw += DAngle45; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); double nDist = dvec.Length(); if ((unsigned int)Random(64) < 32 && nDist <= 0x40) @@ -1144,15 +1144,15 @@ void aiGenDudeMoveForward(DBloodActor* actor) { DAngle maxTurn = mapangle(pDudeInfo->angSpeed * 4 >> 4); - DAngle dang = actor->xspr.goalAng - actor->spr.angle; - actor->spr.angle += clamp(dang, -maxTurn, maxTurn); + DAngle dang = actor->xspr.goalAng - actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw += clamp(dang, -maxTurn, maxTurn); // don't move forward if trying to turn around if (abs(dang) > DAngle180 / 3) return; double frontSpeed = FixedToFloat(actor->genDudeExtra.moveSpeed); - actor->vel += actor->spr.angle.ToVector() * frontSpeed; + actor->vel += actor->spr.Angles.Yaw.ToVector() * frontSpeed; } } @@ -1172,32 +1172,32 @@ void aiGenDudeChooseDirection(DBloodActor* actor, DAngle direction, const DVecto // TO-DO: Take in account if sprite is flip-x, so enemy select correct angle - DAngle vc = deltaangle(actor->spr.angle, direction); - double range = vel.dot(actor->spr.angle.ToVector()) * 120; + DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction); + double range = vel.dot(actor->spr.Angles.Yaw.ToVector()) * 120; DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3; - if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range)) - actor->xspr.goalAng = actor->spr.angle + vc; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle + vc / 2; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle - vc / 2; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range)) - actor->xspr.goalAng = actor->spr.angle + v8; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle, range)) - actor->xspr.goalAng = actor->spr.angle; - else if (CanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range)) - actor->xspr.goalAng = actor->spr.angle - v8; + if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + v8; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw; + else if (CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - v8; else - actor->xspr.goalAng = actor->spr.angle + DAngle180 / 3; + actor->xspr.goalAng = actor->spr.Angles.Yaw + DAngle180 / 3; actor->xspr.goalAng = actor->xspr.goalAng.Normalized360(); actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1; - if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) { actor->xspr.dodgeDir = -actor->xspr.dodgeDir; - if (!CanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!CanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) actor->xspr.dodgeDir = 0; } } @@ -1386,7 +1386,7 @@ void removeLeech(DBloodActor* actLeech, bool delSprite) { if (actLeech != nullptr) { - auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->spr.pos, actLeech->spr.angle); + auto effectactor = gFX.fxSpawnActor((FX_ID)52, actLeech->sector(), actLeech->spr.pos, actLeech->spr.Angles.Yaw); if (effectactor != nullptr) { effectactor->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING; @@ -1778,10 +1778,10 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event) { atpos.XY() += actTarget->vel.XY() * nDist * 0.0375; - auto angBak = actor->spr.angle; - actor->spr.angle = (atpos - actor->spr.pos.XY()).Angle(); + auto angBak = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = (atpos - actor->spr.pos.XY()).Angle(); DVector3 dv; - dv.XY() = actor->spr.angle.ToVector() * 64; + dv.XY() = actor->spr.Angles.Yaw.ToVector() * 64; double tz = actTarget->spr.pos.Z - (actTarget->spr.scale.Y * pDudeInfo->aimHeight); double dz = (tz - top - 1) / nDist * 4; int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0); @@ -1798,7 +1798,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event) evPostActor(actor, t2, kCallbackLeechStateTimer); actor->xspr.data3 = ClipLow(actor->xspr.data3 - 1, 0); } - actor->spr.angle = angBak; + actor->spr.Angles.Yaw = angBak; } } @@ -1858,11 +1858,11 @@ DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, double nDist) auto pos = actor->spr.pos; if (nDist > 0) { - pos.XY() += actor->spr.angle.ToVector() * nDist; + pos.XY() += actor->spr.Angles.Yaw.ToVector() * nDist; } spawned->spr.type = nType; - spawned->spr.angle = actor->spr.angle; + spawned->spr.Angles.Yaw = actor->spr.Angles.Yaw; SetActor(spawned, pos); spawned->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_BLOOD_BIT1; spawned->clipdist = dudeInfo[nType - kDudeBase].fClipdist(); diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index f678ae2c1..ac0f8ef46 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -94,7 +94,7 @@ static void zombaThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 51.3125 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 51.3125 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &zombieASearch); aiThinkTarget(actor); } @@ -133,7 +133,7 @@ static void zombaThinkChase(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -180,7 +180,7 @@ static void zombaThinkPonder(DBloodActor* actor) if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { @@ -222,7 +222,7 @@ static void myThinkTarget(DBloodActor* actor) double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (!cansee(ppos, pSector, actor->spr.pos.plusZ(-height), actor->sector())) continue; - DAngle nDeltaAngle = absangle(actor->spr.angle, dvect.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dvect.Angle()); if (nDist < pDudeInfo->SeeDist() && abs(nDeltaAngle) <= pDudeInfo->Periphery()) { aiSetTarget(actor, pPlayer->actor); @@ -265,7 +265,7 @@ static void entryAIdle(DBloodActor* actor) static void entryEStand(DBloodActor* actor) { sfxPlay3DSound(actor, 1100, -1, 0); - actor->spr.angle = (actor->xspr.TargetPos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (actor->xspr.TargetPos - actor->spr.pos).Angle(); } END_BLD_NS diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index b073c839a..f519c0075 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -55,7 +55,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor) double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25; DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); double height2 = pDudeInfoT->eyeHeight * target->spr.scale.Y * 0.25; - actFireVector(actor, 0, 0, DVector3(actor->spr.angle.ToVector() * 64, height - height2), kVectorCleaver); + actFireVector(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector() * 64, height - height2), kVectorCleaver); } void PukeSeqCallback(int, DBloodActor* actor) @@ -77,7 +77,7 @@ void PukeSeqCallback(int, DBloodActor* actor) void ThrowSeqCallback(int, DBloodActor* actor) { - actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileButcherKnife); + actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileButcherKnife); } static void zombfThinkSearch(DBloodActor* actor) @@ -94,7 +94,7 @@ static void zombfThinkGoto(DBloodActor* actor) DAngle nAngle = dvec.Angle(); double nDist = dvec.Length(); aiChooseDirection(actor, nAngle); - if (nDist < 32 && absangle(actor->spr.angle, nAngle) < pDudeInfo->Periphery()) + if (nDist < 32 && absangle(actor->spr.Angles.Yaw, nAngle) < pDudeInfo->Periphery()) aiNewState(actor, &zombieFSearch); aiThinkTarget(actor); } @@ -127,7 +127,7 @@ static void zombfThinkChase(DBloodActor* actor) double nDist = dv.Length(); if (nDist <= pDudeInfo->SeeDist()) { - DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, nAngle); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector())) { diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index f51e0ce91..6077bf2d4 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -69,7 +69,7 @@ tspritetype* viewInsertTSprite(tspriteArray& tsprites, sectortype* pSector, int { pos = parentTSprite->pos; pTSprite->ownerActor = parentTSprite->ownerActor; - pTSprite->angle = parentTSprite->angle; + pTSprite->Angles.Yaw = parentTSprite->Angles.Yaw; } pos.XY() += gCameraAng.ToVector() * 2; pTSprite->pos = pos; @@ -242,7 +242,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF } case kViewEffectTrail: { - auto nAng = pTSprite->angle; + auto nAng = pTSprite->Angles.Yaw; if (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { nAng += DAngle90; @@ -422,7 +422,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->pal = 2; pNSprite->scale = DVector2(1, 1); pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_YFLIP | CSTAT_SPRITE_TRANSLUCENT; - pNSprite->angle = pTSprite->angle; + pNSprite->Angles.Yaw = pTSprite->Angles.Yaw; pNSprite->ownerActor = pTSprite->ownerActor; break; } @@ -440,7 +440,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->pal = 2; pNSprite->scale = DVector2(nShade * REPEAT_SCALE, nShade * REPEAT_SCALE); pNSprite->cstat |= CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_TRANSLUCENT; - pNSprite->angle = pTSprite->angle; + pNSprite->Angles.Yaw = pTSprite->Angles.Yaw; pNSprite->ownerActor = pTSprite->ownerActor; break; } @@ -477,16 +477,16 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (cl_showweapon == 2 && r_voxels && nVoxel != -1) { auto gView = &gPlayer[gViewIndex]; - pNSprite->angle = gView->actor->spr.angle += DAngle90; // always face viewer + pNSprite->Angles.Yaw = gView->actor->spr.Angles.Yaw += DAngle90; // always face viewer pNSprite->cstat |= CSTAT_SPRITE_ALIGNMENT_SLAB; pNSprite->cstat &= ~CSTAT_SPRITE_YFLIP; pNSprite->picnum = nVoxel; if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player { - pNSprite->pos.XY() += gView->actor->spr.angle.ToVector() * 8; + pNSprite->pos.XY() += gView->actor->spr.Angles.Yaw.ToVector() * 8; } if ((pPlayer->curWeapon == kWeapLifeLeech) || (pPlayer->curWeapon == kWeapVoodooDoll)) // make lifeleech/voodoo doll always face viewer like sprite - pNSprite->angle += DAngle90; + pNSprite->Angles.Yaw += DAngle90; } break; } @@ -556,7 +556,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512)) { pTSprite->pos = owneractor->interpolatedpos(interpfrac); - pTSprite->angle = owneractor->interpolatedangle(interpfrac); + pTSprite->Angles.Yaw = owneractor->interpolatedangle(interpfrac); } int nAnim = 0; switch (picanm[nTile].extra & 7) { @@ -585,7 +585,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; break; } - nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle)); + nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw)); if (nAnim <= 4) { pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; @@ -604,7 +604,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; break; } - nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle)); + nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw)); break; } case 3: @@ -640,7 +640,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, pTSprite->picnum = voxelIndex[pTSprite->picnum]; if ((picanm[nTile].extra & 7) == 7) { - pTSprite->angle = myclock.Normalized360(); + pTSprite->Angles.Yaw = myclock.Normalized360(); } } } @@ -874,7 +874,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, auto pNTSprite = viewAddEffect(tsprites, nTSprite, kViewEffectShoot); if (pNTSprite) { POSTURE* pPosture = &thisPlayer->pPosture[thisPlayer->lifeMode][thisPlayer->posture]; - pNTSprite->pos.XY() += pTSprite->angle.ToVector() * pPosture->xOffset; + pNTSprite->pos.XY() += pTSprite->Angles.Yaw.ToVector() * pPosture->xOffset; pNTSprite->pos.Z = thisPlayer->actor->spr.pos.Z - pPosture->zOffset; } } @@ -948,7 +948,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, { case 1: { - nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle)); + nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw)); if (nAnim <= 4) { pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; @@ -962,7 +962,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, } case 2: { - nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->angle)); + nAnim = GetOctant(DVector2(cPos.XY() - pTSprite->pos).Rotated(DAngle22_5 - pTSprite->Angles.Yaw)); break; } } diff --git a/source/games/blood/src/bloodactor.h b/source/games/blood/src/bloodactor.h index 6bae0a595..01bfb2ee9 100644 --- a/source/games/blood/src/bloodactor.h +++ b/source/games/blood/src/bloodactor.h @@ -174,8 +174,8 @@ inline bool IsTargetTeammate(DBloodActor* pSource, DBloodActor* pTarget) template void AdjustVelocity(DBloodActor *actor, T adjuster) { - double nCos = actor->spr.angle.Cos(); - double nSin = actor->spr.angle.Sin(); + double nCos = actor->spr.Angles.Yaw.Cos(); + double nSin = actor->spr.Angles.Yaw.Sin(); double t1 = actor->vel.X * nCos + actor->vel.Y * nSin; double t2 = actor->vel.X * nSin - actor->vel.Y * nCos; adjuster(actor, t1, t2); diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 9080112b4..4e973738f 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -187,7 +187,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6 auto pFX = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos); if (pFX) { - pFX->spr.angle = nullAngle; + pFX->spr.Angles.Yaw = nullAngle; pFX->vel = actor->vel * (1./256); } evPostActor(actor, 6, kCallbackFXBloodSpurt); @@ -224,7 +224,7 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8 if (actor->vel.Z) { double nDist = (actor->spr.scale.X * tileWidth(actor->spr.picnum)) * (1. / 2); - DVector3 pos = actor->spr.pos + (actor->spr.angle - DAngle90).ToVector() * nDist; + DVector3 pos = actor->spr.pos + (actor->spr.Angles.Yaw - DAngle90).ToVector() * nDist; auto pFX = gFX.fxSpawnActor(FX_7, actor->sector(), pos); if (pFX) { @@ -343,7 +343,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10 for (int i = 0; i < (pPlayer->bubbleTime >> 6); i++) { double nDist = (actor->spr.scale.X * tileWidth(actor->spr.picnum)) * (1. / 2); - DVector2 pos = actor->spr.pos.XY() + actor->spr.angle.ToVector() * nDist; + DVector2 pos = actor->spr.pos.XY() + actor->spr.Angles.Yaw.ToVector() * nDist; double z = bottom - RandomD(bottom - top, 8); auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), DVector3(pos, z)); if (pFX) @@ -447,7 +447,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14 int nDist = Random(16); auto pos = nAngle.ToVector() * nDist * 4; gFX.fxSpawnActor(FX_48, actor->sector(), DVector3(pos, actor->spr.pos.Z)); - if (actor->spr.angle == DAngle180) + if (actor->spr.Angles.Yaw == DAngle180) { int nChannel = 28 + (actor->GetIndex() & 2); // this is a little stupid... sfxPlay3DSound(actor, 385, nChannel, 1); @@ -456,7 +456,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14 { auto pFX = gFX.fxSpawnActor(FX_36, actor->sector(), DVector3(pos, floorZ - 0.25)); if (pFX) - pFX->spr.angle = nAngle; + pFX->spr.Angles.Yaw = nAngle; } gFX.remove(actor); } @@ -611,7 +611,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18 pFX = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos); if (pFX) { - pFX->spr.angle = nullAngle; + pFX->spr.Angles.Yaw = nullAngle; pFX->vel = actor->vel * (1./256); } evPostActor(actor, 6, kCallbackFXPodBloodSpray); @@ -637,7 +637,7 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 int nDist = Random(16); auto pos = actor->spr.pos.XY() + nAngle.ToVector() * nDist * 4; - if (actor->spr.angle == DAngle180 && actor->spr.type == 53) + if (actor->spr.Angles.Yaw == DAngle180 && actor->spr.type == 53) { int nChannel = 28 + (actor->GetIndex() & 2); assert(nChannel < 32); @@ -649,13 +649,13 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 if (Chance(0x500) || actor->spr.type == kThingPodGreenBall) pFX = gFX.fxSpawnActor(FX_55, actor->sector(), DVector3(pos, floorZ - 0.25)); if (pFX) - pFX->spr.angle = nAngle; + pFX->spr.Angles.Yaw = nAngle; } else { pFX = gFX.fxSpawnActor(FX_32, actor->sector(), DVector3(pos, floorZ - 0.25)); if (pFX) - pFX->spr.angle = nAngle; + pFX->spr.Angles.Yaw = nAngle; } gFX.remove(actor); } @@ -693,7 +693,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ??? double top, bottom; GetActorExtents(actor, &top, &bottom); actor->spr.pos = actor2->spr.pos.plusZ(-(bottom - actor->spr.pos.Z)); - actor->spr.angle = actor2->spr.angle; + actor->spr.Angles.Yaw = actor2->spr.Angles.Yaw; ChangeActorSect(actor, actor2->sector()); sfxPlay3DSound(actor2, 201, -1, 0); actor->vel.Zero(); @@ -730,7 +730,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused evPostActor(actor, 0, kCallbackRemove); return; } - actor->spr.angle = (Owner->spr.pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (Owner->spr.pos - actor->spr.pos).Angle(); if (actor->hasX()) { if (actor->xspr.data1 == 0) diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index 802fbde19..1d8df2475 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -484,7 +484,7 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, sectortype** cur pSprite->picnum = LittleShort(load.picnum); int secno = LittleShort(load.sectnum); pSprite->statnum = LittleShort(load.statnum); - pSprite->angle = mapangle(LittleShort(load.ang)); + pSprite->Angles.Yaw = mapangle(LittleShort(load.ang)); pSprite->intowner = LittleShort(load.owner); pSprite->xint = LittleShort(load.index); pSprite->yint = LittleShort(load.yvel); diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index 531133b40..fdbed1e0d 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -276,7 +276,7 @@ void fxSpawnBlood(DBloodActor* actor, int) auto bloodactor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos); if (bloodactor) { - bloodactor->spr.angle = DAngle180; + bloodactor->spr.Angles.Yaw = DAngle180; bloodactor->vel.X = Random2F(0x6aaaa); bloodactor->vel.Y = Random2F(0x6aaaa); bloodactor->vel.Z = -Random2F(0x10aaaa) - FixedToFloat(100); @@ -306,7 +306,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int) spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos); if (spawnactor) { - spawnactor->spr.angle = DAngle180; + spawnactor->spr.Angles.Yaw = DAngle180; spawnactor->vel.X = Random2F(0x6aaaa); spawnactor->vel.Y = Random2F(0x6aaaa); spawnactor->vel.Z = -Random2F(0x10aaaa) - FixedToFloat(100); @@ -322,15 +322,15 @@ void fxSpawnPodStuff(DBloodActor* actor, int) void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist) { - DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.angle.ToVector() + (actor->spr.angle + DAngle90).ToVector() * dist, z); + DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.Angles.Yaw.ToVector() + (actor->spr.Angles.Yaw + DAngle90).ToVector() * dist, z); auto pBrass = gFX.fxSpawnActor((FX_ID)(FX_37 + Random(3)), actor->sector(), pos); if (pBrass) { if (!VanillaMode()) - pBrass->spr.angle = RandomAngle(); + pBrass->spr.Angles.Yaw = RandomAngle(); double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4); - DAngle nAngle = actor->spr.angle + Random2A(56) + DAngle90; + DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90; pBrass->vel.XY() = nAngle.ToVector() * nDist; pBrass->vel.Z = actor->vel.Z - 2 - Random2(40) / 30.; } @@ -344,15 +344,15 @@ void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist) void fxSpawnEjectingShell(DBloodActor* actor, double z, double dist, int rdist) { - DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.angle.ToVector() + (actor->spr.angle + DAngle90).ToVector() * dist, z); + DVector3 pos(actor->spr.pos.XY() + actor->clipdist * actor->spr.Angles.Yaw.ToVector() + (actor->spr.Angles.Yaw + DAngle90).ToVector() * dist, z); auto pShell = gFX.fxSpawnActor((FX_ID)(FX_40 + Random(3)), actor->sector(), pos); if (pShell) { if (!VanillaMode()) - pShell->spr.angle = RandomAngle(); + pShell->spr.Angles.Yaw = RandomAngle(); double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4); - DAngle nAngle = actor->spr.angle + Random2A(56) + DAngle90; + DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90; pShell->vel.XY() = nAngle.ToVector() * nDist; pShell->vel.Z = actor->vel.Z - 2 - Random2(28) / 30.; } diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 108c03456..1a4944b54 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -253,7 +253,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto int nNum = 256; gHitInfo.clearObj(); - auto pos = actor->spr.pos.plusZ(nZOffset) + (actor->spr.angle + DAngle90).ToVector() * nOffset; + auto pos = actor->spr.pos.plusZ(nZOffset) + (actor->spr.Angles.Yaw + DAngle90).ToVector() * nOffset; auto bakCstat = actor->spr.cstat; actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 13ea507a5..bedf7ce5f 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -259,7 +259,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin if (nType < kDudeBase || nType >= kDudeMax || (pDudeActor = actSpawnSprite(origin, kStatDude)) == NULL) return NULL; - DAngle angle = origin->spr.angle; + DAngle angle = origin->spr.Angles.Yaw; auto pos = origin->spr.pos.plusZ(zadd); if (dist >= 0) @@ -270,7 +270,7 @@ static DBloodActor* nnExtSpawnDude(DBloodActor* sourceactor, DBloodActor* origin SetActor(pDudeActor, pos); pDudeActor->spr.type = nType; - pDudeActor->spr.angle = angle; + pDudeActor->spr.Angles.Yaw = angle; pDudeActor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; pDudeActor->clipdist = getDudeInfo(nType)->fClipdist(); @@ -1312,7 +1312,7 @@ void nnExtProcessSuperSprites() double nSpeed = pact->vel.XY().Length(); nSpeed = max(nSpeed - nSpeed * FixedToFloat<6>(mass), FixedToFloat(0x9000 - (mass << 3))); // very messy math (TM)... - debrisactor->vel += pPlayer->actor->spr.angle.ToVector() * nSpeed; + debrisactor->vel += pPlayer->actor->spr.Angles.Yaw.ToVector() * nSpeed; debrisactor->hit.hit.setSprite(pPlayer->actor); } } @@ -1326,7 +1326,7 @@ void nnExtProcessSuperSprites() debrisactor->xspr.goalAng = debrisactor->vel.Angle(); debrisactor->norm_ang(); - DAngle ang = debrisactor->spr.angle; + DAngle ang = debrisactor->spr.Angles.Yaw; if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble); else if (Chance(0x1000 - mass)) { @@ -1342,8 +1342,8 @@ void nnExtProcessSuperSprites() int vdist = max((int)(abs(debrisactor->vel.X) + abs(debrisactor->vel.Y) * 2048.), (uwater) ? 1 : 0); auto angStep = DAngle::fromBuild(vdist); - if (ang < debrisactor->xspr.goalAng) debrisactor->spr.angle = min(ang + angStep, debrisactor->xspr.goalAng); - else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.angle = max(ang - angStep, debrisactor->xspr.goalAng); + if (ang < debrisactor->xspr.goalAng) debrisactor->spr.Angles.Yaw = min(ang + angStep, debrisactor->xspr.goalAng); + else if (ang > debrisactor->xspr.goalAng) debrisactor->spr.Angles.Yaw = max(ang - angStep, debrisactor->xspr.goalAng); auto pSector = debrisactor->sector(); double fz, cz; @@ -2745,7 +2745,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe // set random goal ang for swimming so they start turning if ((flags & kPhysDebrisSwim) && targetactor->vel.isZero()) - targetactor->xspr.goalAng = (targetactor->spr.angle + DAngle::fromBuild(Random3(kAng45))).Normalized360(); + targetactor->xspr.goalAng = (targetactor->spr.Angles.Yaw + DAngle::fromBuild(Random3(kAng45))).Normalized360(); if (targetactor->xspr.physAttr & kPhysDebrisVector) targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN; @@ -3022,9 +3022,9 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi } else { - if (toEvnAng) nAng = initiator->spr.angle; - else if (toSrcAng) nAng = actor->spr.angle; - else nAng = pSprite->spr.angle; + if (toEvnAng) nAng = initiator->spr.Angles.Yaw; + else if (toSrcAng) nAng = actor->spr.Angles.Yaw; + else nAng = pSprite->spr.Angles.Yaw; if (!toAng180 && toRndAng) { @@ -3248,7 +3248,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor) if (sourceactor->xspr.data3 & kModernTypeFlag2) { auto velv = actor->vel.XY(); - auto pt = rotatepoint(actor->spr.pos.XY(), velv, sourceactor->spr.angle - velv.Angle()); + auto pt = rotatepoint(actor->spr.pos.XY(), velv, sourceactor->spr.Angles.Yaw - velv.Angle()); actor->vel.XY() = pt; } @@ -3258,7 +3258,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor) } if (sourceactor->xspr.data2 == 1) - changeSpriteAngle(actor, sourceactor->spr.angle); + changeSpriteAngle(actor, sourceactor->spr.Angles.Yaw); viewBackupSpriteLoc(actor); @@ -3351,7 +3351,7 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor) if (sourceactor->spr.flags & kModernTypeFlag4) { - pEffect->spr.angle = sourceactor->spr.angle; + pEffect->spr.Angles.Yaw = sourceactor->spr.Angles.Yaw; } if (pEffect->spr.cstat & CSTAT_SPRITE_ONE_SIDE) @@ -3402,31 +3402,31 @@ void useSectorWindGen(DBloodActor* sourceactor, sectortype* pSector) if ((sourceactor->spr.flags & kModernTypeFlag1)) pXSector->panAlways = pXSector->windAlways = 1; - DAngle angle = sourceactor->spr.angle; + DAngle angle = sourceactor->spr.Angles.Yaw; if (sourceactor->xspr.data4 <= 0) { if ((sourceactor->xspr.data1 & 0x0002)) { - while (sourceactor->spr.angle == angle) - sourceactor->spr.angle = RandomAngle(); + while (sourceactor->spr.Angles.Yaw == angle) + sourceactor->spr.Angles.Yaw = RandomAngle(); } } - else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.angle += mapangle(sourceactor->xspr.data4); - else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.angle -= mapangle(sourceactor->xspr.data4); + else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD) sourceactor->spr.Angles.Yaw += mapangle(sourceactor->xspr.data4); + else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.Angles.Yaw -= mapangle(sourceactor->xspr.data4); else if (sourceactor->xspr.sysData1 == 0) { angle += mapangle(sourceactor->xspr.data4); if (angle >= DAngle180) sourceactor->xspr.sysData1 = 1; - sourceactor->spr.angle = min(angle, DAngle180); + sourceactor->spr.Angles.Yaw = min(angle, DAngle180); } else { angle -= mapangle(sourceactor->xspr.data4); if (angle <= -DAngle180) sourceactor->xspr.sysData1 = 0; - sourceactor->spr.angle = max(angle, -DAngle180); + sourceactor->spr.Angles.Yaw = max(angle, -DAngle180); } - pXSector->windAng = sourceactor->spr.angle; + pXSector->windAng = sourceactor->spr.Angles.Yaw; if (sourceactor->xspr.data3 > 0 && sourceactor->xspr.data3 < 4) { @@ -3784,7 +3784,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector if (sourceactor->spr.flags & kModernTypeFlag4) { - spawned->spr.angle = sourceactor->spr.angle; + spawned->spr.Angles.Yaw = sourceactor->spr.Angles.Yaw; } // should be: the more is seqs, the shorter is timer @@ -4433,7 +4433,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH) var = cansee(objActor->spr.pos, objActor->sector(), targ->spr.pos.plusZ(-height), targ->sector()); if (cond == 4 && var > 0) { - DAngle absang = absangle(delta.Angle(), objActor->spr.angle); + DAngle absang = absangle(delta.Angle(), objActor->spr.Angles.Yaw); var = absang < (arg1 <= 0 ? pInfo->Periphery() : min(mapangle(arg1), DAngle360)); } break; @@ -4556,7 +4556,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) switch (cond) { default: break; - case 0: return condCmp((arg3 == 0) ? (objActor->spr.angle.Normalized360().Buildang()) : objActor->spr.angle.Buildang(), arg1, arg2, cmpOp); + case 0: return condCmp((arg3 == 0) ? (objActor->spr.Angles.Yaw.Normalized360().Buildang()) : objActor->spr.Angles.Yaw.Buildang(), arg1, arg2, cmpOp); case 5: return condCmp(objActor->spr.statnum, arg1, arg2, cmpOp); case 6: return ((objActor->spr.flags & kHitagRespawn) || objActor->spr.statnum == kStatRespawn); case 7: return condCmp(spriteGetSlope(objActor), arg1, arg2, cmpOp); @@ -4619,15 +4619,15 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) if ((pPlayer = getPlayerById(objActor->spr.type)) != NULL) var = HitScan(objActor, pPlayer->zWeapon, pPlayer->flt_aim(), arg1, range); else if (objActor->IsDudeActor()) - var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), (!objActor->hasX()) ? 0 : objActor->dudeSlope), arg1, range); + var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), (!objActor->hasX()) ? 0 : objActor->dudeSlope), arg1, range); else if ((objActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) { var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8 : -8; // was 0x20000 - HitScan uses Q28.4 for dz! - var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), var3), arg1, range); + var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), var3), arg1, range); } else { - var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector(), 0), arg1, range); + var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.Angles.Yaw.ToVector(), 0), arg1, range); } if (var < 0) @@ -6050,7 +6050,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event) if (actor->xspr.data4 != 0) break; else if (actor->spr.flags & kModernTypeFlag1) { - pPlayer->angle.settarget(actor->spr.angle); + pPlayer->angle.settarget(actor->spr.Angles.Yaw); pPlayer->angle.lockinput(); } else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360)) @@ -6488,7 +6488,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor) } else { - dv.XY() = actor->spr.angle.ToVector(); + dv.XY() = actor->spr.Angles.Yaw.ToVector(); dv.Z = clamp(sourceactor->xspr.data3 / 256., -4., 4.); // add slope controlling } @@ -7688,31 +7688,31 @@ void nnExtAiSetDirection(DBloodActor* actor, DAngle direction) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); - DAngle vc = deltaangle(actor->spr.angle, direction); + DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction); DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3; - double range = actor->vel.XY().dot(actor->spr.angle.ToVector()) * 120; + double range = actor->vel.XY().dot(actor->spr.Angles.Yaw.ToVector()) * 120; - if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + vc, range)) - actor->xspr.goalAng = actor->spr.angle + vc; - else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle + vc / 2; - else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle - vc / 2, range)) - actor->xspr.goalAng = actor->spr.angle - vc / 2; - else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + v8, range)) - actor->xspr.goalAng = actor->spr.angle + v8; - else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle, range)) - actor->xspr.goalAng = actor->spr.angle; - else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle - v8, range)) - actor->xspr.goalAng = actor->spr.angle - v8; + if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc; + else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + vc / 2; + else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - vc / 2, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - vc / 2; + else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw + v8; + else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw; + else if (nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw - v8, range)) + actor->xspr.goalAng = actor->spr.Angles.Yaw - v8; else - actor->xspr.goalAng = actor->spr.angle + DAngle180 / 3; + actor->xspr.goalAng = actor->spr.Angles.Yaw + DAngle180 / 3; if (actor->xspr.dodgeDir) { - if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) { actor->xspr.dodgeDir = -actor->xspr.dodgeDir; - if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.angle + DAngle90 * actor->xspr.dodgeDir, 512)) + if (!nnExtCanMove(actor, actor->GetTarget(), actor->spr.Angles.Yaw + DAngle90 * actor->xspr.dodgeDir, 512)) actor->xspr.dodgeDir = 0; } } @@ -8040,7 +8040,7 @@ void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm) if (mytarget && mytarget->spr.type == kMarkerPath) { - if (targetactor == nullptr) actor->spr.angle = mytarget->spr.angle; + if (targetactor == nullptr) actor->spr.Angles.Yaw = mytarget->spr.Angles.Yaw; actor->SetTarget(nullptr); } @@ -8086,7 +8086,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor) if (Chance(0x8000)) goal = -goal; - actor->xspr.goalAng = (actor->spr.angle + goal).Normalized360(); + actor->xspr.goalAng = (actor->spr.Angles.Yaw + goal).Normalized360(); } //--------------------------------------------------------------------------- @@ -8098,8 +8098,8 @@ void aiPatrolRandGoalAng(DBloodActor* actor) void aiPatrolTurn(DBloodActor* actor) { DAngle nTurnRange = mapangle((getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4); - DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + DAngle nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); } @@ -8148,8 +8148,8 @@ void aiPatrolMove(DBloodActor* actor) } DAngle nTurnRange = pDudeInfo->TurnRange() / 64; - DAngle nAng = deltaangle(actor->spr.angle, actor->xspr.goalAng); - actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); + DAngle nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); + actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor))) @@ -8185,7 +8185,7 @@ void aiPatrolMove(DBloodActor* actor) } frontSpeed = aiPatrolGetVelocity(pDudeInfo->frontSpeed, targetactor->xspr.busyTime); - actor->vel += actor->spr.angle.ToVector() * FixedToFloat(frontSpeed); + actor->vel += actor->spr.Angles.Yaw.ToVector() * FixedToFloat(frontSpeed); } double vel = (actor->xspr.unused1 & kDudeFlagCrouch) ? kMaxPatrolCrouchVelocity : kMaxPatrolVelocity; @@ -8356,7 +8356,7 @@ bool readyForCrit(DBloodActor* hunter, DBloodActor* victim) if (dvect.Length() >= (437.5 / max(gGameOptions.nDifficulty >> 1, 1))) return false; - return absangle(victim->spr.angle, dvect.Angle()) <= DAngle45; + return absangle(victim->spr.Angles.Yaw, dvect.Angle()) <= DAngle45; } //--------------------------------------------------------------------------- @@ -8552,7 +8552,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor) if (seeDistf) { DAngle periphery = max(pDudeInfo->Periphery(), DAngle60); - DAngle nDeltaAngle = absangle(actor->spr.angle, dv.Angle()); + DAngle nDeltaAngle = absangle(actor->spr.Angles.Yaw, dv.Angle()); if ((itCanSee = (!blind && nDistf < seeDistf && nDeltaAngle < periphery)) == true) { int base = 100 + ((20 * gGameOptions.nDifficulty) - (nDeltaAngle.Buildang() / 5)); @@ -8834,7 +8834,7 @@ void aiPatrolThink(DBloodActor* actor) else if (aiPatrolTurning(actor->xspr.aiState)) { //viewSetSystemMessage("TURN"); - if (absangle(actor->spr.angle, actor->xspr.goalAng) < minAngle) + if (absangle(actor->spr.Angles.Yaw, actor->xspr.goalAng) < minAngle) { // save imer for waiting stateTimer = actor->xspr.stateTimer; @@ -8865,8 +8865,8 @@ void aiPatrolThink(DBloodActor* actor) // take marker's angle if (!(markeractor->spr.flags & kModernTypeFlag4)) { - actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.angle+ DAngle180 : markeractor->spr.angle).Normalized360(); - if (absangle(actor->spr.angle, actor->xspr.goalAng) > minAngle) // let the enemy play move animation while turning + actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->spr.Angles.Yaw+ DAngle180 : markeractor->spr.Angles.Yaw).Normalized360(); + if (absangle(actor->spr.Angles.Yaw, actor->xspr.goalAng) > minAngle) // let the enemy play move animation while turning return; } @@ -9184,7 +9184,7 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22 burstactor->spr.scale = actor->spr.scale; burstactor->spr.scale *= 0.5; - burstactor->spr.angle = actor->spr.angle + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs); + burstactor->spr.Angles.Yaw = actor->spr.Angles.Yaw + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs); burstactor->SetOwner(actor); actBuildMissile(burstactor, actor); @@ -9273,7 +9273,7 @@ void triggerTouchWall(DBloodActor* actor, walltype* pHWall) void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng) { if (!pSpr->IsDudeActor()) - pSpr->spr.angle = nAng; + pSpr->spr.Angles.Yaw = nAng; else { PLAYER* pPlayer = getPlayerById(pSpr->spr.type); @@ -9281,9 +9281,9 @@ void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng) pPlayer->angle.ang = nAng; else { - pSpr->spr.angle = nAng; + pSpr->spr.Angles.Yaw = nAng; if (xsprIsFine(pSpr)) - pSpr->xspr.goalAng = pSpr->spr.angle; + pSpr->xspr.goalAng = pSpr->spr.Angles.Yaw; } } } diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 0b6dba0e3..26ed64b95 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -812,7 +812,7 @@ void playerStart(int nPlayer, int bNewLevel) GetActorExtents(actor, &top, &bottom); actor->spr.pos.Z -= bottom - actor->spr.pos.Z; actor->spr.pal = 11 + (pPlayer->teamId & 3); - actor->spr.angle = pPlayer->angle.ang = pStartZone->angle; + actor->spr.Angles.Yaw = pPlayer->angle.ang = pStartZone->angle; actor->spr.type = kDudePlayer1 + nPlayer; actor->clipdist = pDudeInfo->fClipdist(); actor->spr.flags = 15; @@ -1421,7 +1421,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out) { auto plActor = pPlayer->actor; *out = {}; - auto pos = DVector3(plActor->spr.angle.ToVector(), pPlayer->slope); + auto pos = DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope); int hit = HitScan(pPlayer->actor, pPlayer->zView, pos, 0x10000040, 128); double hitDist = (plActor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length(); if (hitDist < 64) @@ -1499,7 +1499,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out) void UpdatePlayerSpriteAngle(PLAYER* pPlayer) { - pPlayer->actor->spr.angle = pPlayer->angle.ang; + pPlayer->actor->spr.Angles.Yaw = pPlayer->angle.ang; } //--------------------------------------------------------------------------- @@ -1513,7 +1513,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->spr.pos.XY(), plActor->spr.angle, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust); + pPlayer->horizon.calcviewpitch(plActor->spr.pos.XY(), plActor->spr.Angles.Yaw, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust); } //--------------------------------------------------------------------------- @@ -1592,7 +1592,7 @@ void ProcessInput(PLAYER* pPlayer) const double speed = pPlayer->posture == 1? 1. : 1. - (actor->xspr.height < 256 ? actor->xspr.height * (1. / 256.) : 0); const double& fvAccel = pInput->fvel > 0 ? pPosture->frontAccel : pPosture->backAccel; const double& svAccel = pPosture->sideAccel; - actor->vel.XY() += DVector2(pInput->fvel * fvAccel, pInput->svel * svAccel).Rotated(actor->spr.angle) * speed; + actor->vel.XY() += DVector2(pInput->fvel * fvAccel, pInput->svel * svAccel).Rotated(actor->spr.Angles.Yaw) * speed; } if (SyncInput()) @@ -1715,8 +1715,8 @@ void ProcessInput(PLAYER* pPlayer) auto spawned = actSpawnDude(pactor, kDudeHand, pPlayer->actor->clipdist * 0.5); if (spawned) { - spawned->spr.angle += DAngle180; - spawned->vel.XY() = pPlayer->actor->vel.XY() + (64. / 3.) * pPlayer->actor->spr.angle.ToVector(); + spawned->spr.Angles.Yaw += DAngle180; + spawned->vel.XY() = pPlayer->actor->vel.XY() + (64. / 3.) * pPlayer->actor->spr.Angles.Yaw.ToVector(); spawned->vel.Z = pPlayer->actor->vel.Z; } pPlayer->hand = 0; diff --git a/source/games/blood/src/sfx.cpp b/source/games/blood/src/sfx.cpp index f458d9497..c56ef3294 100644 --- a/source/games/blood/src/sfx.cpp +++ b/source/games/blood/src/sfx.cpp @@ -120,7 +120,7 @@ void GameInterface::UpdateSounds() if (pPlayer->actor) { - listener.angle = float(-pPlayer->actor->spr.angle.Radians()); + listener.angle = float(-pPlayer->actor->spr.Angles.Yaw.Radians()); listener.velocity.Zero(); listener.position = GetSoundPos(pPlayer->actor->spr.pos); listener.valid = true; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 28da7efad..401f86d83 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -271,10 +271,10 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event) if (nDist != 0 && cansee(DVector3(actor->spr.pos.XY(), top), actor->sector(), pos, target->sector())) { pos.XY() += target->vel.XY() * nDist * (65536. / 0x1aaaaa); - auto angBak = actor->spr.angle; - actor->spr.angle = (pos.XY() - actor->spr.pos.XY()).Angle(); + auto angBak = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = (pos.XY() - actor->spr.pos.XY()).Angle(); double tz = target->spr.pos.Z - (target->spr.scale.Y * pDudeInfo->aimHeight); - auto dvec = DVector3(actor->spr.angle.ToVector(), ((tz - top - 1) / nDist) * (1. / 16.)); + auto dvec = DVector3(actor->spr.Angles.Yaw.ToVector(), ((tz - top - 1) / nDist) * (1. / 16.)); int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0); if (auto missile = actFireMissile(actor, 0, (top - actor->spr.pos.Z) - 1, dvec, nMissileType)) { @@ -285,7 +285,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event) if (!VanillaMode()) // disable collisions so lifeleech doesn't do that weird bobbing missile->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; } - actor->spr.angle = angBak; + actor->spr.Angles.Yaw = angBak; } } } @@ -909,7 +909,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec auto spot = rotatepoint(pivot, actor->basePoint, ptang_w2); viewBackupSpriteLoc(actor); actor->spr.pos.XY() = spot + pt_w2 - pivot; - actor->spr.angle += angleofs; + actor->spr.Angles.Yaw += angleofs; if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs); } @@ -921,7 +921,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec auto spot = rotatepoint(pivotDy, actor->basePoint, ptang_w2); viewBackupSpriteLoc(actor); actor->spr.pos.XY() = spot - pt_w2 + pivot; - actor->spr.angle += angleofs; + actor->spr.Angles.Yaw += angleofs; if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs); } else if (pXSector->Drag) @@ -936,7 +936,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec { actor->spr.pos.XY() = rotatepoint(pt_w1, actor->spr.pos.XY(), angleofs); } - actor->spr.angle += angleofs; + actor->spr.Angles.Yaw += angleofs; actor->spr.pos += position; if (!VanillaMode() && actor->IsPlayerActor()) gPlayer[actor->spr.type - kDudePlayer1].angle.addadjustment(angleofs); } @@ -962,7 +962,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec auto spot = rotatepoint(pivot, ac->basePoint, ptang_w2); viewBackupSpriteLoc(ac); ac->spr.pos.XY() = spot + pt_w2 - pivot; - ac->spr.angle += angleofs; + ac->spr.Angles.Yaw += angleofs; if (!VanillaMode() && ac->IsPlayerActor()) gPlayer[ac->spr.type - kDudePlayer1].angle.addadjustment(angleofs); } else if (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) @@ -970,7 +970,7 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec auto spot = rotatepoint(pivot, ac->basePoint, ptang_w2); viewBackupSpriteLoc(ac); ac->spr.pos.XY() = spot - pt_w2 + pivot; - ac->spr.angle += angleofs; + ac->spr.Angles.Yaw += angleofs; if (!VanillaMode() && ac->IsPlayerActor()) gPlayer[ac->spr.type - kDudePlayer1].angle.addadjustment(angleofs); } } @@ -1367,7 +1367,7 @@ int HDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator) if (!pXSector->marker0 || !pXSector->marker1) return 0; auto marker0 = pXSector->marker0; auto marker1 = pXSector->marker1; - TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide); + TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide); ZTranslateSector(pSector, pXSector, a2, nWave); pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) @@ -1398,7 +1398,7 @@ int RDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator) nWave = pXSector->busyWaveB; if (!pXSector->marker0) return 0; auto marker0 = pXSector->marker0; - TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate); + TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate); ZTranslateSector(pSector, pXSector, a2, nWave); pXSector->busy = a2; if (pXSector->command == kCmdLink && pXSector->txID) @@ -1429,13 +1429,13 @@ int StepRotateBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator) DAngle ang2; if (pXSector->busy < a2) { - ang2 = ang1 + marker0->spr.angle; + ang2 = ang1 + marker0->spr.Angles.Yaw; int nWave = pXSector->busyWaveA; TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, ang1, marker0->spr.pos, ang2, true); } else { - ang2 = ang1 - marker0->spr.angle; + ang2 = ang1 - marker0->spr.Angles.Yaw; int nWave = pXSector->busyWaveB; TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos, marker0->spr.pos, ang2, marker0->spr.pos, ang1, true); } @@ -1491,7 +1491,7 @@ int PathBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator) if (!basepath || !marker0 || !marker1) return 0; int nWave = marker0->xspr.wave; - TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, true); + TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, true); ZTranslateSector(pSector, pXSector, a2, nWave); pXSector->busy = a2; if ((a2 & 0xffff) == 0) @@ -1617,7 +1617,7 @@ void OperateTeleport(sectortype* pSector) } actor->spr.pos.XY() = destactor->spr.pos.XY(); actor->spr.pos.Z += destactor->sector()->floorz - pSector->floorz; - actor->spr.angle = destactor->spr.angle; + actor->spr.Angles.Yaw = destactor->spr.Angles.Yaw; ChangeActorSect(actor, destactor->sector()); sfxPlay3DSound(destactor, 201, -1, 0); actor->vel.Zero(); @@ -1627,7 +1627,7 @@ void OperateTeleport(sectortype* pSector) { playerResetInertia(pPlayer); pPlayer->zViewVel = pPlayer->zWeaponVel = 0; - pPlayer->angle.settarget(actor->spr.angle, true); + pPlayer->angle.settarget(actor->spr.Angles.Yaw, true); } } } @@ -2331,9 +2331,9 @@ void trInit(TArray& actors) { auto marker0 = pXSector->marker0; auto marker1 = pXSector->marker1; - TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide); + TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide); UpdateBasePoints(pSector); - TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, marker0->spr.angle, marker1->spr.pos, marker1->spr.angle, pSector->type == kSectorSlide); + TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, marker0->spr.Angles.Yaw, marker1->spr.pos, marker1->spr.Angles.Yaw, pSector->type == kSectorSlide); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); break; } @@ -2341,9 +2341,9 @@ void trInit(TArray& actors) case kSectorRotate: { auto marker0 = pXSector->marker0; - TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate); + TranslateSector(pSector, 0, -1, marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate); UpdateBasePoints(pSector); - TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.angle, pSector->type == kSectorRotate); + TranslateSector(pSector, 0, FixedToFloat(pXSector->busy), marker0->spr.pos, marker0->spr.pos, nullAngle, marker0->spr.pos, marker0->spr.Angles.Yaw, pSector->type == kSectorRotate); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); break; } @@ -2522,7 +2522,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor) if (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) actFireMissile(actor, 0, 0, DVector3(0, 0, (actor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 1 : -1), kMissileFireball); else - actFireMissile(actor, 0, 0, DVector3(actor->spr.angle.ToVector(), 0), kMissileFireball); + actFireMissile(actor, 0, 0, DVector3(actor->spr.Angles.Yaw.ToVector(), 0), kMissileFireball); } @@ -2543,7 +2543,7 @@ void MGunFireSeqCallback(int, DBloodActor* actor) evPostActor(actor, 1, kCmdOff, actor); } DVector3 dv; - dv.XY() = actor->spr.angle.ToVector(); + dv.XY() = actor->spr.Angles.Yaw.ToVector(); dv.X += Random2F(1000, 14); dv.Y += Random2F(1000, 14); dv.Z = Random2F(1000, 14); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 592770719..4d2e36627 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -817,7 +817,7 @@ std::pair GameInterface::GetCoordinates() { PLAYER* pPlayer = &gPlayer[myconnectindex]; if (!pPlayer->actor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle); - return std::make_pair(pPlayer->actor->spr.pos, pPlayer->actor->spr.angle); + return std::make_pair(pPlayer->actor->spr.pos, pPlayer->actor->spr.Angles.Yaw); } diff --git a/source/games/blood/src/warp.cpp b/source/games/blood/src/warp.cpp index 19e41c49c..94c5b3726 100644 --- a/source/games/blood/src/warp.cpp +++ b/source/games/blood/src/warp.cpp @@ -85,7 +85,7 @@ void warpInit(TArray& actors) ZONE* pZone = &gStartZone[actor->xspr.data1]; pZone->pos = actor->spr.pos; pZone->sector = actor->sector(); - pZone->angle = actor->spr.angle; + pZone->angle = actor->spr.Angles.Yaw; } DeleteSprite(actor); break; @@ -96,7 +96,7 @@ void warpInit(TArray& actors) ZONE* pZone = &gStartZone[actor->xspr.data1]; pZone->pos = actor->spr.pos; pZone->sector = actor->sector(); - pZone->angle = actor->spr.angle; + pZone->angle = actor->spr.Angles.Yaw; #ifdef NOONE_EXTENSIONS // fill player spawn position according team of player in TEAMS mode. @@ -105,7 +105,7 @@ void warpInit(TArray& actors) pZone = &gStartZoneTeam1[team1]; pZone->pos = actor->spr.pos; pZone->sector = actor->sector(); - pZone->angle = actor->spr.angle; + pZone->angle = actor->spr.Angles.Yaw; team1++; } @@ -113,7 +113,7 @@ void warpInit(TArray& actors) pZone = &gStartZoneTeam2[team2]; pZone->pos = actor->spr.pos; pZone->sector = actor->sector(); - pZone->angle = actor->spr.angle; + pZone->angle = actor->spr.Angles.Yaw; team2++; } } diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index e11862422..fdadc1ef5 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -441,7 +441,7 @@ void UpdateAimVector(PLAYER* pPlayer) assert(pPlayer != NULL); auto plActor = pPlayer->actor; DVector3 pos(plActor->spr.pos.XY(), pPlayer->zWeapon); - DVector3 Aim(plActor->spr.angle.ToVector(), pPlayer->slope); + DVector3 Aim(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope); WEAPONTRACK* pWeaponTrack = &gWeaponTrack[pPlayer->curWeapon]; DBloodActor* targetactor = nullptr; @@ -472,7 +472,7 @@ void UpdateAimVector(PLAYER* pPlayer) double t = nDist * 4096 / pWeaponTrack->seeker; pos2 += actor->vel * t; } - DVector3 lpos = pos + DVector3(plActor->spr.angle.ToVector(), pPlayer->slope) * nDist; + DVector3 lpos = pos + DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope) * nDist; double zRange = nDist * (9460 / 16384.); double top, bottom; @@ -481,7 +481,7 @@ void UpdateAimVector(PLAYER* pPlayer) continue; DAngle angle = (pos2 - pos).Angle(); - DAngle deltaangle = absangle(angle, plActor->spr.angle); + DAngle deltaangle = absangle(angle, plActor->spr.Angles.Yaw); if (deltaangle > DAngle::fromBuild(pWeaponTrack->angleRange)) continue; if (pPlayer->aimTargetsCount < 16 && cansee(pos, plActor->sector(), pos2, actor->sector())) @@ -519,7 +519,7 @@ void UpdateAimVector(PLAYER* pPlayer) if (nDist == 0 || nDist > 3200) continue; - DVector3 lpos = pos + DVector3(plActor->spr.angle.ToVector(), pPlayer->slope) * nDist; + DVector3 lpos = pos + DVector3(plActor->spr.Angles.Yaw.ToVector(), pPlayer->slope) * nDist; double zRange = nDist * (9460 / 16384.); double top, bottom; @@ -528,7 +528,7 @@ void UpdateAimVector(PLAYER* pPlayer) continue; DAngle angle = dv.Angle(); - DAngle deltaangle = absangle(angle, plActor->spr.angle); + DAngle deltaangle = absangle(angle, plActor->spr.Angles.Yaw); if (deltaangle > DAngle::fromBuild(pWeaponTrack->thingAngle)) continue; @@ -549,14 +549,14 @@ void UpdateAimVector(PLAYER* pPlayer) } } DVector3 Aim2(Aim); - Aim2.XY() = Aim2.XY().Rotated(-plActor->spr.angle); + Aim2.XY() = Aim2.XY().Rotated(-plActor->spr.Angles.Yaw); Aim2.Z -= pPlayer->slope; pPlayer->relAim.X = interpolatedvalue(pPlayer->relAim.X, Aim2.X, FixedToFloat(pWeaponTrack->aimSpeedHorz)); pPlayer->relAim.Y = interpolatedvalue(pPlayer->relAim.Y, Aim2.Y, FixedToFloat(pWeaponTrack->aimSpeedHorz)); pPlayer->relAim.Z = interpolatedvalue(pPlayer->relAim.Z, Aim2.Z, FixedToFloat(pWeaponTrack->aimSpeedVert)); pPlayer->aim = pPlayer->relAim; - pPlayer->aim.XY() = pPlayer->aim.XY().Rotated(plActor->spr.angle); + pPlayer->aim.XY() = pPlayer->aim.XY().Rotated(plActor->spr.Angles.Yaw); pPlayer->aim.Z += pPlayer->slope; pPlayer->aimTarget = targetactor; } @@ -1975,7 +1975,7 @@ void FireLifeLeech(int nTrigger, PLAYER* pPlayer) if (missileActor) { missileActor->SetTarget(pPlayer->aimTarget); - missileActor->spr.angle = ((nTrigger == 2) ? DAngle180 : nullAngle); + missileActor->spr.Angles.Yaw = ((nTrigger == 2) ? DAngle180 : nullAngle); } if (checkAmmo2(pPlayer, 8, 1)) UseAmmo(pPlayer, 8, 1); diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 5b55b3877..feb71434b 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -225,7 +225,7 @@ int ssp(DDukeActor* const actor, unsigned int cliptype) //The set sprite functio { Collision c; - return movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), cliptype, c) == kHitNone; + return movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), cliptype, c) == kHitNone; } //--------------------------------------------------------------------------- @@ -275,7 +275,7 @@ void lotsofstuff(DDukeActor* actor, int n, int spawntype) void movesector(DDukeActor* const actor, int msindex, DAngle rotation) { //T1,T2 and T3 are used for all the sector moving stuff!!! - actor->spr.pos.XY() += actor->spr.angle.ToVector() * actor->vel.X; + actor->spr.pos.XY() += actor->spr.Angles.Yaw.ToVector() * actor->vel.X; for(auto& wal : actor->sector()->walls) { @@ -362,7 +362,7 @@ void movedummyplayers(void) { act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.pos.Z = act->sector()->ceilingz + 27; - act->spr.angle = ps[p].angle.ang; + act->spr.Angles.Yaw = ps[p].angle.ang; if (act->temp_data[0] == 8) act->temp_data[0] = 0; else act->temp_data[0]++; @@ -401,7 +401,7 @@ void moveplayers(void) { act->restorepos(); act->backupz(); - act->spr.angle = p->angle.oang; + act->spr.Angles.Yaw = p->angle.oang; SetActor(act, act->spr.pos); } else @@ -465,7 +465,7 @@ void moveplayers(void) p->angle.addadjustment(deltaangle(p->angle.ang, (p->wackedbyactor->spr.pos.XY() - p->GetActor()->spr.pos.XY()).Angle()) * 0.5); } } - act->spr.angle = p->angle.ang; + act->spr.Angles.Yaw = p->angle.ang; } } else @@ -499,13 +499,13 @@ void moveplayers(void) if (act->spr.extra < 8) { act->vel.X = 8; - act->spr.angle = p->angle.ang; + act->spr.Angles.Yaw = p->angle.ang; act->spr.extra++; ssp(act, CLIPMASK0); } else { - act->spr.angle = DAngle360 - minAngle - p->angle.ang; + act->spr.Angles.Yaw = DAngle360 - minAngle - p->angle.ang; SetActor(act, act->spr.pos); } } @@ -614,7 +614,7 @@ void detonate(DDukeActor *actor, int explosion) void bounce(DDukeActor* actor) { - DVector3 vect(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z); + DVector3 vect(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z); auto sectp = actor->sector(); @@ -635,7 +635,7 @@ void bounce(DDukeActor* actor) actor->vel.Z = vect.Z; actor->vel.X = vect.XY().Length(); - actor->spr.angle = vect.Angle(); + actor->spr.Angles.Yaw = vect.Angle(); } //--------------------------------------------------------------------------- @@ -713,7 +713,7 @@ bool rat(DDukeActor* actor, bool makesound) if (ssp(actor, CLIPMASK0)) { if (makesound && (krand() & 255) == 0) S_PlayActorSound(RATTY, actor); - actor->spr.angle += mapangle((krand() & 31) - 15 + int(BobVal(actor->temp_data[0] << 8) * 8)); + actor->spr.Angles.Yaw += mapangle((krand() & 31) - 15 + int(BobVal(actor->temp_data[0] << 8) * 8)); } else { @@ -723,11 +723,11 @@ bool rat(DDukeActor* actor, bool makesound) actor->Destroy(); return false; } - else actor->spr.angle = randomAngle(); + else actor->spr.Angles.Yaw = randomAngle(); } if (actor->vel.X < 8) actor->vel.X += 1/8.; - actor->spr.angle += mapangle((krand() & 3) - 6); + actor->spr.Angles.Yaw += mapangle((krand() & 3) - 6); return true; } @@ -755,7 +755,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) Collision coll; auto sect = actor->sector(); auto pos = actor->spr.pos; - auto move = actor->spr.angle.ToVector() * actor->vel.X * 0.5; + auto move = actor->spr.Angles.Yaw.ToVector() * actor->vel.X * 0.5; int j = clipmove(pos, §, move, 1.5, 4., 4., CLIPMASK1, coll); actor->spr.pos = pos;; actor->setsector(sect); @@ -763,7 +763,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) if (j == kHitWall) { auto ang = coll.hitWall->delta().Angle(); - actor->spr.angle = ang * 2 - actor->spr.angle; + actor->spr.Angles.Yaw = ang * 2 - actor->spr.Angles.Yaw; } else if (j == kHitSprite) { @@ -811,7 +811,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) if (actor->spr.pal == 12) actor->vel.X = 10.25; else actor->vel.X = 8.75; - actor->spr.angle = ps[p].angle.ang; + actor->spr.Angles.Yaw = ps[p].angle.ang; ps[p].toggle_key_flag = 2; } } @@ -819,7 +819,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) } if (x < 32 && actor->sector() == ps[p].cursector) { - actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); actor->vel.X = 3; } } @@ -847,7 +847,7 @@ void forcesphere(DDukeActor* actor, int forcesphere) { k->spr.cstat = CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_YCENTER; k->clipdist = 16; - k->spr.angle = j; + k->spr.Angles.Yaw = j; k->vel.Z = l.Sin() * 2; k->vel.X = l.Cos() * 2; k->SetOwner(actor); @@ -927,7 +927,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p actor->temp_data[2]++; if ((actor->temp_data[2] & 3) == 0) spawn(actor, explosion); getglobalz(actor); - actor->spr.angle += DAngle22_5 * 0.75; + actor->spr.Angles.Yaw += DAngle22_5 * 0.75; actor->vel.X = 8; int j = ssp(actor, CLIPMASK0); if (j != 1 || actor->spr.pos.Z > actor->floorz) @@ -959,11 +959,11 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p actor->temp_data[2]++; if ((actor->temp_data[2] & 15) == 0) { - a = actor->spr.angle; - actor->spr.angle = actor->temp_angle; + a = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = actor->temp_angle; if (attacksnd >= 0) S_PlayActorSound(attacksnd, actor); fi.shoot(actor, firelaser); - actor->spr.angle = a; + actor->spr.Angles.Yaw = a; } if (actor->temp_data[2] > (26 * 3) || !cansee(actor->spr.pos.plusZ(-16), actor->sector(), ps[p].GetActor()->getPosWithOffsetZ(), ps[p].cursector)) { @@ -998,7 +998,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p fi.shoot(actor, firelaser); } } - actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.25; + actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.25; } if (actor->temp_data[0] != 2 && actor->temp_data[0] != 3 && Owner) @@ -1006,7 +1006,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p double dist = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Length(); if (dist <= 96) { - a = actor->spr.angle; + a = actor->spr.Angles.Yaw; actor->vel.X *= 0.5; } else a = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle(); @@ -1033,7 +1033,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p { actor->temp_data[0] = 2 + (krand() & 2); actor->temp_data[2] = 0; - actor->temp_angle = actor->spr.angle; + actor->temp_angle = actor->spr.Angles.Yaw; } } @@ -1057,8 +1057,8 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p actor->SetOwner(NewOwner); } - auto ang = deltaangle(actor->spr.angle, a); - actor->spr.angle += ang * 0.125; + auto ang = deltaangle(actor->spr.Angles.Yaw, a); + actor->spr.Angles.Yaw += ang * 0.125; if (actor->spr.pos.Z < Owner->spr.pos.Z - 2) actor->spr.pos.Z += 2; @@ -1279,7 +1279,7 @@ void forcesphereexplode(DDukeActor *actor) } actor->spr.pos = Owner->spr.pos;; - actor->spr.angle += mapangle(Owner->temp_data[0]); + actor->spr.Angles.Yaw += mapangle(Owner->temp_data[0]); size = clamp(size, REPEAT_SCALE, 1.); @@ -1481,7 +1481,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f else actor->vel.Z += ( gs.gravity - 50/256.); } - actor->spr.pos += actor->spr.angle.ToVector() * actor->vel.X; + actor->spr.pos += actor->spr.Angles.Yaw.ToVector() * actor->vel.X; actor->spr.pos.Z += actor->vel.Z; if (floorcheck && actor->spr.pos.Z >= actor->sector()->floorz) @@ -1837,7 +1837,7 @@ void handle_se00(DDukeActor* actor) } } - actor->spr.angle += ang_amount * direction; + actor->spr.Angles.Yaw += ang_amount * direction; actor->temp_angle += ang_amount * direction; } else @@ -1849,14 +1849,14 @@ void handle_se00(DDukeActor* actor) return; } - if (Owner->spr.angle.Normalized360() > DAngle180) + if (Owner->spr.Angles.Yaw.Normalized360() > DAngle180) direction = -1; else direction = 1; if (actor->temp_pos.Y == 0) actor->temp_pos.Y = (actor->spr.pos.XY() - Owner->spr.pos.XY()).Length(); actor->vel.X = actor->temp_pos.Y; actor->spr.pos.XY() = Owner->spr.pos.XY(); - actor->spr.angle += ang_amount * direction; + actor->spr.Angles.Yaw += ang_amount * direction; actor->temp_angle += ang_amount * direction; } @@ -1888,7 +1888,7 @@ void handle_se00(DDukeActor* actor) continue; } - act2->spr.angle += ang_amount * direction; + act2->spr.Angles.Yaw += ang_amount * direction; act2->norm_ang(); act2->spr.pos.Z += zchange; @@ -1975,10 +1975,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) if(actor->vel.X != 0) { auto curangle = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - auto diffangle = deltaangle(actor->spr.angle, curangle) * 0.125; + auto diffangle = deltaangle(actor->spr.Angles.Yaw, curangle) * 0.125; actor->temp_angle += diffangle; - actor->spr.angle += diffangle; + actor->spr.Angles.Yaw += diffangle; bool statstate = (!checkstat || ((sc->floorstat & CSTAT_SECTOR_SKY) == 0 && (sc->ceilingstat & CSTAT_SECTOR_SKY) == 0)); if (actor->vel.X == sc->extra * maptoworld) @@ -1994,10 +1994,10 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) int p = findplayer(actor, &dist2); if (dist2 < 1280)//20480) { - auto saved_angle = actor->spr.angle; - actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); + auto saved_angle = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); fi.shoot(actor, RPG); - actor->spr.angle = saved_angle; + actor->spr.Angles.Yaw = saved_angle; } } } @@ -2027,7 +2027,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) } } - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; for (int p = connecthead; p >= 0; p = connectpoint2[p]) { @@ -2068,7 +2068,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) !islocator(a2)) { a2->spr.pos.XY() = rotatepoint(actor->spr.pos.XY(), a2->spr.pos.XY(), diffangle) + vec; - a2->spr.angle += diffangle; + a2->spr.Angles.Yaw += diffangle; if (numplayers > 1) { @@ -2173,7 +2173,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) actor->vel.X = 0; operateactivators(actor->spr.hitag + (short)actor->temp_data[3], nullptr); actor->SetOwner(nullptr); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; actor->temp_data[4] = 0; fi.operateforcefields(actor, actor->spr.hitag); } @@ -2182,7 +2182,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) if(actor->vel.X != 0) { - auto vect = actor->spr.angle.ToVector() * actor->vel.X; + auto vect = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; if ((sc->floorz - sc->ceilingz) < 108) if (ud.clipping == 0) @@ -2330,7 +2330,7 @@ void handle_se02(DDukeActor* actor) else sc->setfloorslope(sc->getfloorslope() + (Sgn(actor->temp_data[5] - sc->getfloorslope()) << 4)); } - auto vect = actor->spr.angle.ToVector() * actor->vel.X; + auto vect = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; for (int p = connecthead; p >= 0; p = connectpoint2[p]) if (ps[p].cursector == actor->sector() && ps[p].on_ground) @@ -2480,10 +2480,10 @@ void handle_se05(DDukeActor* actor, int FIRELASER) int p = findplayer(actor, &x); if (x < 512) { - auto ang = actor->spr.angle; - actor->spr.angle = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); + auto ang = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = (actor->spr.pos.XY() - ps[p].GetActor()->spr.pos.XY()).Angle(); fi.shoot(actor, FIRELASER); - actor->spr.angle = ang; + actor->spr.Angles.Yaw = ang; } auto Owner = actor->GetOwner(); @@ -2525,8 +2525,8 @@ void handle_se05(DDukeActor* actor, int FIRELASER) else actor->vel.X = 16; auto ang = (Owner->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - auto angdiff = deltaangle(actor->spr.angle, ang) / 8; - actor->spr.angle += angdiff; + auto angdiff = deltaangle(actor->spr.Angles.Yaw, ang) / 8; + actor->spr.Angles.Yaw += angdiff; if (rnd(32)) { @@ -2888,7 +2888,7 @@ void handle_se13(DDukeActor* actor) } - if (actor->temp_data[2] == 4 && actor->spr.angle != DAngle90) + if (actor->temp_data[2] == 4 && actor->spr.Angles.Yaw != DAngle90) for (int x = 0; x < 7; x++) RANDOMSCRAP(actor); } @@ -3312,7 +3312,7 @@ void handle_se20(DDukeActor* actor) //if(actor->vel.X != 0) //Moving { - auto vec = actor->spr.angle.ToVector() * (actor->temp_data[0] == 1 ? 0.5 : -0.5); + auto vec = actor->spr.Angles.Yaw.ToVector() * (actor->temp_data[0] == 1 ? 0.5 : -0.5); actor->temp_data[3] += actor->temp_data[0] == 1? 8 :- 8; @@ -3431,7 +3431,7 @@ void handle_se26(DDukeActor* actor) double zvel = actor->vel.Z; actor->vel.X = 2; - DVector2 vect = 2 * actor->spr.angle.ToVector(); // was: (32 * b sin) >> 14 + DVector2 vect = 2 * actor->spr.Angles.Yaw.ToVector(); // was: (32 * b sin) >> 14 actor->spr.shade++; if (actor->spr.shade > 7) @@ -3479,7 +3479,7 @@ void handle_se27(DDukeActor* actor) if (ud.recstat == 0) return; - actor->temp_angle = actor->spr.angle; + actor->temp_angle = actor->spr.Angles.Yaw; p = findplayer(actor, &xx); if (ps[p].GetActor()->spr.extra > 0 && myconnectindex == screenpeek) @@ -3497,7 +3497,7 @@ void handle_se27(DDukeActor* actor) { ud.cameraactor = actor; actor->temp_data[0] = 999; - actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125; + actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125; actor->spr.yint = 100 + int((actor->spr.pos.Z - ps[p].GetActor()->getOffsetZ()) * (256. / 257.)); } @@ -3512,7 +3512,7 @@ void handle_se27(DDukeActor* actor) } else { - actor->spr.angle = (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); if (actor->temp_data[0] == 999) { @@ -3536,7 +3536,7 @@ void handle_se24(DDukeActor *actor, bool scroll, double mult) { if (actor->temp_data[4]) return; - auto vec = actor->spr.angle.ToVector() * actor->spr.yint / 256.; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->spr.yint / 256.; DukeSectIterator it(actor->sector()); while (auto a2 = it.Next()) @@ -3706,7 +3706,7 @@ void handle_se35(DDukeActor *actor, int SMALLSMOKE, int EXPLOSION2) if (sc->ceilingz > actor->spr.pos.Z) for (int j = 0; j < 8; j++) { - actor->spr.angle = randomAngle(90); + actor->spr.Angles.Yaw = randomAngle(90); auto spawned = spawn(actor, SMALLSMOKE); if (spawned) { @@ -3805,7 +3805,7 @@ void handle_se130(DDukeActor *actor, int countmax, int EXPLOSION2) double s = 0.03125 + (krand() & 7) * REPEAT_SCALE; k->spr.scale = DVector2(s, s); k->spr.pos.Z = sc->floorz + krandf(x); - k->spr.angle += DAngle45 - randomAngle(90); + k->spr.Angles.Yaw += DAngle45 - randomAngle(90); k->vel.X = krandf(8); ssp(k, CLIPMASK0); } @@ -4090,16 +4090,16 @@ int dodge(DDukeActor* actor) continue; auto delta = ac->spr.pos.XY() - oldpos; - auto bvect = ac->spr.angle.ToVector() * 1024; + auto bvect = ac->spr.Angles.Yaw.ToVector() * 1024; - if (actor->spr.angle.ToVector().dot(delta) >= 0) + if (actor->spr.Angles.Yaw.ToVector().dot(delta) >= 0) { if (bvect.dot(delta) < 0) { double d = bvect.X * delta.Y - bvect.Y * delta.X; if (abs(d) < 256 * 64) { - actor->spr.angle -= DAngle90 + randomAngle(180); + actor->spr.Angles.Yaw -= DAngle90 + randomAngle(180); return 1; } } @@ -4124,9 +4124,9 @@ DAngle furthestangle(DDukeActor *actor, int angs) DAngle angincs = DAngle360 / angs; if (!actor->isPlayer()) - if ((actor->temp_data[0] & 63) > 2) return(actor->spr.angle + DAngle180); + if ((actor->temp_data[0] & 63) > 2) return(actor->spr.Angles.Yaw + DAngle180); - for (DAngle j = actor->spr.angle; j < DAngle360 + actor->spr.angle; j += angincs) + for (DAngle j = actor->spr.Angles.Yaw; j < DAngle360 + actor->spr.Angles.Yaw; j += angincs) { hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(j.ToVector() * 1024, 0), hit, CLIPMASK1); @@ -4158,7 +4158,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, DVector2& pos) angincs = DAngle180; else angincs = DAngle360 / (1 + (krand() & 1)); - for (auto j = tosee->spr.angle; j < tosee->spr.angle + DAngle360; j += (angincs - randomAngle(90))) + for (auto j = tosee->spr.Angles.Yaw; j < tosee->spr.Angles.Yaw + DAngle360; j += (angincs - randomAngle(90))) { hitscan(tosee->spr.pos.plusZ(-16), tosee->sector(), DVector3(j.ToVector() * 1024, 64 - krandf(128)), hit, CLIPMASK1); @@ -4191,7 +4191,7 @@ void alterang(int ang, DDukeActor* actor, int playernum) ticselapsed = (actor->temp_data[0]) & 31; - aang = actor->spr.angle; + aang = actor->spr.Angles.Yaw; actor->vel.X += (moveptr[0] / 16 - actor->vel.X) / 5; if (actor->vel.Z < (648 / 256.)) @@ -4200,7 +4200,7 @@ void alterang(int ang, DDukeActor* actor, int playernum) } if (isRRRA() && (ang & windang)) - actor->spr.angle = WindDir; + actor->spr.Angles.Yaw = WindDir; else if (ang & seekplayer) { DDukeActor* holoduke = !isRR()? ps[playernum].holoduke_on.Get() : nullptr; @@ -4226,18 +4226,18 @@ void alterang(int ang, DDukeActor* actor, int playernum) if (angdif < DAngle45) { DAngle add = DAngle22_5 * ((krand() & 256)? 1 : -1); - actor->spr.angle += add; + actor->spr.Angles.Yaw += add; if (hits(actor) < 51.25) - actor->spr.angle -= add; + actor->spr.Angles.Yaw -= add; } } else if (ticselapsed > 18 && ticselapsed < 26) // choose { - if (angdif < DAngle90) actor->spr.angle = goalang; - else actor->spr.angle += angdif * 0.25; + if (angdif < DAngle90) actor->spr.Angles.Yaw = goalang; + else actor->spr.Angles.Yaw += angdif * 0.25; } } - else actor->spr.angle = goalang; + else actor->spr.Angles.Yaw = goalang; } if (ticselapsed < 1) @@ -4246,14 +4246,14 @@ void alterang(int ang, DDukeActor* actor, int playernum) if (ang & furthestdir) { goalang = furthestangle(actor, j); - actor->spr.angle = goalang; + actor->spr.Angles.Yaw = goalang; actor->SetOwner(ps[playernum].GetActor()); } if (ang & fleeenemy) { goalang = furthestangle(actor, j); - actor->spr.angle = goalang; + actor->spr.Angles.Yaw = goalang; } } } @@ -4414,7 +4414,7 @@ void movefta(void) // SFLAG_MOVEFTA_CHECKSEE is set for all actors in Duke. if (act->spr.pal == 33 || actorflag(act, SFLAG_MOVEFTA_CHECKSEE) || (actorflag(act, SFLAG_MOVEFTA_CHECKSEEWITHPAL8) && act->spr.pal == 8) || - (act->spr.angle.Cos() * (px - sx) + act->spr.angle.Sin() * (py - sy) >= 0)) + (act->spr.Angles.Yaw.Cos() * (px - sx) + act->spr.Angles.Yaw.Sin() * (py - sy) >= 0)) { double r1 = zrand(32); double r2 = zrand(52); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 68189536c..51db69a92 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -478,14 +478,14 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip ) { if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER && actor->spr.picnum == LIZMAN) - actor->spr.angle = randomAngle(); + actor->spr.Angles.Yaw = randomAngle(); else if ((actor->temp_data[0]&3) == 1 && actor->spr.picnum != COMMANDER) - actor->spr.angle = randomAngle(); + actor->spr.Angles.Yaw = randomAngle(); SetActor(actor,actor->spr.pos); if (dasectp == nullptr) dasectp = §or[0]; return result.setSector(dasectp); } - if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.angle += DAngle90 + DAngle45; + if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.Angles.Yaw += DAngle90 + DAngle45; } else { @@ -706,7 +706,7 @@ void movefallers_d(void) if (act->temp_data[0] == 0) { act->spr.pos.Z -= 16; - DAngle saved_angle = act->spr.angle; + DAngle saved_angle = act->spr.Angles.Yaw; int x = act->spr.extra; j = fi.ifhitbyweapon(act); if (j >= 0) @@ -735,7 +735,7 @@ void movefallers_d(void) act->spr.extra = x; } } - act->spr.angle = saved_angle; + act->spr.Angles.Yaw = saved_angle; act->spr.pos.Z += 16; } else if (act->temp_data[0] == 1) @@ -963,7 +963,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo (wal->overpicnum == MIRROR || wal->picnum == MIRROR)) { DAngle k = wal->delta().Angle(); - proj->spr.angle = k * 2 - proj->spr.angle; + proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw; proj->SetOwner(proj); spawn(proj, TRANSPORTERSTAR); return true; @@ -982,7 +982,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3 &oldpo } DAngle k = wal->delta().Angle(); - proj->spr.angle = k * 2 - proj->spr.angle; + proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw; return true; } } @@ -1080,7 +1080,7 @@ static void weaponcommon_d(DDukeActor* proj) } Collision coll; - movesprite_ex(proj, DVector3(proj->spr.angle.ToVector() * vel, velz), CLIPMASK1, coll); + movesprite_ex(proj, DVector3(proj->spr.Angles.Yaw.ToVector() * vel, velz), CLIPMASK1, coll); if (proj->spr.picnum == RPG && proj->temp_actor != nullptr) @@ -1115,7 +1115,7 @@ static void weaponcommon_d(DDukeActor* proj) for (int k = -3; k < 2; k++) { double zAdd = k * proj->vel.Z / 24; - auto spawned = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2., + auto spawned = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.Angles.Yaw.ToVector() * k * 2., FIRELASER, -40 + (k << 2), proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5); @@ -1334,7 +1334,7 @@ void movetransports_d(void) ps[k].GetActor()->spr.extra = 0; } - ps[p].angle.ang = Owner->spr.angle; + ps[p].angle.ang = Owner->spr.Angles.Yaw; if (Owner->GetOwner() != Owner) { @@ -1515,7 +1515,7 @@ void movetransports_d(void) if (k && sectlotag == 1 && act2->spr.statnum == 4) { k->vel.X = act2->vel.X * 0.5; - k->spr.angle = act2->spr.angle; + k->spr.Angles.Yaw = act2->spr.Angles.Yaw; ssp(k, CLIPMASK0); } } @@ -1528,7 +1528,7 @@ void movetransports_d(void) if (act2->spr.statnum == STAT_PROJECTILE || (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)) { act2->spr.pos += (Owner->spr.pos - act->spr.pos.XY()).plusZ(-Owner->sector()->floorz); - act2->spr.angle = Owner->spr.angle; + act2->spr.Angles.Yaw = Owner->spr.Angles.Yaw; act2->backupang(); @@ -1685,7 +1685,7 @@ static void greenslime(DDukeActor *actor) SetActor(actor, actor->spr.pos); - actor->spr.angle = ps[p].angle.ang; + actor->spr.Angles.Yaw = ps[p].angle.ang; if ((PlayerInput(p, SB_FIRE) || (ps[p].quick_kick > 0)) && ps[p].GetActor()->spr.extra > 0) if (ps[p].quick_kick > 0 || (ps[p].curr_weapon != HANDREMOTE_WEAPON && ps[p].curr_weapon != HANDBOMB_WEAPON && ps[p].curr_weapon != TRIPBOMB_WEAPON && ps[p].ammo_amount[ps[p].curr_weapon] >= 0)) @@ -1852,7 +1852,7 @@ static void greenslime(DDukeActor *actor) { s5->vel.X = 0; - actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5; + actor->spr.pos = s5->spr.pos + s5->spr.Angles.Yaw.ToVector() * 0.5; actor->spr.picnum = GREENSLIME + 2 + (global_random & 1); if (actor->spr.scale.Y < 1) actor->spr.scale.Y += (0.03125); @@ -1930,7 +1930,7 @@ static void greenslime(DDukeActor *actor) { if (actor->vel.X < 2) actor->vel.X += 0.25; actor->vel.X = 4 - BobVal(512 + actor->temp_data[1]) * 2; - actor->spr.angle += deltaangle(actor->spr.angle, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125; + actor->spr.Angles.Yaw += deltaangle(actor->spr.Angles.Yaw, (ps[p].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle()) * 0.125; // TJR } @@ -2029,7 +2029,7 @@ static void flamethrowerflame(DDukeActor *actor) } Collision coll; - movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK1, coll); + movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK1, coll); if (!actor->insector()) { @@ -2151,7 +2151,7 @@ static void heavyhbomb(DDukeActor *actor) } Collision coll; - movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); + movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); if (actor->sector()->lotag == 1 && actor->vel.Z == 0) { @@ -2194,7 +2194,7 @@ static void heavyhbomb(DDukeActor *actor) fi.checkhitwall(actor, wal, actor->spr.pos, actor->spr.picnum); DAngle k = wal->delta().Angle(); - actor->spr.angle = k * 2 - actor->spr.angle; + actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw; actor->vel.X *= 0.5; } @@ -3032,21 +3032,21 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (ps[playernum].newOwner != nullptr) goalang = (ps[playernum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[playernum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - angdif = deltaangle(actor->spr.angle, goalang) * 0.25; + angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25; if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle; - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; } if (a & spin) - actor->spr.angle += DAngle45 * BobVal(actor->temp_data[0] << 3); + actor->spr.Angles.Yaw += DAngle45 * BobVal(actor->temp_data[0] << 3); if (a & face_player_slow) { if (ps[playernum].newOwner != nullptr) goalang = (ps[playernum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[playernum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... - actor->spr.angle += angdif; + angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong... + actor->spr.Angles.Yaw += angdif; } @@ -3060,9 +3060,9 @@ void move_d(DDukeActor *actor, int playernum, int xvel) { DVector2 newpos = ps[playernum].GetActor()->spr.pos.XY() + (ps[playernum].vel.XY() * (4. / 3.)); goalang = (newpos - actor->spr.pos.XY()).Angle(); - angdif = deltaangle(actor->spr.angle, goalang) * 0.25; + angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25; if (angdif > -DAngle22_5/16 && angdif < nullAngle) angdif = nullAngle; - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; } if (actor->temp_data[1] == 0 || a == 0) @@ -3158,7 +3158,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) } daxvel = actor->vel.X; - angdif = actor->spr.angle; + angdif = actor->spr.Angles.Yaw; if (a && actor->spr.picnum != ROTATEGUN) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index bf4a454b5..0248cb100 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -392,14 +392,14 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip if (dasectp == nullptr || (dasectp != nullptr && actor->actorstayput != nullptr && actor->actorstayput != dasectp)) { if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER) - actor->spr.angle = randomAngle(); + actor->spr.Angles.Yaw = randomAngle(); else if ((actor->temp_data[0] & 3) == 1) - actor->spr.angle = randomAngle(); + actor->spr.Angles.Yaw = randomAngle(); SetActor(actor, actor->spr.pos); if (dasectp == nullptr) dasectp = §or[0]; return result.setSector(dasectp); } - if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.angle += DAngle45 + DAngle90; + if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.Angles.Yaw += DAngle45 + DAngle90; } else { @@ -576,7 +576,7 @@ void movefallers_r(void) if (act->temp_data[0] == 0) { act->spr.pos.Z -= 16; - DAngle saved_angle = act->spr.angle; + DAngle saved_angle = act->spr.Angles.Yaw; int x = act->spr.extra; int j = fi.ifhitbyweapon(act); if (j >= 0) @@ -605,7 +605,7 @@ void movefallers_r(void) act->spr.extra = x; } } - act->spr.angle = saved_angle; + act->spr.Angles.Yaw = saved_angle; act->spr.pos.Z += 16; } else if (act->temp_data[0] == 1) @@ -726,18 +726,18 @@ static void chickenarrow(DDukeActor* actor) { DAngle ang, ang2; ang = (ts->spr.pos - actor->spr.pos).Angle(); - ang2 = deltaangle(ang, actor->spr.angle); + ang2 = deltaangle(ang, actor->spr.Angles.Yaw); // this was quite broken in the original code. Fixed so that it seeks properly if (abs(ang2) < DAngle1 * 17.5) { - actor->spr.angle = ang; + actor->spr.Angles.Yaw = ang; } else if (ang2 > nullAngle) { - actor->spr.angle -= DAngle1 * 9; + actor->spr.Angles.Yaw -= DAngle1 * 9; } else - actor->spr.angle += DAngle1 * 9; + actor->spr.Angles.Yaw += DAngle1 * 9; if (actor->spr.hitag > 180) if (actor->vel.Z <= 0) @@ -836,7 +836,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo if (proj->spr.picnum != RPG && (!isRRRA() || proj->spr.picnum != RPG2) && proj->spr.picnum != FREEZEBLAST && proj->spr.picnum != SPIT && proj->spr.picnum != SHRINKSPARK && (wal->overpicnum == MIRROR || wal->picnum == MIRROR)) { DAngle walang = wal->delta().Angle(); - proj->spr.angle = walang * 2 - proj->spr.angle; + proj->spr.Angles.Yaw = walang * 2 - proj->spr.Angles.Yaw; proj->SetOwner(proj); spawn(proj, TRANSPORTERSTAR); return true; @@ -859,7 +859,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo } DAngle walang = wal->delta().Angle(); - proj->spr.angle = walang * 2 - proj->spr.angle; + proj->spr.Angles.Yaw = walang * 2 - proj->spr.Angles.Yaw; return true; } if (proj->spr.picnum == SHRINKSPARK) @@ -870,7 +870,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo } if (proj->spr.extra <= 0) { - proj->spr.pos += proj->spr.angle.ToVector() * 8; + proj->spr.pos += proj->spr.Angles.Yaw.ToVector() * 8; auto Owner = proj->GetOwner(); if (!isRRRA() || !Owner || (Owner->spr.picnum != CHEER && Owner->spr.picnum != CHEERSTAYPUT)) { @@ -879,7 +879,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo { j->spr.scale = DVector2(0.125, 0.125); j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL; - j->spr.angle += DAngle90; + j->spr.Angles.Yaw += DAngle90; j->clipdist = proj->spr.scale.X * tileWidth(proj->spr.picnum) * 0.125; } } @@ -893,7 +893,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo } DAngle k = wal->delta().Angle(); - proj->spr.angle = k * 2 - proj->spr.angle; + proj->spr.Angles.Yaw = k * 2 - proj->spr.Angles.Yaw; return true; } } @@ -1006,7 +1006,7 @@ static void weaponcommon_r(DDukeActor *proj) } Collision coll; - movesprite_ex(proj, DVector3(proj->spr.angle.ToVector() * vel, velz), CLIPMASK1, coll); + movesprite_ex(proj, DVector3(proj->spr.Angles.Yaw.ToVector() * vel, velz), CLIPMASK1, coll); if ((proj->spr.picnum == RPG || (isRRRA() && isIn(proj->spr.picnum, RPG2, RRTILE1790))) && proj->temp_actor != nullptr) if ((proj->spr.pos.XY() - proj->temp_actor->spr.pos.XY()).Length() < 16) @@ -1039,7 +1039,7 @@ static void weaponcommon_r(DDukeActor *proj) for (int k = -3; k < 2; k++) { double zAdd = k * proj->vel.Z / 24; - auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2., + auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.Angles.Yaw.ToVector() * k * 2., FIRELASER, -40 + (k << 2), proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5); @@ -1222,7 +1222,7 @@ void movetransports_r(void) ps[k].GetActor()->spr.extra = 0; } - ps[p].angle.ang = Owner->spr.angle; + ps[p].angle.ang = Owner->spr.Angles.Yaw; if (Owner->GetOwner() != Owner) { @@ -1430,7 +1430,7 @@ void movetransports_r(void) if (spawned && sectlotag == 1 && act2->spr.statnum == 4) { spawned->vel.X = act2->vel.X * 0.5; - spawned->spr.angle = act2->spr.angle; + spawned->spr.Angles.Yaw = act2->spr.Angles.Yaw; ssp(spawned, CLIPMASK0); } } @@ -1443,7 +1443,7 @@ void movetransports_r(void) if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1) { act2->spr.pos += (Owner->spr.pos - act->spr.pos.XY()).plusZ(-Owner->sector()->floorz); - act2->spr.angle = Owner->spr.angle; + act2->spr.Angles.Yaw = Owner->spr.Angles.Yaw; act2->backupang(); @@ -1496,7 +1496,7 @@ void movetransports_r(void) ChangeActorSect(act2, Owner->sector()); - movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll); + movesprite_ex(act2, DVector3(act2->spr.Angles.Yaw.ToVector() * act2->vel.X, 0), CLIPMASK1, coll); break; case 161: @@ -1507,7 +1507,7 @@ void movetransports_r(void) ChangeActorSect(act2, Owner->sector()); - movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll); + movesprite_ex(act2, DVector3(act2->spr.Angles.Yaw.ToVector() * act2->vel.X, 0), CLIPMASK1, coll); break; } @@ -1700,7 +1700,7 @@ static void rrra_specialstats() if (act->spr.extra == act->spr.lotag) S_PlaySound(183); act->spr.extra--; - int j = movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll); + int j = movesprite_ex(act, DVector3(act->spr.Angles.Yaw.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll); if (j > 0) { S_PlayActorSound(PIPEBOMB_EXPLODE, act); @@ -1945,7 +1945,7 @@ void rr_specialstats() { if (act2->spr.picnum == RRTELEPORTDEST) { - ps[p].angle.ang = act2->spr.angle; + ps[p].angle.ang = act2->spr.Angles.Yaw; ps[p].GetActor()->spr.pos = act2->spr.pos.plusZ(-36 + gs.playerheight); ps[p].GetActor()->backuppos(); ps[p].setbobpos(); @@ -2032,7 +2032,7 @@ static void heavyhbomb(DDukeActor *actor) } Collision coll; - movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); + movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); if (actor->sector()->lotag == 1 && actor->vel.Z == 0) { @@ -2094,7 +2094,7 @@ static void heavyhbomb(DDukeActor *actor) goto DETONATEB; } DAngle k = wal->delta().Angle(); - actor->spr.angle = k * 2 - actor->spr.angle; + actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw; actor->vel.X *= 0.5; } @@ -2217,13 +2217,13 @@ static int henstand(DDukeActor *actor) { makeitfall(actor); Collision coll; - movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); + movesprite_ex(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll); if (coll.type) { if (coll.type == kHitWall) { DAngle k = coll.hitWall->delta().Angle(); - actor->spr.angle = k * 2 - actor->spr.angle; + actor->spr.Angles.Yaw = k * 2 - actor->spr.Angles.Yaw; } else if (coll.type == kHitSprite) { @@ -2238,7 +2238,7 @@ static int henstand(DDukeActor *actor) { ns->vel.X = 2; ns->spr.lotag = 40; - ns->spr.angle = actor->spr.angle; + ns->spr.Angles.Yaw = actor->spr.Angles.Yaw; } } } @@ -2409,7 +2409,7 @@ void moveactors_r(void) if (!isRRRA() || (sectp->lotag != 1 && sectp->lotag != 160)) if (act->vel.X != 0) { - movesprite_ex(act, DVector3(act->spr.angle.ToVector()* act->vel.X, act->vel.Z), CLIPMASK0, coll); + movesprite_ex(act, DVector3(act->spr.Angles.Yaw.ToVector()* act->vel.X, act->vel.Z), CLIPMASK0, coll); act->vel.X -= 1. / 16.; } break; @@ -3020,21 +3020,21 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (ps[pnum].newOwner != nullptr) goalang = (ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - angdif = deltaangle(actor->spr.angle, goalang) * 0.25; + angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25; if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle; - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; } if (a & spin) - actor->spr.angle += DAngle45 * BobVal(actor->temp_data[0] << 3); + actor->spr.Angles.Yaw += DAngle45 * BobVal(actor->temp_data[0] << 3); if (a & face_player_slow) { if (ps[pnum].newOwner != nullptr) goalang = (ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle(); else goalang = (ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... - actor->spr.angle += angdif; + angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong... + actor->spr.Angles.Yaw += angdif; } if (isRRRA()) @@ -3044,8 +3044,8 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (ps[pnum].newOwner != nullptr) goalang = ((ps[pnum].GetActor()->opos.XY() - actor->spr.pos.XY()).Angle() + DAngle180); else goalang = ((ps[pnum].GetActor()->spr.pos.XY() - actor->spr.pos.XY()).Angle() + DAngle180); - angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong... - actor->spr.angle += angdif; + angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.Angles.Yaw, goalang).Degrees()); // this looks very wrong... + actor->spr.Angles.Yaw += angdif; } if ((a & jumptoplayer) == jumptoplayer) @@ -3104,9 +3104,9 @@ void move_r(DDukeActor *actor, int pnum, int xvel) { DVector2 newpos = ps[pnum].GetActor()->spr.pos.XY() + (ps[pnum].vel.XY() * (4. / 3.)); goalang = (newpos - actor->spr.pos.XY()).Angle(); - angdif = deltaangle(actor->spr.angle, goalang) * 0.25; + angdif = deltaangle(actor->spr.Angles.Yaw, goalang) * 0.25; if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle; - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; } if (actor->temp_data[1] == 0 || a == 0) @@ -3191,7 +3191,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) } daxvel = actor->vel.X; - angdif = actor->spr.angle; + angdif = actor->spr.Angles.Yaw; if (a) { diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index e142e1ac5..4abe183c0 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -86,7 +86,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; } - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -174,7 +174,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (actorflag(h, SFLAG2_INTERPOLATEANGLE)) { - t->angle = h->interpolatedangle(interpfrac); + t->Angles.Yaw = h->interpolatedangle(interpfrac); } @@ -237,8 +237,8 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->scale = DVector2(0, 0); else { - t->angle = (viewVec - t->pos.XY()).Angle(); - t->pos.XY() = OwnerAc->spr.pos.XY() + t->angle.ToVector(); + t->Angles.Yaw = (viewVec - t->pos.XY()).Angle(); + t->pos.XY() = OwnerAc->spr.pos.XY() + t->Angles.Yaw.ToVector(); } } break; @@ -263,7 +263,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -281,7 +281,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { @@ -367,7 +367,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else { - k = angletorotation1(h->spr.angle, viewang); + k = angletorotation1(h->spr.Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -467,12 +467,12 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else switch (l) { case 2: - k = angletorotation1(h->spr.angle, viewang, 8, 1); + k = angletorotation1(h->spr.Angles.Yaw, viewang, 8, 1); break; case 3: case 4: - k = angletorotation1(h->spr.angle, viewang, 7); + k = angletorotation1(h->spr.Angles.Yaw, viewang, 7); if (k > 3) { t->cstat |= CSTAT_SPRITE_XFLIP; @@ -483,7 +483,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case 5: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.angle, kang); + k = angletorotation1(h->spr.Angles.Yaw, kang); if (k > 4) { k = 8 - k; @@ -493,7 +493,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case 7: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -502,7 +502,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 8: - k = angletorotation1(h->spr.angle, viewang); + k = angletorotation1(h->spr.Angles.Yaw, viewang); t->cstat &= ~CSTAT_SPRITE_XFLIP; break; default: @@ -624,7 +624,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else { - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -667,7 +667,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->picnum = OwnerAc->dispicnum; t->pal = OwnerAc->spr.pal; t->shade = OwnerAc->spr.shade; - t->angle = OwnerAc->spr.angle; + t->Angles.Yaw = OwnerAc->spr.Angles.Yaw; t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat; } } @@ -680,7 +680,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; } - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 34ee12ed2..b01d7efbe 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -64,7 +64,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case CHAIR3: - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -154,7 +154,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (actorflag(h, SFLAG2_INTERPOLATEANGLE)) { - t->angle = h->interpolatedangle(interpfrac); + t->Angles.Yaw = h->interpolatedangle(interpfrac); } @@ -228,8 +228,8 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->scale = DVector2(0, 0); else { - t->angle = (viewVec - t->pos.XY()).Angle(); - t->pos.XY() = OwnerAc->spr.pos.XY() + t->angle.ToVector(); + t->Angles.Yaw = (viewVec - t->pos.XY()).Angle(); + t->pos.XY() = OwnerAc->spr.pos.XY() + t->Angles.Yaw.ToVector(); } } break; @@ -269,7 +269,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else if (OwnerAc->spr.picnum == MAMA) { kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.angle, kang); + k = angletorotation1(h->spr.Angles.Yaw, kang); if (k > 4) { k = 8 - k; @@ -287,7 +287,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case EMPTYBIKE: if (!isRRRA()) goto default_case; kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -299,7 +299,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case EMPTYBOAT: if (!isRRRA()) goto default_case; kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -310,7 +310,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case RPG: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -322,7 +322,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case RPG2: if (!isRRRA()) goto default_case; kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -335,7 +335,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case RECON: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { @@ -422,7 +422,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->cstat &= ~CSTAT_SPRITE_XFLIP; } else { - k = angletorotation1(h->spr.angle, viewang); + k = angletorotation1(h->spr.Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -484,7 +484,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else if (ps[p].OnMotorcycle) { - k = angletorotation2(h->spr.angle, viewang); + k = angletorotation2(h->spr.Angles.Yaw, viewang); if (k > 6) { k = 12 - k; @@ -508,7 +508,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi } else if (ps[p].OnBoat) { - k = angletorotation2(h->spr.angle, viewang); + k = angletorotation2(h->spr.Angles.Yaw, viewang); if (k > 6) { @@ -606,12 +606,12 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else switch (l) { case 2: - k = angletorotation1(h->spr.angle, viewang, 8, 1); + k = angletorotation1(h->spr.Angles.Yaw, viewang, 8, 1); break; case 3: case 4: - k = angletorotation1(h->spr.angle, viewang, 7); + k = angletorotation1(h->spr.Angles.Yaw, viewang, 7); if (k > 3) { t->cstat |= CSTAT_SPRITE_XFLIP; @@ -622,7 +622,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case 5: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.angle, kang); + k = angletorotation1(h->spr.Angles.Yaw, kang); if (k > 4) { k = 8 - k; @@ -632,7 +632,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case 7: kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation2(h->spr.angle, kang); + k = angletorotation2(h->spr.Angles.Yaw, kang); if (k > 6) { k = 12 - k; @@ -641,7 +641,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 8: - k = angletorotation1(h->spr.angle, viewang); + k = angletorotation1(h->spr.Angles.Yaw, viewang); t->cstat &= ~CSTAT_SPRITE_XFLIP; break; default: @@ -649,7 +649,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (bg && h->spr.statnum == 2 && h->spr.extra > 0) { kang = (h->spr.pos - viewVec).Angle(); - k = angletorotation1(h->spr.angle, kang); + k = angletorotation1(h->spr.Angles.Yaw, kang); if (k > 4) { k = 8 - k; @@ -869,7 +869,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi break; case PLAYERONWATER: - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; @@ -915,14 +915,14 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->picnum = OwnerAc->dispicnum; t->pal = OwnerAc->spr.pal; t->shade = OwnerAc->spr.shade; - t->angle = OwnerAc->spr.angle; + t->Angles.Yaw = OwnerAc->spr.Angles.Yaw; t->cstat = CSTAT_SPRITE_TRANSLUCENT | OwnerAc->spr.cstat; } } break; case RAT: - k = angletorotation1(t->angle, viewang); + k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/bowling.cpp b/source/games/duke/src/bowling.cpp index cde04afdc..a45ce8fb4 100644 --- a/source/games/duke/src/bowling.cpp +++ b/source/games/duke/src/bowling.cpp @@ -182,7 +182,7 @@ void resetpins(sectortype* sect) { spawned->spr.lotag = a2->spr.lotag; spawned->clipdist = 12; // random formula here was bogus and always produced 48. - spawned->spr.angle -= DAngle22_5 * 0.125 * (((krand() & 32) - (krand() & 64)) >> 5); // weird formula to preserve number of krand calls. + spawned->spr.Angles.Yaw -= DAngle22_5 * 0.125 * (((krand() & 32) - (krand() & 64)) >> 5); // weird formula to preserve number of krand calls. } } if (a2->spr.picnum == 280) diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 9afc60070..77c477483 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -98,7 +98,7 @@ static int ccmd_spawn(CCmdFuncPtr parm) { if (set & 1) spawned->spr.pal = (uint8_t)pal; if (set & 2) spawned->spr.cstat = ESpriteFlags::FromInt(cstat); - if (set & 4) spawned->spr.angle = ang; + if (set & 4) spawned->spr.Angles.Yaw = ang; if (set & 8) SetActor(spawned, DVector3( x, y, z )); if (spawned->sector() == nullptr) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index cef470e0c..1ffc92e0d 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -59,7 +59,7 @@ std::pair GameInterface::GetCoordinates() { auto pActor = ps[screenpeek].GetActor(); if (!pActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle); - return std::make_pair(pActor->spr.pos, pActor->spr.angle); + return std::make_pair(pActor->spr.pos, pActor->spr.Angles.Yaw); } GameStats GameInterface::getStats() @@ -436,7 +436,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, double j = clamp(czoom * act->spr.scale.Y + abs(pp.truefz - pp.GetActor()->getOffsetZ()) * REPEAT_SCALE, 0.333, 2.); auto const vec = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim); - auto const daang = -((!SyncInput() ? act->spr.angle : act->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees(); + auto const daang = -((!SyncInput() ? act->spr.Angles.Yaw : act->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees(); DrawTexture(twod, tileGetTexture(i), vec.X, vec.Y, DTA_TranslationIndex, TRANSLATION(Translation_Remap + setpal(&pp), act->spr.pal), DTA_CenterOffset, true, DTA_Rotate, daang, DTA_Color, shadeToLight(act->spr.shade), DTA_ScaleX, j, DTA_ScaleY, j, TAG_DONE); diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 486918ea0..53eaf8dbf 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -1225,8 +1225,8 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, else*/ SetGameVarID(lVar2, act->spr.statnum, sActor, sPlayer); break; case ACTOR_ANG: - if (bSet) act->spr.angle = DAngle::fromBuild(lValue); - else SetGameVarID(lVar2, act->spr.angle.Buildang(), sActor, sPlayer); + if (bSet) act->spr.Angles.Yaw = DAngle::fromBuild(lValue); + else SetGameVarID(lVar2, act->spr.Angles.Yaw.Buildang(), sActor, sPlayer); break; case ACTOR_OWNER: // there is no way to handle this well because we do not know whether this is an actor or not. Pity. @@ -1409,18 +1409,18 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x) return 0; else { - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; hs = hitasprite(actor, &hit); - actor->spr.angle -= angdif; + actor->spr.Angles.Yaw -= angdif; if (hs > sclip) { if (hit != nullptr && hit->spr.picnum == actor->spr.picnum) return 0; else { - actor->spr.angle += angdif; + actor->spr.Angles.Yaw += angdif; hs = hitasprite(actor, &hit); - actor->spr.angle -= angdif; + actor->spr.Angles.Yaw -= angdif; if (hs > 48) { if (hit != nullptr && hit->spr.picnum == actor->spr.picnum) @@ -1556,7 +1556,7 @@ int ParseState::parse(void) g_ac->spr.hitag = ScriptCode[g_t[5] + 2]; // Ai g_t[0] = g_t[2] = g_t[3] = 0; if (g_ac->spr.hitag & random_angle) - g_ac->spr.angle = randomAngle(); + g_ac->spr.Angles.Yaw = randomAngle(); insptr++; break; case concmd_action: @@ -1596,10 +1596,10 @@ int ParseState::parse(void) switch (krand() & 1) { case 0: - g_ac->spr.angle += DAngle90 + randomAngle(90); + g_ac->spr.Angles.Yaw += DAngle90 + randomAngle(90); break; case 1: - g_ac->spr.angle -= DAngle90 + randomAngle(90); + g_ac->spr.Angles.Yaw -= DAngle90 + randomAngle(90); break; } insptr++; @@ -1610,7 +1610,7 @@ int ParseState::parse(void) break; case concmd_rndmove: - g_ac->spr.angle = randomAngle(); + g_ac->spr.Angles.Yaw = randomAngle(); g_ac->vel.X = 25/16.; insptr++; break; @@ -1972,11 +1972,11 @@ int ParseState::parse(void) break; case concmd_strafeleft: insptr++; - movesprite_ex(g_ac, DVector3(-g_ac->spr.angle.Sin(), g_ac->spr.angle.Cos(), g_ac->vel.Z), CLIPMASK0, coll); + movesprite_ex(g_ac, DVector3(-g_ac->spr.Angles.Yaw.Sin(), g_ac->spr.Angles.Yaw.Cos(), g_ac->vel.Z), CLIPMASK0, coll); break; case concmd_straferight: insptr++; - movesprite_ex(g_ac, DVector3(g_ac->spr.angle.Sin(), -g_ac->spr.angle.Cos(), g_ac->vel.Z), CLIPMASK0, coll); + movesprite_ex(g_ac, DVector3(g_ac->spr.Angles.Yaw.Sin(), -g_ac->spr.Angles.Yaw.Cos(), g_ac->vel.Z), CLIPMASK0, coll); break; case concmd_larrybird: insptr++; @@ -2121,7 +2121,7 @@ int ParseState::parse(void) g_ac->spr.hitag = *insptr; insptr++; if(g_ac->spr.hitag&random_angle) - g_ac->spr.angle = randomAngle(); + g_ac->spr.Angles.Yaw = randomAngle(); break; case concmd_spawn: insptr++; @@ -2486,7 +2486,7 @@ int ParseState::parse(void) if( g_ac->sector()->lotag == 0 ) { HitInfo hit{}; - neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.angle, hit, 48, NT_Lotag | NT_NoSpriteCheck); + neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.Angles.Yaw, hit, 48, NT_Lotag | NT_NoSpriteCheck); auto sectp = hit.hitSector; if (sectp) { @@ -2833,7 +2833,7 @@ int ParseState::parse(void) case concmd_ifangdiffl: { insptr++; - auto ang = absangle(ps[g_p].angle.ang, g_ac->spr.angle); + auto ang = absangle(ps[g_p].angle.ang, g_ac->spr.Angles.Yaw); parseifelse( ang <= mapangle(*insptr)); break; } @@ -3147,7 +3147,7 @@ int ParseState::parse(void) int i; insptr++; i = *(insptr++); // ID of def - SetGameVarID(i, g_ac->spr.angle.Buildang(), g_ac, g_p); + SetGameVarID(i, g_ac->spr.Angles.Yaw.Buildang(), g_ac, g_p); break; } case concmd_setactorangle: @@ -3155,7 +3155,7 @@ int ParseState::parse(void) int i; insptr++; i = *(insptr++); // ID of def - g_ac->spr.angle = DAngle::fromBuild(GetGameVarID(i, g_ac, g_p).safeValue() & 2047); + g_ac->spr.Angles.Yaw = DAngle::fromBuild(GetGameVarID(i, g_ac, g_p).safeValue() & 2047); break; } case concmd_randvar: diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index db6efd5af..fe2837022 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -278,7 +278,7 @@ inline void applyRotation1(DDukeActor* h, tspritetype* t, DAngle viewang) return; } - int k = angletorotation1(t->angle, viewang); + int k = angletorotation1(t->Angles.Yaw, viewang); if (k > 4) { k = 8 - k; diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 7ffd9d38a..b9af0da20 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -843,7 +843,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju p->angle.processhelpers(scaleAdjust); p->horizon.processhelpers(scaleAdjust); - p->GetActor()->spr.angle = p->angle.ang; + p->GetActor()->spr.Angles.Yaw = p->angle.ang; } if (packet) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index a6c8349ce..b473457fb 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -171,7 +171,7 @@ double hits(DDukeActor* actor) else zoff = 0; auto pos = actor->spr.pos; - hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1); + hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1); return (hit.hitpos.XY() - actor->spr.pos.XY()).Length(); } @@ -192,7 +192,7 @@ double hitasprite(DDukeActor* actor, DDukeActor** hitsp) else zoff = 0; auto pos = actor->spr.pos; - hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1); + hitscan(pos.plusZ(-zoff), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1); if (hitsp) *hitsp = hit.actor(); if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor)) @@ -231,7 +231,7 @@ DDukeActor* aim(DDukeActor* actor, int abase) bool gotshrinker, gotfreezer; static const int aimstats[] = { STAT_PLAYER, STAT_DUMMYPLAYER, STAT_ACTOR, STAT_ZOMBIEACTOR }; - DAngle a = actor->spr.angle; + DAngle a = actor->spr.Angles.Yaw; // Autoaim from DukeGDX. if (actor->isPlayer()) @@ -248,7 +248,7 @@ DDukeActor* aim(DDukeActor* actor, int abase) setFreeAimVelocity(vel, zvel, plr->horizon.sum(), 16.); HitInfo hit{}; - hitscan(plr->GetActor()->getPosWithOffsetZ().plusZ(4), actor->sector(), DVector3(actor->spr.angle.ToVector() * vel, zvel), hit, CLIPMASK1); + hitscan(plr->GetActor()->getPosWithOffsetZ().plusZ(4), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * vel, zvel), hit, CLIPMASK1); if (hit.actor() != nullptr) { @@ -1051,7 +1051,7 @@ void shootbloodsplat(DDukeActor* actor, int p, const DVector3& pos, DAngle ang, if (spawned) { spawned->vel.X = -0.75; - spawned->spr.angle = hit.hitWall->delta().Angle() - DAngle90; + spawned->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90; spawned->spr.pos = hit.hitpos; spawned->spr.cstat |= randomXFlip(); ssp(spawned, CLIPMASK0); diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index b6f995946..ff7493993 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -168,7 +168,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng zvel = (((ps[j].GetActor()->getPrevOffsetZ() - spos.Z) * vel) / dist); if (badguy(actor) && (actor->spr.hitag & face_player_smart) != 0) - sang = actor->spr.angle + mapangle((krand() & 31) - 16); + sang = actor->spr.Angles.Yaw + mapangle((krand() & 31) - 16); if (actor->sector()->lotag == 2 && (krand() % 5) == 0) spawned = spawn(actor, WATERBUBBLE); @@ -203,7 +203,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng spawned->spr.pos.Z--; spawned->setsector(actor->sector()); spawned->spr.cstat = CSTAT_SPRITE_YCENTER; - spawned->spr.angle = sang; + spawned->spr.Angles.Yaw = sang; spawned->spr.scale = DVector2(0.03125, 0.03125); spawned->clipdist = 10; spawned->spr.yint = p; @@ -294,7 +294,7 @@ static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang) if (splash) { splash->spr.pos.XY() = hit.hitpos.XY(); - splash->spr.angle = ps[p].angle.ang; // Total tweek + splash->spr.Angles.Yaw = ps[p].angle.ang; // Total tweek splash->vel.X = 2; ssp(actor, CLIPMASK0); splash->vel.X = 0; @@ -442,7 +442,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int jib->spr.pos.Z += 4; jib->vel.X = 1; jib->spr.scale = DVector2(0.375, 0.375); - jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5); + jib->spr.Angles.Yaw += DAngle22_5 / 2 - randomAngle(22.5); } } else spawn(spark, SMALLSMOKE); @@ -511,7 +511,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int if (hole) { hole->vel.X = -1 / 16.; - hole->spr.angle = hit.hitWall->delta().Angle() - DAngle90; + hole->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90; ssp(hole, CLIPMASK0); hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL; } @@ -638,14 +638,14 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a spawned->vel.X = 64; ssp(spawned, CLIPMASK0); spawned->vel.X = ovel; - spawned->spr.angle += DAngle22_5 - randomAngle(45); + spawned->spr.Angles.Yaw += DAngle22_5 - randomAngle(45); } } spawned->spr.cstat = CSTAT_SPRITE_YCENTER; spawned->clipdist = 1; - ang = actor->spr.angle + DAngle22_5 / 4 - randomAngle(22.5 / 2); + ang = actor->spr.Angles.Yaw + DAngle22_5 / 4 - randomAngle(22.5 / 2); zvel = oldzvel + 2 - krandf(4); scount--; @@ -715,7 +715,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw zvel = ((ps[j].GetActor()->getPrevOffsetZ() - pos.Z) * vel) / dist; if (badguy(actor) && (actor->spr.hitag & face_player_smart)) - ang = actor->spr.angle + randomAngle(DAngle22_5 / 4) - DAngle22_5 / 8; + ang = actor->spr.Angles.Yaw + randomAngle(DAngle22_5 / 4) - DAngle22_5 / 8; } if (p < 0) aimed = nullptr; @@ -755,7 +755,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw } spawned->spr.pos += spawnofs; - spawned->spr.angle += aoffs; + spawned->spr.Angles.Yaw += aoffs; spawned->spr.scale = DVector2(0.65625, 0.65625); } @@ -771,7 +771,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw } spawned->spr.pos += spawnofs; - spawned->spr.angle += aoffs; + spawned->spr.Angles.Yaw += aoffs; spawned->spr.scale = DVector2(0.375, 0.375); } @@ -784,7 +784,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw else if ((isWW2GI() && aplWeaponWorksLike(ps[p].curr_weapon, p) == DEVISTATOR_WEAPON) || (!isWW2GI() && ps[p].curr_weapon == DEVISTATOR_WEAPON)) { spawned->spr.extra >>= 2; - spawned->spr.angle += DAngle22_5 / 8 - randomAngle(22.5 / 4); + spawned->spr.Angles.Yaw += DAngle22_5 / 8 - randomAngle(22.5 / 4); spawned->vel.Z += 1 - krandf(2); if (ps[p].hbomb_hold_delay) @@ -872,8 +872,8 @@ static void shootlaser(DDukeActor* actor, int p, DVector3 pos, DAngle ang) ssp(bomb, CLIPMASK0); bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL; auto delta = -hit.hitWall->delta(); - bomb->spr.angle = delta.Angle() - DAngle90; - bomb->temp_angle = bomb->spr.angle; + bomb->spr.Angles.Yaw = delta.Angle() - DAngle90; + bomb->temp_angle = bomb->spr.Angles.Yaw; if (p >= 0) ps[p].ammo_amount[TRIPBOMB_WEAPON]--; @@ -1078,7 +1078,7 @@ void shoot_d(DDukeActor* actor, int atwith) } else { - sang = actor->spr.angle; + sang = actor->spr.Angles.Yaw; spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tileHeight(actor->spr.picnum) * 0.5) + 4); if (actor->spr.picnum != ROTATEGUN) @@ -1111,7 +1111,7 @@ void shoot_d(DDukeActor* actor, int atwith) { k->setsector(sect); k->spr.pos = spos; - k->spr.angle = sang; + k->spr.Angles.Yaw = sang; k->vel.X = 500 / 16.; k->vel.Z = 0; } @@ -2226,7 +2226,7 @@ static void operateweapon(int snum, ESyncBits actions) double hd = hits(pact); if (hd < 32) { - spawned->spr.angle += DAngle180; + spawned->spr.Angles.Yaw += DAngle180; spawned->vel *= 1./3.; } @@ -2353,9 +2353,9 @@ static void operateweapon(int snum, ESyncBits actions) auto j = spawn(pact, SHOTGUNSHELL); if (j) { - j->spr.angle += DAngle180; + j->spr.Angles.Yaw += DAngle180; ssp(j, CLIPMASK0); - j->spr.angle -= DAngle180; + j->spr.Angles.Yaw -= DAngle180; } p->kickback_pic++; break; @@ -2387,7 +2387,7 @@ static void operateweapon(int snum, ESyncBits actions) auto j = spawn(pact, SHELL); if (j) { - j->spr.angle += DAngle180; + j->spr.Angles.Yaw += DAngle180; j->vel.X += 2.; j->spr.pos.Z += 3; ssp(j, CLIPMASK0); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 89e8a9ab9..8f68c77c6 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -185,7 +185,7 @@ static void shootmelee(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int a if (splash) { splash->spr.pos.XY() = hit.hitpos.XY(); - splash->spr.angle = ps[p].angle.ang; // Total tweek + splash->spr.Angles.Yaw = ps[p].angle.ang; // Total tweek splash->vel.X = 2; ssp(actor, 0); splash->vel.X = 0; @@ -336,7 +336,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int jib->spr.pos.Z += 4; jib->vel.X = 1; jib->spr.scale = DVector2(0.375, 0.375); - jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5); + jib->spr.Angles.Yaw += DAngle22_5 / 2 - randomAngle(22.5); } } else spawn(spark, SMALLSMOKE); @@ -409,7 +409,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int if (hole) { hole->vel.X = -1 / 16; - hole->spr.angle = hit.hitWall->delta().Angle() - DAngle90; + hole->spr.Angles.Yaw = hit.hitWall->delta().Angle() - DAngle90; ssp(hole, CLIPMASK0); hole->spr.cstat2 |= CSTAT2_SPRITE_DECAL; } @@ -486,7 +486,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a pos.Z -= 4; if (actor->spr.picnum == 4649) { - pos += (actor->spr.angle + DAngle45).ToVector() * 16; + pos += (actor->spr.Angles.Yaw + DAngle45).ToVector() * 16; pos.Z += 12; } if (actor->spr.picnum == VIXEN) @@ -499,7 +499,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a { auto aimed = aim(actor, AUTO_AIM_ANGLE); - pos += (actor->spr.angle + DAngle22_5 * 1.25).ToVector() * 16; + pos += (actor->spr.Angles.Yaw + DAngle22_5 * 1.25).ToVector() * 16; if (aimed) { @@ -545,7 +545,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a spawned->spr.cstat = CSTAT_SPRITE_YCENTER; spawned->clipdist = 1; - ang = actor->spr.angle + DAngle22_5 / 4 + randomAngle(22.5 / 2); + ang = actor->spr.Angles.Yaw + DAngle22_5 / 4 + randomAngle(22.5 / 2); zvel = oldzvel + 2 - krandf(4); if (atwith == FIRELASER) @@ -626,7 +626,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw zvel = ((ps[j].GetActor()->getPrevOffsetZ() - pos.Z) * vel) / dist; if (badguy(actor) && (actor->spr.hitag & face_player_smart)) - ang = actor->spr.angle + randomAngle(22.5 / 4) - DAngle22_5 / 8; + ang = actor->spr.Angles.Yaw + randomAngle(22.5 / 4) - DAngle22_5 / 8; } if (p < 0) aimed = nullptr; @@ -681,7 +681,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw else if (ps[p].curr_weapon == TIT_WEAPON) { spawned->spr.extra >>= 2; - spawned->spr.angle += DAngle22_5 / 8 - randomAngle(DAngle22_5 / 4); + spawned->spr.Angles.Yaw += DAngle22_5 / 8 - randomAngle(DAngle22_5 / 4); spawned->vel.Z += 1 - krandf(2); if (ps[p].hbomb_hold_delay) @@ -772,7 +772,7 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at spawned->spr.cstat = CSTAT_SPRITE_YCENTER; spawned->clipdist = 1; - ang = actor->spr.angle + DAngle22_5/4 - randomAngle(DAngle22_5/2); + ang = actor->spr.Angles.Yaw + DAngle22_5/4 - randomAngle(DAngle22_5/2); zvel = oldzvel + 2 - krandf(4); scount--; @@ -829,7 +829,7 @@ void shoot_r(DDukeActor* actor, int atwith) else { p = -1; - sang = actor->spr.angle; + sang = actor->spr.Angles.Yaw; spos = actor->spr.pos.plusZ(-(actor->spr.scale.Y * tileHeight(actor->spr.picnum) * 0.5) - 3); if (badguy(actor)) @@ -876,7 +876,7 @@ void shoot_r(DDukeActor* actor, int atwith) if (j) { j->vel.X = 2; - j->spr.angle = actor->spr.angle; + j->spr.Angles.Yaw = actor->spr.Angles.Yaw; j->spr.pos.Z -= 5; } break; @@ -887,7 +887,7 @@ void shoot_r(DDukeActor* actor, int atwith) if (j) { j->vel.X = 250 / 16.; - j->spr.angle = actor->spr.angle; + j->spr.Angles.Yaw = actor->spr.Angles.Yaw; j->spr.pos.Z -= 15; } break; @@ -1467,7 +1467,7 @@ void checkweapons_r(player_struct* p) auto j = spawn(p->GetActor(), 7220); if (j) { - j->spr.angle = p->angle.ang; + j->spr.Angles.Yaw = p->angle.ang; j->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON]; } p->OnMotorcycle = 0; @@ -1486,7 +1486,7 @@ void checkweapons_r(player_struct* p) auto j = spawn(p->GetActor(), 7233); if (j) { - j->spr.angle = p->angle.ang; + j->spr.Angles.Yaw = p->angle.ang; j->saved_ammo = p->ammo_amount[BOAT_WEAPON]; } p->OnBoat = 0; @@ -2697,7 +2697,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) double hd = hits(p->GetActor()); if (hd < 32) { - spawned->spr.angle += DAngle180; + spawned->spr.Angles.Yaw += DAngle180; spawned->vel *= 1./3.; } @@ -2909,7 +2909,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) if (j) { - j->spr.angle += DAngle180; + j->spr.Angles.Yaw += DAngle180; j->vel.X += 2.; j->spr.pos.Z += 3; ssp(j, CLIPMASK0); @@ -3949,7 +3949,7 @@ void OnMotorcycle(player_struct *p, DDukeActor* motosprite) if (motosprite) { p->GetActor()->spr.pos.XY() = motosprite->spr.pos.XY(); - p->angle.ang = motosprite->spr.angle; + p->angle.ang = motosprite->spr.Angles.Yaw; p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo; motosprite->Destroy(); } @@ -4004,7 +4004,7 @@ void OffMotorcycle(player_struct *p) auto spawned = spawn(p->GetActor(), EMPTYBIKE); if (spawned) { - spawned->spr.angle = p->angle.ang; + spawned->spr.Angles.Yaw = p->angle.ang; spawned->saved_ammo = p->ammo_amount[MOTORCYCLE_WEAPON]; } } @@ -4023,7 +4023,7 @@ void OnBoat(player_struct *p, DDukeActor* boat) if (boat) { p->GetActor()->spr.pos.XY() = boat->spr.pos.XY(); - p->angle.ang = boat->spr.angle; + p->angle.ang = boat->spr.Angles.Yaw; p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo; boat->Destroy(); } @@ -4065,7 +4065,7 @@ void OffBoat(player_struct *p) auto spawned = spawn(p->GetActor(), EMPTYBOAT); if (spawned) { - spawned->spr.angle = p->angle.ang; + spawned->spr.Angles.Yaw = p->angle.ang; spawned->saved_ammo = p->ammo_amount[BOAT_WEAPON]; } } diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index e11009b92..8bff7e865 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -117,15 +117,15 @@ void DoSpawn(player_struct *p, int snum) if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE2 ) ) { // like shotgun shells - j->spr.angle += DAngle180; + j->spr.Angles.Yaw += DAngle180; ssp(j,CLIPMASK0); - j->spr.angle += DAngle180; + j->spr.Angles.Yaw += DAngle180; // p->kickback_pic++; } else if((aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_SPAWNTYPE3 ) ) { // like chaingun shells - j->spr.angle += DAngle90; + j->spr.Angles.Yaw += DAngle90; j->vel.X += 2.; j->spr.pos.Z += 3; ssp(j,CLIPMASK0); @@ -365,7 +365,7 @@ void operateweapon_ww(int snum, ESyncBits actions) double hd = hits(p->GetActor()); if (hd < 32) { - spawned->spr.angle += DAngle180; + spawned->spr.Angles.Yaw += DAngle180; spawned->vel *= 1./3.; } diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 85aae4714..bf1cd2135 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -584,7 +584,7 @@ void resetpspritevars(int g, const DVector3& startpos) I_Error("Too many player sprites (max 16.)"); po[numplayersprites].opos = act->spr.pos; - po[numplayersprites].oa = act->spr.angle; + po[numplayersprites].oa = act->spr.Angles.Yaw; po[numplayersprites].os = act->sector(); numplayersprites++; @@ -626,7 +626,7 @@ void resetpspritevars(int g, const DVector3& startpos) act->SetOwner(act); ps[j].setbobpos(); - ps[j].angle.oang = ps[j].angle.ang = act->spr.angle; + ps[j].angle.oang = ps[j].angle.ang = act->spr.Angles.Yaw; updatesector(act->spr.pos, &ps[j].cursector); diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index d437c7ac1..b2a4f1370 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -915,7 +915,7 @@ static void handle_st25(sectortype* sptr, DDukeActor* actor) if (act3->spr.lotag == 15) { act3->sector()->lotag ^= 0x8000; // Toggle the open or close - act3->spr.angle += DAngle180; + act3->spr.Angles.Yaw += DAngle180; if (act3->temp_data[4]) callsound(act3->sector(), act3); callsound(act3->sector(), act3); if (act3->sector()->lotag & 0x8000) act3->temp_data[4] = 1; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index ceac3200d..ed569bbad 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -651,7 +651,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw if (spawned) { spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER; - spawned->spr.angle = wal->delta().Angle() + DAngle90; + spawned->spr.Angles.Yaw = wal->delta().Angle() + DAngle90; S_PlayActorSound(SOMETHINGHITFORCE, spawned); } @@ -997,7 +997,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj) spawned->spr.pos.Z += 4; spawned->vel.X = 1; spawned->spr.scale = DVector2(0.375, 0.375); - spawned->spr.angle = DAngle22_5 / 4 - randomAngle(22.5 / 2); + spawned->spr.Angles.Yaw = DAngle22_5 / 4 - randomAngle(22.5 / 2); } } @@ -1015,7 +1015,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj) if (targ->spr.picnum != TANK && !bossguy(targ) && targ->spr.picnum != RECON && targ->spr.picnum != ROTATEGUN) { if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) - targ->spr.angle = proj->spr.angle + DAngle180; + targ->spr.Angles.Yaw = proj->spr.Angles.Yaw + DAngle180; targ->vel.X = -proj->spr.extra * 0.25; auto sp = targ->sector(); @@ -1051,7 +1051,7 @@ void checkhitdefault_d(DDukeActor* targ, DDukeActor* proj) targ->attackertype = hitpic; targ->hitextra += proj->spr.extra; - targ->hitang = proj->spr.angle; + targ->hitang = proj->spr.Angles.Yaw; targ->SetHitOwner(Owner); } @@ -1120,8 +1120,8 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL) { proj->vel.X = targ->vel.X * 0.75; - proj->spr.angle -= targ->spr.angle.Normalized180() * 2 + DAngle180; - targ->spr.angle = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90; + proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw.Normalized180() * 2 + DAngle180; + targ->spr.Angles.Yaw = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90; if (S_CheckSoundPlaying(POOLBALLHIT) < 2) S_PlayActorSound(POOLBALLHIT, targ); } @@ -1130,7 +1130,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) if (krand() & 3) { targ->vel.X = 10.25; - targ->spr.angle = proj->spr.angle; + targ->spr.Angles.Yaw = proj->spr.Angles.Yaw; } else { @@ -1222,7 +1222,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) lotsofglass(targ, nullptr, 40); S_PlayActorSound(GLASS_BREAKING, targ); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); lotsofglass(targ, nullptr, 8); targ->Destroy(); break; @@ -1235,7 +1235,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) for (j = 0; j < 48; j++) { fi.shoot(targ, BLOODSPLAT1); - targ->spr.angle += DAngle1 * 58.5; // Was 333, which really makes no sense. + targ->spr.Angles.Yaw += DAngle1 * 58.5; // Was 333, which really makes no sense. } S_PlayActorSound(GLASS_HEAVYBREAK, targ); S_PlayActorSound(SQUISHED, targ); @@ -1348,21 +1348,21 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) { targ->spr.extra -= proj->spr.extra; if (targ->spr.extra > 0) break; - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT1); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT2); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT3); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT4); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT1); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT2); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT3); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); fi.shoot(targ, BLOODSPLAT4); fi.guts(targ, JIBS1, 1, myconnectindex); fi.guts(targ, JIBS2, 2, myconnectindex); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index b7f5eacc1..e7f6af4e2 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -892,7 +892,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n) { for (int j = n - 1; j >= 0; j--) { - DAngle a = actor->spr.angle - DAngle45 + DAngle180 + randomAngle(90); + DAngle a = actor->spr.Angles.Yaw - DAngle45 + DAngle180 + randomAngle(90); auto vel = krandf(4) + 2; auto zvel = 4 - krandf(4); @@ -917,7 +917,7 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n) double z = sect->floorz - krandf(abs(sect->ceilingz - sect->floorz)); if (abs(z) > 32) z = actor->spr.pos.Z - 32 + krandf(64); - DAngle a = actor->spr.angle - DAngle180; + DAngle a = actor->spr.Angles.Yaw - DAngle180; auto vel = krandf(4) + 2; auto zvel = -krandf(4); @@ -1477,7 +1477,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj) spawned->spr.pos.Z += 4; spawned->vel.X = 1; spawned->spr.scale = DVector2(0.375, 0.375); - spawned->spr.angle = DAngle22_5 / 4 - randomAngle(22.5 / 2); + spawned->spr.Angles.Yaw = DAngle22_5 / 4 - randomAngle(22.5 / 2); } } @@ -1507,7 +1507,7 @@ void checkhitdefault_r(DDukeActor* targ, DDukeActor* proj) targ->attackertype = proj->spr.picnum; targ->hitextra += proj->spr.extra; if (targ->spr.picnum != COW) - targ->hitang = proj->spr.angle; + targ->hitang = proj->spr.Angles.Yaw; targ->SetHitOwner(proj->GetOwner()); } @@ -2029,7 +2029,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) break; case BOWLINGBALL: proj->vel.X = targ->vel.X * 0.75; - if (krand() & 16) proj->spr.angle -= DAngle22_5 / 8; + if (krand() & 16) proj->spr.Angles.Yaw -= DAngle22_5 / 8; S_PlayActorSound(355, targ); break; @@ -2042,23 +2042,23 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL) { proj->vel.X = targ->vel.X * 0.75; - proj->spr.angle -= targ->spr.angle.Normalized180() * 2 + DAngle180; - targ->spr.angle = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90; + proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw.Normalized180() * 2 + DAngle180; + targ->spr.Angles.Yaw = (targ->spr.pos.XY() - proj->spr.pos.XY()).Angle() - DAngle90; if (S_CheckSoundPlaying(POOLBALLHIT) < 2) S_PlayActorSound(POOLBALLHIT, targ); } else if (proj->spr.picnum == BOWLINGPIN || proj->spr.picnum == BOWLINGPIN + 1) { proj->vel.X *= 0.75; - proj->spr.angle -= targ->spr.angle * 2 + randomAngle(11.25); - targ->spr.angle += randomAngle(22.5 / 8); + proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw * 2 + randomAngle(11.25); + targ->spr.Angles.Yaw += randomAngle(22.5 / 8); S_PlayActorSound(355, targ); } else if (proj->spr.picnum == HENSTAND || proj->spr.picnum == HENSTAND + 1) { proj->vel.X *= 0.75; - proj->spr.angle -= targ->spr.angle * 2 + randomAngle(22.5 / 8); - targ->spr.angle += randomAngle(22.5 / 8); + proj->spr.Angles.Yaw -= targ->spr.Angles.Yaw * 2 + randomAngle(22.5 / 8); + targ->spr.Angles.Yaw += randomAngle(22.5 / 8); S_PlayActorSound(355, targ); } else @@ -2066,7 +2066,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) if (krand() & 3) { targ->vel.X = 10.25; - targ->spr.angle = proj->spr.angle; + targ->spr.Angles.Yaw = proj->spr.Angles.Yaw; } } break; @@ -2139,7 +2139,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) lotsofglass(targ, nullptr, 40); S_PlayActorSound(GLASS_BREAKING, targ); - targ->spr.angle = randomAngle(); + targ->spr.Angles.Yaw = randomAngle(); lotsofglass(targ, nullptr, 8); targ->Destroy(); break; diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 5a05457ff..6c0457044 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -360,7 +360,7 @@ void S_GetCamera(DVector3* c, DAngle* ca, sectortype** cs) { if (c) *c = ud.cameraactor->spr.pos; if (cs) *cs = ud.cameraactor->sector(); - if (ca) *ca = ud.cameraactor->spr.angle; + if (ca) *ca = ud.cameraactor->spr.Angles.Yaw; } } diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 240f757fe..618417649 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -79,7 +79,7 @@ DDukeActor* CreateActor(sectortype* whatsectp, const DVector3& pos, PClassActor* act->spr.shade = s_shd; if (!scale.isZero()) act->spr.scale = DVector2(scale.X, scale.Y); - act->spr.angle = s_ang; + act->spr.Angles.Yaw = s_ang; act->vel.X = s_vel; act->vel.Z = s_zvel; act->backuploc(); @@ -313,7 +313,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act) act->timetosleep = 0; if (actj) - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; } } @@ -347,7 +347,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam) act->spr.shade = -127; act->spr.cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->vel.X = 8; ChangeActorStat(act, STAT_MISC); @@ -400,7 +400,7 @@ void initfootprint(DDukeActor* actj, DDukeActor* act) act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR; if ((ps[actj->PlayerIndex()].footprintcount & 1)) act->spr.cstat |= CSTAT_SPRITE_XFLIP; - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; } act->spr.pos.Z = sect->floorz; @@ -435,7 +435,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell) } else { - ang = act->spr.angle; + ang = act->spr.Angles.Yaw; act->spr.pos.Z = actj->spr.pos.Z - gs.playerheight + 3; } @@ -446,12 +446,12 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell) if (isNamWW2GI()) { // to the right, with feeling - act->spr.angle = ang + DAngle90; + act->spr.Angles.Yaw = ang + DAngle90; act->vel.X = 1.875; } else { - act->spr.angle = ang - DAngle90; + act->spr.Angles.Yaw = ang - DAngle90; act->vel.X = 1.25; } @@ -850,7 +850,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) act2->spr.lotag == SE_1_PIVOT && act2->spr.hitag == actor->spr.hitag) { - if (actor->spr.angle == DAngle90) + if (actor->spr.Angles.Yaw == DAngle90) { actor->spr.pos.XY() = act2->spr.pos.XY(); } @@ -1000,7 +1000,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n) { for (j = n - 1; j >= 0; j--) { - auto a = actor->spr.angle - DAngle45 + DAngle180 + randomAngle(90); + auto a = actor->spr.Angles.Yaw - DAngle45 + DAngle180 + randomAngle(90); auto vel = krandf(4) + 2; auto zvel = 4 - krandf(4); @@ -1027,7 +1027,7 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n) double z = sect->floorz - krandf(abs(sect->ceilingz - sect->floorz)); if (fabs(z) > 32) z = actor->spr.pos.Z - 32 + krandf(64); - DAngle angl = actor->spr.angle - DAngle180; + DAngle angl = actor->spr.Angles.Yaw - DAngle180; auto vel = krandf(4) + 2; auto zvel = 4 - krandf(4); @@ -1119,7 +1119,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n) if (abs(z) > 32) z = actor->spr.pos.Z - 32 + krandf(64); - DAngle a = actor->spr.angle - DAngle180; + DAngle a = actor->spr.Angles.Yaw - DAngle180; auto vel = krandf(4) + 2; auto zvel = - krandf(8); diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 127006db8..dc99984b9 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -207,7 +207,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* break; case TONGUE: if (actj) - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.pos.Z -= gs.playerheight; act->vel.Z = 1 - krandf(2); act->vel.X = 4 - krandf(8); @@ -510,7 +510,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->temp_data[0] = krand() & 2047; act->spr.cstat = randomFlip(); act->spr.scale = DVector2(0.125, 0.125); - act->spr.angle = randomAngle(); + act->spr.Angles.Yaw = randomAngle(); } ChangeActorStat(act, STAT_MISC); break; @@ -535,7 +535,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (actj) { - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.shade = -64; act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip(); } @@ -608,7 +608,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == WATERBUBBLE) { if (actj) - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.scale = DVector2(0.0625, 0.0625); } else act->spr.scale = DVector2(0.5, 0.5); @@ -739,7 +739,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == RAT) { - act->spr.angle = randomAngle(); + act->spr.Angles.Yaw = randomAngle(); act->spr.scale = DVector2(0.75, 0.75); act->spr.cstat = 0; } @@ -926,7 +926,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case STEAM: if (actj) { - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE); act->vel.X = -0.5; diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 5f31bc9db..4648801a6 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -251,7 +251,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* break; case TONGUE: if (actj) - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.pos.Z -= gs.playerheight; act->vel.Z = 1 - krandf(2); act->vel.X = 4 - krandf(8); @@ -484,7 +484,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->temp_data[0] = krand() & 2047; act->spr.cstat = randomFlip(); act->spr.scale = DVector2(0.125, 0.125); - act->spr.angle = randomAngle(); + act->spr.Angles.Yaw = randomAngle(); } ChangeActorStat(act, STAT_MISC); break; @@ -499,7 +499,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case SMALLSMOKE: if (actj) { - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.shade = -64; act->spr.cstat = CSTAT_SPRITE_YCENTER | randomXFlip(); } @@ -565,7 +565,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == WATERBUBBLE) { if (actj) - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; double s = REPEAT_SCALE + (krand() & 7) * REPEAT_SCALE; act->spr.scale = DVector2(s, s); } @@ -847,7 +847,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.picnum == RAT) { - act->spr.angle = randomAngle(); + act->spr.Angles.Yaw = randomAngle(); act->spr.scale = DVector2(0.75, 0.75); act->spr.cstat = 0; } @@ -1103,7 +1103,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case STEAM: if (actj) { - act->spr.angle = actj->spr.angle; + act->spr.Angles.Yaw = actj->spr.Angles.Yaw; act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT; act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE); act->vel.X = -0.5; diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index 871fa3e0b..bba736b96 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -94,7 +94,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector pActor->clipdist = 2.5; pActor->spr.scale = DVector2(nScale, nScale); pActor->spr.picnum = 1; - pActor->spr.angle = nullAngle; + pActor->spr.Angles.Yaw = nullAngle; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->vel.X = 0; diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 97eff5a9d..3f688541c 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -61,7 +61,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, DA ChangeActorStat(ap, 101); ap->spr.pos.Z = ap->sector()->floorz; - nAngle = ap->spr.angle; + nAngle = ap->spr.Angles.Yaw; } ap->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -71,7 +71,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, DA ap->spr.picnum = 1; ap->spr.pal = ap->sector()->ceilingpal; ap->clipdist = 15; - ap->spr.angle = nAngle; + ap->spr.Angles.Yaw = nAngle; ap->spr.scale = DVector2(0.625, 0.625); ap->vel.X = 0; ap->vel.Y = 0; @@ -179,7 +179,7 @@ void AIAnubis::Tick(RunListEvent* ev) { PlotCourseToSprite(ap, pTarget); - ap->vel.XY() = ap->spr.angle.ToVector() * 256; + ap->vel.XY() = ap->spr.Angles.Yaw.ToVector() * 256; } switch (move.type) @@ -188,7 +188,7 @@ void AIAnubis::Tick(RunListEvent* ev) { if (move.actor() == pTarget) { - auto nAngDiff = absangle(ap->spr.angle, (pTarget->spr.pos - ap->spr.pos).Angle()); + auto nAngDiff = absangle(ap->spr.Angles.Yaw, (pTarget->spr.pos - ap->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { ap->nAction = 2; @@ -201,7 +201,7 @@ void AIAnubis::Tick(RunListEvent* ev) } case kHitWall: { - ap->spr.angle += DAngle45; + ap->spr.Angles.Yaw += DAngle45; ap->VelFromAngle(-2); break; } @@ -223,7 +223,7 @@ void AIAnubis::Tick(RunListEvent* ev) { ap->vel.X = 0; ap->vel.Y = 0; - ap->spr.angle = (pTarget->spr.pos - ap->spr.pos).Angle(); + ap->spr.Angles.Yaw = (pTarget->spr.pos - ap->spr.pos).Angle(); ap->nAction = 3; ap->nFrame = 0; @@ -265,7 +265,7 @@ void AIAnubis::Tick(RunListEvent* ev) { ap->nAction = 1; - ap->vel.XY() = ap->spr.angle.ToVector() * 256; + ap->vel.XY() = ap->spr.Angles.Yaw.ToVector() * 256; ap->nFrame = 0; } else @@ -273,7 +273,7 @@ void AIAnubis::Tick(RunListEvent* ev) // loc_25718: if (nFlag & 0x80) { - BuildBullet(ap, 8, INT_MAX, ap->spr.angle, pTarget, 1); + BuildBullet(ap, 8, INT_MAX, ap->spr.Angles.Yaw, pTarget, 1); } } diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index 5abdd9a3d..414bde9e5 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -63,7 +63,7 @@ DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector) pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = 1; - pActor->spr.angle = inita; + pActor->spr.Angles.Yaw = inita; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = -1200 / 256.; diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 650718360..ad6b6ca23 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -247,7 +247,7 @@ void BulletHitsSprite(Bullet *pBullet, DExhumedActor* pBulletActor, DExhumedActo if (nStat == kStatAnubisDrum) { - auto nAngle = (pActor->spr.angle + DAngle22_5) - RandomAngle9(); + auto nAngle = (pActor->spr.Angles.Yaw + DAngle22_5) - RandomAngle9(); pHitActor->vel.XY() = nAngle.ToVector() * 2048; pHitActor->vel.Z = -(RandomSize(3) + 1); @@ -434,7 +434,7 @@ MOVEEND: HitInfo hit{}; double dz = -pBullet->nPitch *2; - hitscan(apos, pActor->sector(), DVector3(pActor->spr.angle.ToVector() * 1024, dz), hit, CLIPMASK1); + hitscan(apos, pActor->sector(), DVector3(pActor->spr.Angles.Yaw.ToVector() * 1024, dz), hit, CLIPMASK1); pos = hit.hitpos; hitactor = hit.actor(); pHitSect = hit.hitSector; @@ -498,8 +498,8 @@ HITSPRITE: { if (pHitWall != nullptr) { - pos.X -= pActor->spr.angle.Cos() * 0.5; - pos.Y -= pActor->spr.angle.Sin() * 0.5; + pos.X -= pActor->spr.Angles.Yaw.Cos() * 0.5; + pos.Y -= pActor->spr.Angles.Yaw.Sin() * 0.5; if (nType != 3 || RandomSize(2) == 0) { @@ -573,7 +573,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA sBullet.nDoubleDamage = nDoubleDamage; sBullet.pActor = insertActor(pActor->sector(), 200); - sBullet.pActor->spr.angle = nAngle; + sBullet.pActor->spr.Angles.Yaw = nAngle; double nHeight = GetActorHeight(pTarget); @@ -639,7 +639,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA pBulletActor->spr.scale = DVector2(nRepeat * REPEAT_SCALE, nRepeat * REPEAT_SCALE); pBulletActor->spr.xoffset = 0; pBulletActor->spr.yoffset = 0; - pBulletActor->spr.angle = nAngle; + pBulletActor->spr.Angles.Yaw = nAngle; pBulletActor->vel.X = 0; pBulletActor->vel.Y = 0; pBulletActor->vel.Z = 0; @@ -748,7 +748,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, double fZOffset, DA xy -= pBulletActor->spr.pos.XY(); nAngle = xy.Angle(); - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; } else { diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 843e66e64..79b2d8024 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -672,7 +672,7 @@ std::pair GameInterface::GetCoordinates() { auto pPlayerActor = PlayerList[nLocalPlayer].pActor; if (!pPlayerActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle); - return std::make_pair(pPlayerActor->spr.pos, pPlayerActor->spr.angle); + return std::make_pair(pPlayerActor->spr.pos, pPlayerActor->spr.Angles.Yaw); } diff --git a/source/games/exhumed/src/exhumedactor.h b/source/games/exhumed/src/exhumedactor.h index 018fb1b45..4e690ed20 100644 --- a/source/games/exhumed/src/exhumedactor.h +++ b/source/games/exhumed/src/exhumedactor.h @@ -44,7 +44,7 @@ public: void Serialize(FSerializer& arc) override; void VelFromAngle(int shift = 0) { - vel.XY() = spr.angle.ToVector() * (1 << (10 + shift)); + vel.XY() = spr.Angles.Yaw.ToVector() * (1 << (10 + shift)); } diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index e72617d96..160448761 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -168,7 +168,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, } else { - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; ChangeActorStat(pActor, 103); } @@ -183,7 +183,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; pActor->spr.extra = -1; @@ -210,7 +210,7 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, void IdleFish(DExhumedActor* pActor, int edx) { - pActor->spr.angle += DAngle180 + DAngle45 - RandomAngle9(); + pActor->spr.Angles.Yaw += DAngle180 + DAngle45 - RandomAngle9(); pActor->norm_ang(); pActor->VelFromAngle(-8); @@ -426,7 +426,7 @@ void AIFish::Tick(RunListEvent* ev) if (z <= nHeight) { - pActor->vel.XY() = pActor->spr.angle.ToVector() * (32 - 8); + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (32 - 8); } else { @@ -506,7 +506,7 @@ void AIFish::Tick(RunListEvent* ev) if (pHitAct->spr.statnum == 100) { pActor->pTarget = coll.actor(); - pActor->spr.angle = (pHitAct->spr.pos - pActor->spr.pos).Angle(); + pActor->spr.Angles.Yaw = (pHitAct->spr.pos - pActor->spr.pos).Angle(); if (nAction != 3) { diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index e6b5913d1..614674cb6 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -71,18 +71,18 @@ void ThrowGrenade(int nPlayer, double dz, double push1) DExhumedActor* pActor = PlayerList[nPlayer].pPlayerGrenade; auto pPlayerActor = PlayerList[nPlayer].pActor; - DAngle nAngle = pPlayerActor->spr.angle; + DAngle nAngle = pPlayerActor->spr.Angles.Yaw; ChangeActorSect(pActor, PlayerList[nPlayer].pPlayerViewSect); pActor->spr.pos = pPlayerActor->spr.pos; if (nAngle < nullAngle) { - nAngle = pPlayerActor->spr.angle; + nAngle = pPlayerActor->spr.Angles.Yaw; } pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; if (push1 <= 23.4375) { @@ -134,7 +134,7 @@ void BuildGrenade(int nPlayer) pActor->clipdist = 7.5; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = pPlayerActor->spr.angle; + pActor->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw; pActor->spr.intowner = nPlayer; pActor->vel.X = 0; pActor->vel.Y = 0; @@ -200,7 +200,7 @@ void ExplodeGrenade(DExhumedActor* pActor) if (pActor->nTurn < 0) { auto pPlayerActor = PlayerList[nPlayer].pActor; - auto nAngle = pPlayerActor->spr.angle; + auto nAngle = pPlayerActor->spr.Angles.Yaw; DVector2 vect = nAngle.ToVector() * 32; pActor->spr.pos = pPlayerActor->spr.pos + vect; @@ -363,7 +363,7 @@ void AIGrenade::Tick(RunListEvent* ev) } else if (nMov.type == kHitSprite) { - BounceGrenade(pActor, nMov.actor()->spr.angle); + BounceGrenade(pActor, nMov.actor()->spr.Angles.Yaw); } pActor->nHealth = 0; diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index e18c4d720..98f1d1020 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -306,7 +306,7 @@ Collision CheckCloseRange(int nPlayer, DVector3& pos, sectortype* *ppSector) auto pActor = PlayerList[nPlayer].pActor; HitInfo hit{}; - hitscan(pos, *ppSector, DVector3(pActor->spr.angle.ToVector() * 1024, 0 ), hit, CLIPMASK1); + hitscan(pos, *ppSector, DVector3(pActor->spr.Angles.Yaw.ToVector() * 1024, 0 ), hit, CLIPMASK1); const double ecx = 56.84; // bsin(150, -3) double sqrtNum = (hit.hitpos.XY() - pos.XY()).LengthSquared(); @@ -702,7 +702,7 @@ loc_flag: } int nAmmoType = WeaponInfo[nWeapon].nAmmoType; - DAngle nAngle = pPlayerActor->spr.angle; + DAngle nAngle = pPlayerActor->spr.Angles.Yaw; auto thePos = pPlayerActor->spr.pos; double nHeight = GetActorHeight(pPlayerActor) * -0.5; @@ -844,7 +844,7 @@ loc_flag: // only autoaim if target is in front of the player. assert(t->sector()); DAngle angletotarget = (t->spr.pos - pPlayerActor->spr.pos).Angle(); - DAngle anglediff = absangle(pPlayerActor->spr.angle, angletotarget); + DAngle anglediff = absangle(pPlayerActor->spr.Angles.Yaw, angletotarget); if (anglediff < DAngle90) { target = t; @@ -866,7 +866,7 @@ loc_flag: BuildSnake(nPlayer, nHeight); nQuake[nPlayer] = 2.; - PlayerList[nPlayer].nThrust -= pPlayerActor->spr.angle.ToVector() * 2; + PlayerList[nPlayer].nThrust -= pPlayerActor->spr.Angles.Yaw.ToVector() * 2; break; } case kWeaponRing: diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index f861ebff0..7ef6d6396 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -650,7 +650,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) } case 88: { - AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.angle); + AddFlow(pActor->sector(), nSpeed, 0, pActor->spr.Angles.Yaw); DeleteActor(pActor); return; @@ -665,7 +665,7 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) } case 78: { - AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.angle); + AddFlow(pActor->sector(), nSpeed, 1, pActor->spr.Angles.Yaw); auto pSector = pActor->sector(); pSector->Flag |= 0x8000; diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 6cfb65083..cb17bfdad 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -106,7 +106,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, else { pSector = pActor->sector(); - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; pActor->spr.pos.Z = pSector->floorz; ChangeActorStat(pActor, 118); @@ -123,7 +123,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -284,7 +284,7 @@ void AILavaDude::Tick(RunListEvent* ev) ChangeActorSect(pActor, pSector); pActor->spr.pos = pos; - pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF); + pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF); pActor->VelFromAngle(); break; } @@ -295,7 +295,7 @@ void AILavaDude::Tick(RunListEvent* ev) if (coll.type == kHitWall) { - pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF); + pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF); pActor->VelFromAngle(); break; } @@ -303,7 +303,7 @@ void AILavaDude::Tick(RunListEvent* ev) { if (coll.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; @@ -342,7 +342,7 @@ void AILavaDude::Tick(RunListEvent* ev) { if ((nFlag & 0x80) && pTarget) { - BuildBullet(pActor, 10, INT_MAX, pActor->spr.angle, pTarget, 1); + BuildBullet(pActor, 10, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1); } else if (var_1C) { diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 3bc0c0e3e..72acabb05 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -52,7 +52,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, { ChangeActorStat(pActor, 104); pActor->spr.pos.Z = pActor->sector()->floorz; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -63,7 +63,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -167,7 +167,7 @@ void AILion::Damage(RunListEvent* ev) PlotCourseToSprite(pActor, pTarget); pActor->nAction = 5; pActor->nCount = RandomSize(3); - pActor->spr.angle += mapangle((- (RandomSize(1) << 8)) + (RandomSize(1) << 8)); // NOTE: no angle mask in original code + pActor->spr.Angles.Yaw += mapangle((- (RandomSize(1) << 8)) + (RandomSize(1) << 8)); // NOTE: no angle mask in original code } else { @@ -249,7 +249,7 @@ void AILion::Tick(RunListEvent* ev) { if (RandomBit()) { - pActor->spr.angle = RandomAngle(); + pActor->spr.Angles.Yaw = RandomAngle(); pActor->VelFromAngle(-1); } else @@ -273,18 +273,18 @@ void AILion::Tick(RunListEvent* ev) if (pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE) { - pActor->vel.XY() = pActor->spr.angle.ToVector() * 2048; + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 2048; } else { - pActor->vel.XY() = pActor->spr.angle.ToVector() * 512; + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512; } } if (nMov.type == kHitWall) { // loc_378FA: - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-1); break; } @@ -301,7 +301,7 @@ void AILion::Tick(RunListEvent* ev) } else { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 3; @@ -314,7 +314,7 @@ void AILion::Tick(RunListEvent* ev) else { // loc_378FA: - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-1); break; } @@ -372,7 +372,7 @@ void AILion::Tick(RunListEvent* ev) double nCheckDist = 0x7FFFFFFF; - DAngle nAngle = pActor->spr.angle; + DAngle nAngle = pActor->spr.Angles.Yaw; DAngle nScanAngle = (nAngle - DAngle90).Normalized360(); for (int i = 0; i < 5; i++) @@ -396,10 +396,10 @@ void AILion::Tick(RunListEvent* ev) nScanAngle += DAngle45; } - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->nAction = 6; - pActor->vel.XY() = pActor->spr.angle.ToVector() * (1024 - 128); + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (1024 - 128); D3PlayFX(StaticSound[kSound24], pActor); } @@ -418,7 +418,7 @@ void AILion::Tick(RunListEvent* ev) if (nMov.type == kHitWall) { pActor->nAction = 7; - pActor->spr.angle = (GetWallNormal(nMov.hitWall) + DAngle180).Normalized360(); + pActor->spr.Angles.Yaw = (GetWallNormal(nMov.hitWall) + DAngle180).Normalized360(); pActor->nCount = RandomSize(4); return; } @@ -426,7 +426,7 @@ void AILion::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 3; @@ -436,7 +436,7 @@ void AILion::Tick(RunListEvent* ev) else { // loc_378FA: - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-1); break; } @@ -458,13 +458,13 @@ void AILion::Tick(RunListEvent* ev) } else { - pActor->spr.angle += RandomAngle9() + DAngle45 + DAngle90; + pActor->spr.Angles.Yaw += RandomAngle9() + DAngle45 + DAngle90; } pActor->vel.Z = -1000 / 256.; pActor->nAction = 6; - pActor->vel.XY() = pActor->spr.angle.ToVector() * (1024 - 128); + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (1024 - 128); D3PlayFX(StaticSound[kSound24], pActor); } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index fd87257c9..c5073217a 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -567,7 +567,7 @@ Collision MoveCreatureWithCaution(DExhumedActor* pActor) ChangeActorSect(pActor, pSectorPre); - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-2); Collision c; c.setNone(); @@ -604,7 +604,7 @@ double PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2) return -1; auto vect = pActor2->spr.pos.XY() - pActor1->spr.pos.XY(); - pActor1->spr.angle = vect.Angle(); + pActor1->spr.Angles.Yaw = vect.Angle(); return vect.Length(); } @@ -944,7 +944,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel) */ auto pActor = PlayerList[nLocalPlayer].pActor; initpos = pActor->spr.pos; - inita = pActor->spr.angle; + inita = pActor->spr.Angles.Yaw; initsectp = pActor->sector(); } @@ -995,7 +995,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol if (pActor2 == nullptr) { pActor->pitch = nullAngle; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } else { @@ -1005,7 +1005,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol double nSqrt = vect.Length(); DAngle nPitch = VecToAngle(nSqrt, (pActor2->spr.pos.Z - nHeight - pActor->spr.pos.Z) / 16.); - DAngle nAngDelta = deltaangle(pActor->spr.angle, nMyAngle); + DAngle nAngDelta = deltaangle(pActor->spr.Angles.Yaw, nMyAngle); if (abs(nAngDelta) >= DAngle22_5 / 2) { @@ -1019,12 +1019,12 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol } nAngDelta = clamp(nAngDelta, -push1, push1); - nAngle = (nAngDelta + pActor->spr.angle).Normalized360(); + nAngle = (nAngDelta + pActor->spr.Angles.Yaw).Normalized360(); auto nPitchDelta = clamp(deltaangle(pActor->pitch, nPitch), -DAngle22_5 / 5, DAngle22_5 / 5); pActor->pitch = (pActor->pitch + nPitchDelta).Normalized180(); } - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; auto cospitch = pActor->pitch.Cos(); @@ -1054,7 +1054,7 @@ DVector3 WheresMyMouth(int nPlayer, sectortype **sectnum) *sectnum = pActor->sector(); auto pos = pActor->spr.pos.plusZ(-height); - auto vect = pActor->spr.angle.ToVector() * 8; + auto vect = pActor->spr.Angles.Yaw.ToVector() * 8; Collision scratch; clipmove(pos, sectnum, vect, 320, 5., 5., CLIPMASK1, scratch); @@ -1282,7 +1282,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) } else if (nVal.type == kHitSprite) { - nAngle = nVal.actor()->spr.angle; + nAngle = nVal.actor()->spr.Angles.Yaw; } else if (nVal.type == kHitWall) { diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 93e3bb49e..bdfbcecb8 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -52,7 +52,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, } else { - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; ChangeActorStat(pActor, 102); } @@ -66,7 +66,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->spr.picnum = 1; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -274,7 +274,7 @@ void AIMummy::Tick(RunListEvent* ev) { case kHitWall: { - pActor->spr.angle += DAngle180 + mapangle(RandomWord() & 0x3FF); + pActor->spr.Angles.Yaw += DAngle180 + mapangle(RandomWord() & 0x3FF); pActor->VelFromAngle(-2); return; } @@ -283,7 +283,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; @@ -337,7 +337,7 @@ void AIMummy::Tick(RunListEvent* ev) SetQuake(pActor, 100); // low 16 bits of returned var contains the sprite index, the high 16 the bullet number - auto pBullet = BuildBullet(pActor, 9, -60, pActor->spr.angle, pTarget, 1); + auto pBullet = BuildBullet(pActor, 9, -60, pActor->spr.Angles.Yaw, pTarget, 1); CheckMummyRevive(pActor); if (pBullet) diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 378028ed0..5a69e965b 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1338,12 +1338,12 @@ void AITrap::Tick(RunListEvent* ev) return; } - auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.angle, nullptr, 1); + auto pBullet = BuildBullet(pActor, nType, 0, pActor->spr.Angles.Yaw, nullptr, 1); if (pBullet) { if (nType == 15) { - pBullet->spr.angle -= DAngle90; + pBullet->spr.Angles.Yaw -= DAngle90; D3PlayFX(StaticSound[kSound32], pBullet); } else @@ -1419,7 +1419,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal) } else { - auto nAngle = pActor->spr.angle + DAngle22_5 - RandomAngle9(); + auto nAngle = pActor->spr.Angles.Yaw + DAngle22_5 - RandomAngle9(); if (nVal) { @@ -1554,7 +1554,7 @@ void DoFinale() { if (!(dword_96788 & 2)) { - pFinaleSpr->spr.angle = RandomAngle(); + pFinaleSpr->spr.Angles.Yaw = RandomAngle(); BuildSpark(pFinaleSpr, 1); } @@ -1739,7 +1739,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor) for (int i = 0; i < 20; i++) { - pActor->spr.angle = RandomAngle(); + pActor->spr.Angles.Yaw = RandomAngle(); BuildSpark(pActor, 1); // shoot out blue orbs } @@ -1811,7 +1811,7 @@ void AIEnergyBlock::Damage(RunListEvent* ev) auto pActor2 = insertActor(lasthitsect, 0); - pActor2->spr.angle = mapangle(ev->nParam); + pActor2->spr.Angles.Yaw = mapangle(ev->nParam); pActor2->spr.pos = lasthit; BuildSpark(pActor2, 0); // shoot out blue orb when damaged diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 86391c0b3..3a7827bbb 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -293,8 +293,8 @@ void RestartPlayer(int nPlayer) pActor->spr.pos = nNStartSprite->spr.pos; ChangeActorSect(pActor, nNStartSprite->sector()); - plr->angle.ang = nNStartSprite->spr.angle; - pActor->spr.angle = plr->angle.ang; + plr->angle.ang = nNStartSprite->spr.Angles.Yaw; + pActor->spr.Angles.Yaw = plr->angle.ang; floorsprt = insertActor(pActor->sector(), 0); @@ -308,7 +308,7 @@ void RestartPlayer(int nPlayer) pActor->spr.pos.XY() = plr->sPlayerSave.pos.XY(); pActor->spr.pos.Z = plr->sPlayerSave.pSector->floorz; plr->angle.ang = plr->sPlayerSave.nAngle; - pActor->spr.angle = plr->angle.ang; + pActor->spr.Angles.Yaw = plr->angle.ang; floorsprt = nullptr; } @@ -342,7 +342,7 @@ void RestartPlayer(int nPlayer) pDActor->spr.xoffset = 0; pDActor->spr.yoffset = 0; pDActor->spr.shade = pActor->spr.shade; - pDActor->spr.angle = pActor->spr.angle; + pDActor->spr.Angles.Yaw = pActor->spr.Angles.Yaw; pDActor->spr.cstat = pActor->spr.cstat; pDActor->spr.lotag = runlist_HeadRun() + 1; @@ -665,7 +665,7 @@ static void pickupMessage(int no) void UpdatePlayerSpriteAngle(Player* pPlayer) { inita = pPlayer->angle.ang; - if (pPlayer->pActor) pPlayer->pActor->spr.angle = inita; + if (pPlayer->pActor) pPlayer->pActor->spr.Angles.Yaw = inita; } //--------------------------------------------------------------------------- @@ -847,7 +847,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort { if ((sect->hitag == 45) && bTouchFloor) { - auto nDiff = absangle(nNormal, pPlayerActor->spr.angle + DAngle180); + auto nDiff = absangle(nNormal, pPlayerActor->spr.Angles.Yaw + DAngle180); if (nDiff <= DAngle45) { @@ -1073,7 +1073,7 @@ void AIPlayer::Tick(RunListEvent* ev) { auto ang = GetAngleToSprite(pPlayerActor, pSpiritSprite); PlayerList[nPlayer].angle.settarget(ang, true); - pPlayerActor->spr.angle = ang; + pPlayerActor->spr.Angles.Yaw = ang; PlayerList[nPlayer].horizon.settarget(nullAngle, true); @@ -1360,7 +1360,7 @@ sectdone: HitInfo near; // neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value. - neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle, near, 128., NT_Hitag | NT_NoSpriteCheck); + neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw, near, 128., NT_Hitag | NT_NoSpriteCheck); DExhumedActor* pActorB; feebtag(pPlayerActor->spr.pos, pPlayerActor->sector(), &pActorB, var_30, 48); @@ -2258,7 +2258,7 @@ sectdone: ChangeActorStat(pActorB, 899); } - SetSavePoint(nPlayer, pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle); + SetSavePoint(nPlayer, pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.Angles.Yaw); break; } @@ -2602,7 +2602,7 @@ sectdone: { initpos = pPlayerActor->spr.pos; initsectp = pPlayerActor->sector(); - inita = pPlayerActor->spr.angle; + inita = pPlayerActor->spr.Angles.Yaw; } if (!PlayerList[nPlayer].nHealth) @@ -2647,7 +2647,7 @@ sectdone: if (pPlayerActor->sector()->pAbove != nullptr) { - pDopple->spr.angle = pPlayerActor->spr.angle; + pDopple->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw; ChangeActorSect(pDopple, pPlayerActor->sector()->pAbove); pDopple->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; } @@ -2814,7 +2814,7 @@ DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater) DEFINE_ACTION_FUNCTION(_ExhumedPlayer, GetAngle) { PARAM_SELF_STRUCT_PROLOGUE(Player); - ACTION_RETURN_INT(self->pActor->spr.angle.Buildang()); + ACTION_RETURN_INT(self->pActor->spr.Angles.Yaw.Buildang()); } diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index c4aaa7ef8..6d532ba79 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -308,7 +308,7 @@ void DestroyAllEggs() void SetHeadVel(DExhumedActor* pActor) { - pActor->vel.XY() = pActor->spr.angle.ToVector() * 1024 * (1 << nVelShift); + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 1024 * (1 << nVelShift); } //--------------------------------------------------------------------------- @@ -324,7 +324,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr if (pActor2 == nullptr) { pActor->pitch = nullAngle; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } else { @@ -336,7 +336,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr DAngle nMyAngle = vect.Angle(); DAngle nPitch = VecToAngle(nSqrt * 16, edx); - DAngle nAngDelta = deltaangle(pActor->spr.angle, nMyAngle); + DAngle nAngDelta = deltaangle(pActor->spr.Angles.Yaw, nMyAngle); if (abs(nAngDelta) >= DAngle22_5) { @@ -353,13 +353,13 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr nAngDelta = val2; } - nAngle = (nAngDelta + pActor->spr.angle).Normalized360(); + nAngle = (nAngDelta + pActor->spr.Angles.Yaw).Normalized360(); auto nPitchDelta = clamp(deltaangle(pActor->pitch, nPitch), -DAngle22_5 / 5, DAngle22_5 / 5); pActor->pitch = (pActor->pitch + nPitchDelta).Normalized180(); } - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; auto cospitch = pActor->pitch.Cos(); @@ -472,13 +472,13 @@ void BuildQueenEgg(int nQueen, int nVal) pActor2->spr.yoffset = 0; pActor2->spr.shade = -12; pActor2->spr.picnum = 1; - pActor2->spr.angle = pActor->spr.angle + RandomAngle9() - DAngle45; + pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45; pActor2->backuppos(); if (!nVal) { pActor2->spr.scale = DVector2(0.46875, 0.46875); - pActor2->vel.XY() = pActor2->spr.angle.ToVector() * 1024; + pActor2->vel.XY() = pActor2->spr.Angles.Yaw.ToVector() * 1024; pActor2->vel.Z = -6000 / 256.; pActor2->spr.cstat = 0; } @@ -604,12 +604,12 @@ void AIQueenEgg::Tick(RunListEvent* ev) nAngle = GetWallNormal(nMov.hitWall); break; case kHitSprite: - nAngle = nMov.actor()->spr.angle; + nAngle = nMov.actor()->spr.Angles.Yaw; break; } - pActor->spr.angle = nAngle; - pActor->vel.XY() = pActor->spr.angle.ToVector() * 512; + pActor->spr.Angles.Yaw = nAngle; + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512; } break; @@ -639,7 +639,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) } [[fallthrough]]; case kHitWall: - pActor->spr.angle = DAngle45 + DAngle90 + RandomAngle9(); + pActor->spr.Angles.Yaw = DAngle45 + DAngle90 + RandomAngle9(); pActor->VelFromAngle(-3); pActor->vel.Z = (-RandomSize(5)) / 256.; break; @@ -664,7 +664,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) pEgg->nCounter--; if (pEgg->nCounter <= 0) { - auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.angle, true); + auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.Angles.Yaw, true); pActor->spr.pos.Z = pWaspSprite->spr.pos.Z; DestroyEgg(nEgg); @@ -753,7 +753,7 @@ void BuildQueenHead(int nQueen) pActor2->spr.pal = 0; pActor2->spr.xoffset = 0; pActor2->spr.yoffset = 0; - pActor2->spr.angle = pActor->spr.angle; + pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw; nVelShift = 2; SetHeadVel(pActor2); @@ -851,11 +851,11 @@ void AIQueenHead::Tick(RunListEvent* ev) auto nMov = MoveCreature(pActor); // original BUG - this line doesn't exist in original code? - DAngle nNewAng = pActor->spr.angle; + DAngle nNewAng = pActor->spr.Angles.Yaw; if (nMov.exbits == 0) { - if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.angle; + if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.Angles.Yaw; else if (nMov.type == kHitWall) nNewAng = GetWallNormal(nMov.hitWall); } else if (nMov.exbits == kHitAux2) @@ -870,7 +870,7 @@ void AIQueenHead::Tick(RunListEvent* ev) } // original BUG - var_18 isn't being set if the check above == 0x20000 ? - pActor->spr.angle = nNewAng; + pActor->spr.Angles.Yaw = nNewAng; nVelShift++; if (nVelShift < 5) @@ -945,7 +945,7 @@ void AIQueenHead::Tick(RunListEvent* ev) runlist_DamageEnemy(pTarget, pActor, 10); D3PlayFX(StaticSound[kSoundQTail] | 0x2000, pActor); - pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9(); + pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9(); pActor->norm_ang(); pActor->vel.Z = ((-20) - RandomSize(6)) / 256.; @@ -960,7 +960,7 @@ void AIQueenHead::Tick(RunListEvent* ev) MoveQP[nQHead] = pActor->spr.pos; assert(pActor->sector()); MoveQS[nQHead] = pActor->sector(); - MoveQA[nQHead] = pActor->spr.angle; + MoveQA[nQHead] = pActor->spr.Angles.Yaw; nHd = nQHead; @@ -983,7 +983,7 @@ void AIQueenHead::Tick(RunListEvent* ev) } pTActor->spr.pos = MoveQP[nHd]; - pTActor->spr.angle = MoveQA[nHd]; + pTActor->spr.Angles.Yaw = MoveQA[nHd]; } } @@ -1171,7 +1171,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, { ChangeActorStat(pActor, 121); pActor->spr.pos.Z = pActor->sector()->floorz; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -1182,7 +1182,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = 1; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -1363,7 +1363,7 @@ void AIQueen::Tick(RunListEvent* ev) } [[fallthrough]]; case 0x8000: - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->norm_ang(); SetQueenSpeed(pActor, si); @@ -1406,7 +1406,7 @@ void AIQueen::Tick(RunListEvent* ev) if (!si) { - BuildBullet(pActor, 12, INT_MAX, pActor->spr.angle, pTarget, 1); + BuildBullet(pActor, 12, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1); } else { diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index fded8f59a..27400b937 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -101,7 +101,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D { ChangeActorStat(pActor, 108); pActor->spr.pos.Z = pActor->sector()->floorz; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -111,7 +111,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D pActor->spr.picnum = 1; pActor->spr.pal = pActor->sector()->ceilingpal; pActor->clipdist = 7.5; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->spr.scale = DVector2(0.78125, 0.78125); pActor->vel.X = 0; pActor->vel.Y = 0; @@ -369,7 +369,7 @@ void AIRat::Tick(RunListEvent* ev) return; } - pActor->spr.angle = RandomAngle(); + pActor->spr.Angles.Yaw = RandomAngle(); SetRatVel(pActor); return; } diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index 9095dc22e..762375c6f 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -52,7 +52,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D } else { - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; pActor->spr.pos.Z = pActor->sector()->floorz; ChangeActorStat(pActor, 119); } @@ -65,7 +65,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -232,9 +232,9 @@ void AIRex::Tick(RunListEvent* ev) { if (pTarget == nullptr) { - auto nAngle = pActor->spr.angle; + auto nAngle = pActor->spr.Angles.Yaw; pActor->pTarget = FindPlayer(pActor, 60); - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; } else { @@ -282,7 +282,7 @@ void AIRex::Tick(RunListEvent* ev) { if ((PlotCourseToSprite(pActor, pTarget) >= 60*16) || pActor->nCount > 0) { - pActor->vel.XY() = pActor->spr.angle.ToVector() * 256; + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 256; } else { @@ -312,7 +312,7 @@ void AIRex::Tick(RunListEvent* ev) } case kHitWall: { - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-2); pActor->nAction = 1; pActor->nFrame = 0; @@ -342,7 +342,7 @@ void AIRex::Tick(RunListEvent* ev) SetQuake(pActor, 25); pActor->nCount = 60; - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-2); pActor->nAction = 1; pActor->nFrame = 0; @@ -360,7 +360,7 @@ void AIRex::Tick(RunListEvent* ev) { runlist_DamageEnemy(nMov.actor(), pActor, 15); - auto vel = pActor->spr.angle.ToVector() * 1024 * 15; + auto vel = pActor->spr.Angles.Yaw.ToVector() * 1024 * 15; if (pHitActor->spr.statnum == 100) { diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 90e2ed6e5..705a6ef1d 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -51,7 +51,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp { ChangeActorStat(pActor, 105); pActor->spr.pos.Z = pActor->sector()->floorz; - angle = pActor->spr.angle; + angle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -61,7 +61,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp pActor->spr.picnum = 1; pActor->spr.pal = pActor->sector()->ceilingpal; pActor->clipdist = 15; - pActor->spr.angle = angle; + pActor->spr.Angles.Yaw = angle; pActor->spr.scale = DVector2(0.625, 0.625); pActor->vel.X = 0; pActor->vel.Y = 0; @@ -101,7 +101,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp void GoRoach(DExhumedActor* pActor) { - pActor->vel.XY() = pActor->spr.angle.ToVector() * (512 - 128); + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (512 - 128); } void AIRoach::Draw(RunListEvent* ev) @@ -300,19 +300,19 @@ void AIRoach::Tick(RunListEvent* ev) pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); + pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nFrame = 0; } else { - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; GoRoach(pActor); } } else if (nMov.type == kHitWall) { - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; GoRoach(pActor); } else @@ -329,7 +329,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); + pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nFrame = 0; } @@ -365,7 +365,7 @@ void AIRoach::Tick(RunListEvent* ev) { if (nFlag & 0x80) { - BuildBullet(pActor, 13, INT_MAX, pActor->spr.angle, pTarget, 1); + BuildBullet(pActor, 13, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1); } } diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 7618f3ad7..2b8d4f0a3 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -55,7 +55,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, { ChangeActorStat(pActor, 122); pActor->spr.pos.Z = pActor->sector()->floorz; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -66,7 +66,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -273,7 +273,7 @@ void AIScorp::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 2; @@ -341,7 +341,7 @@ void AIScorp::Tick(RunListEvent* ev) return; } - auto nBulletSprite = BuildBullet(pActor, 16, INT_MAX, pActor->spr.angle, pTarget, 1); + auto nBulletSprite = BuildBullet(pActor, 16, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1); if (nBulletSprite) { PlotCourseToSprite(nBulletSprite, pTarget); @@ -391,14 +391,14 @@ void AIScorp::Tick(RunListEvent* ev) return; } - auto pSpiderActor = BuildSpider(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.angle); + auto pSpiderActor = BuildSpider(nullptr, pActor->spr.pos, pActor->sector(), pActor->spr.Angles.Yaw); if (pSpiderActor) { - pSpiderActor->spr.angle = RandomAngle(); + pSpiderActor->spr.Angles.Yaw = RandomAngle(); int nVel = RandomSize(5) + 1; - pSpiderActor->vel.XY() = pSpiderActor->spr.angle.ToVector() * 4 * nVel; + pSpiderActor->vel.XY() = pSpiderActor->spr.Angles.Yaw.ToVector() * 4 * nVel; pSpiderActor->vel.Z = -(RandomSize(5) + 3); } @@ -439,7 +439,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) if (mode == 0) { PlotCourseToSprite(pActor, pTarget); - pActor->spr.angle += mapangle(RandomSize(7) - 63); + pActor->spr.Angles.Yaw += mapangle(RandomSize(7) - 63); pActor->norm_ang(); pActor->VelFromAngle(); @@ -459,7 +459,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) { pActor->vel.X = 0; pActor->vel.Y = 0; - pActor->spr.angle = (pTarget->spr.pos - pActor->spr.pos).Angle(); + pActor->spr.Angles.Yaw = (pTarget->spr.pos - pActor->spr.pos).Angle(); pActor->nIndex = RandomSize(2) + RandomSize(3); diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index f12bfab18..c0d5e58f2 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -534,7 +534,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) tspritetype* pTSprite = mytspriteArray->get(nSprite); DAngle nAngle = (nCamerapos.XY() - pTSprite->pos.XY()).Angle(); - int nSeqOffset = (((pTSprite->angle + DAngle90 + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8; + int nSeqOffset = (((pTSprite->Angles.Yaw + DAngle90 + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8; int16_t nFrame = SeqBase[nSeqOffset + nSeq] + nVal; @@ -596,7 +596,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) else { DAngle nAngle = (nCamerapos.XY() - pTSprite->pos.XY()).Angle(); - val = (((pTSprite->angle + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8; + val = (((pTSprite->Angles.Yaw + DAngle22_5 - nAngle).Buildang()) & kAngleMask) >> 8; } int eax = SeqBase[edx] + nFrame; @@ -644,7 +644,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) tsp->shade = shade; tsp->pal = pTSprite->pal; tsp->scale = pTSprite->scale; - tsp->angle = pTSprite->angle; + tsp->Angles.Yaw = pTSprite->Angles.Yaw; tsp->ownerActor = pTSprite->ownerActor; tsp->sectp = pTSprite->sectp; tsp->cstat = pTSprite->cstat |= CSTAT_SPRITE_YCENTER; diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index 88e0b767c..82aedf2e4 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -56,7 +56,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D { ChangeActorStat(pActor, 120); pActor->spr.pos.Z = pActor->sector()->floorz; - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; } pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -69,7 +69,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->spr.picnum = 1; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -114,7 +114,7 @@ void BuildSoul(DExhumedActor* pSet) pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0); - pActor->spr.angle = RandomAngle(); + pActor->spr.Angles.Yaw = RandomAngle(); pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = -1 - RandomSize(10) / 256.; @@ -155,7 +155,7 @@ void AISoul::Tick(RunListEvent* ev) double nVel = mapangle(pActor->spr.extra).Cos(); - auto vect = pActor->spr.angle.ToVector() * nVel * 8; + auto vect = pActor->spr.Angles.Yaw.ToVector() * nVel * 8; auto coll = movesprite(pActor,vect, pActor->vel.Z, 0, CLIPMASK0); if (coll.exbits & 0x10000) { @@ -427,7 +427,7 @@ void AISet::Tick(RunListEvent* ev) } // loc_338E2 - pActor->vel.XY() = pActor->spr.angle.ToVector() * 512; + pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512; if (pActor->nIndex2) { @@ -455,7 +455,7 @@ void AISet::Tick(RunListEvent* ev) } } - pActor->spr.angle += DAngle45; + pActor->spr.Angles.Yaw += DAngle45; pActor->VelFromAngle(-1); break; } @@ -463,7 +463,7 @@ void AISet::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - auto nAngDiff = absangle(pActor->spr.angle, (pTarget->spr.pos - pActor->spr.pos).Angle()); + auto nAngDiff = absangle(pActor->spr.Angles.Yaw, (pTarget->spr.pos - pActor->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { pActor->nAction = 4; @@ -528,7 +528,7 @@ void AISet::Tick(RunListEvent* ev) { if (nFlag & 0x80) { - auto pBullet = BuildBullet(pActor, 11, INT_MAX, pActor->spr.angle, pTarget, 1); + auto pBullet = BuildBullet(pActor, 11, INT_MAX, pActor->spr.Angles.Yaw, pTarget, 1); if (pBullet) SetBulletEnemy(pBullet->nPhase, pTarget); diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index 1451a56ec..b962c915a 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -170,13 +170,13 @@ void BuildSnake(int nPlayer, double zVal) auto pos = pPlayerActor->spr.pos.plusZ(zVal - 10); HitInfo hit{}; - hitscan(pos, pPlayerActor->sector(), DVector3(pPlayerActor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK1); + hitscan(pos, pPlayerActor->sector(), DVector3(pPlayerActor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK1); double nSize = (hit.hitpos.XY() - pos.XY()).Length(); if (nSize < 64) { - hit.hitpos -= pPlayerActor->spr.angle.ToVector() * 0.5; + hit.hitpos -= pPlayerActor->spr.Angles.Yaw.ToVector() * 0.5; auto pActor = insertActor(hit.hitSector, 202); pActor->spr.pos = hit.hitpos; @@ -231,7 +231,7 @@ void BuildSnake(int nPlayer, double zVal) pActor->spr.pal = 0; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.angle = pPlayerActor->spr.angle; + pActor->spr.Angles.Yaw = pPlayerActor->spr.Angles.Yaw; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -284,7 +284,7 @@ DExhumedActor* FindSnakeEnemy(int nSnake) DExhumedActor* pActor = SnakeList[nSnake].pSprites[0]; // CHECKME if (!pActor) return nullptr; - DAngle nAngle = pActor->spr.angle; + DAngle nAngle = pActor->spr.Angles.Yaw; auto pSector =pActor->sector(); DAngle maxangle = DAngle360; @@ -350,7 +350,7 @@ void AISnake::Tick(RunListEvent* ev) if (pEnemySprite == nullptr) { SEARCH_ENEMY: - auto vec = pActor->spr.angle.ToVector() * 37.5; + auto vec = pActor->spr.Angles.Yaw.ToVector() * 37.5; nMov = movesprite(pActor, vec, BobVal(SnakeList[nSnake].nAngle) * 2, 0, CLIPMASK1); FindSnakeEnemy(nSnake); @@ -384,7 +384,7 @@ void AISnake::Tick(RunListEvent* ev) } else { - DAngle nAngle = pActor->spr.angle; + DAngle nAngle = pActor->spr.Angles.Yaw; double cosang = -nAngle.Cos() * 4; double sinang = -nAngle.Sin() * 4; @@ -400,7 +400,7 @@ void AISnake::Tick(RunListEvent* ev) DExhumedActor* pActor2 = SnakeList[nSnake].pSprites[i]; if (!pActor2) continue; - pActor2->spr.angle = nAngle; + pActor2->spr.Angles.Yaw = nAngle; pActor2->spr.pos = pActor->spr.pos; ChangeActorSect(pActor2, pSector); diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 04e5ad0fc..ddacdd546 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -506,7 +506,7 @@ void GameInterface::UpdateSounds() { Snake *pSnake = &SnakeList[nSnakeCam]; pos = pSnake->pSprites[0]->spr.pos; - ang = pSnake->pSprites[0]->spr.angle; + ang = pSnake->pSprites[0]->spr.Angles.Yaw; } else { diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 31e5fb89d..9de5256c4 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -54,7 +54,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype* ChangeActorStat(spp, 99); spp->spr.pos.Z = spp->sector()->floorz; - nAngle = spp->spr.angle; + nAngle = spp->spr.Angles.Yaw; } spp->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -67,7 +67,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype* spp->spr.pal = spp->sector()->ceilingpal; spp->spr.xoffset = 0; spp->spr.yoffset = 0; - spp->spr.angle = nAngle; + spp->spr.Angles.Yaw = nAngle; spp->spr.picnum = 1; spp->spr.hitag = 0; spp->spr.lotag = runlist_HeadRun() + 1; @@ -308,7 +308,7 @@ void AISpider::Tick(RunListEvent* ev) { case kHitWall: { - spp->spr.angle += DAngle45; + spp->spr.Angles.Yaw += DAngle45; spp->VelFromAngle(); return; } @@ -316,7 +316,7 @@ void AISpider::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - auto nAngDiff = absangle(spp->spr.angle, (pTarget->spr.pos - spp->spr.pos).Angle()); + auto nAngDiff = absangle(spp->spr.Angles.Yaw, (pTarget->spr.pos - spp->spr.pos).Angle()); if (nAngDiff < DAngle22_5 / 2) { spp->nAction = 2; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 929f327bb..2b3610bd7 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -70,7 +70,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double { // interpolate sprite position pTSprite->pos = pTSprite->ownerActor->interpolatedpos(interpfrac); - pTSprite->angle = pTSprite->ownerActor->interpolatedangle(interpfrac); + pTSprite->Angles.Yaw = pTSprite->ownerActor->interpolatedangle(interpfrac); } } @@ -84,7 +84,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double auto pSector =pPlayerActor->sector(); - DAngle nAngle = -pPlayerActor->spr.angle; + DAngle nAngle = -pPlayerActor->spr.Angles.Yaw; for (int nTSprite = int(tsprites.Size()-1); nTSprite >= 0; nTSprite--) { @@ -207,7 +207,7 @@ void DrawView(double interpfrac, bool sceneonly) nCamerapos = pActor->spr.pos; pSector = pActor->sector(); - nCameraang = pActor->spr.angle; + nCameraang = pActor->spr.Angles.Yaw; rotscrnang = nullAngle; SetGreenPal(); @@ -343,7 +343,7 @@ void DrawView(double interpfrac, bool sceneonly) pPlayerActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - auto ang2 = nCameraang - pPlayerActor->spr.angle; + auto ang2 = nCameraang - pPlayerActor->spr.Angles.Yaw; if (ang2.Degrees() < 0) ang2 = -ang2; diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index 7680e7a9f..b45234369 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -50,7 +50,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype* } else { - nAngle = pActor->spr.angle; + nAngle = pActor->spr.Angles.Yaw; ChangeActorStat(pActor, 107); } @@ -71,7 +71,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype* pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = 1; - pActor->spr.angle = nAngle; + pActor->spr.Angles.Yaw = nAngle; pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -172,7 +172,7 @@ void AIWasp::Damage(RunListEvent* ev) } pActor->nAction = 1; - pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9(); + pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9(); pActor->norm_ang(); pActor->nVel = 3000; @@ -186,7 +186,7 @@ void AIWasp::Damage(RunListEvent* ev) pActor->nFrame = 0; pActor->spr.cstat = 0; - pActor->spr.angle += DAngle180; + pActor->spr.Angles.Yaw += DAngle180; pActor->VelFromAngle(); @@ -327,7 +327,7 @@ void AIWasp::Tick(RunListEvent* ev) { if (bVal) { - pActor->spr.angle += DAngle45 + DAngle90 + RandomAngle9(); + pActor->spr.Angles.Yaw += DAngle45 + DAngle90 + RandomAngle9(); pActor->vel.Z = ((-20) - RandomSize(6)) / 256.; pActor->nAction = 1; diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 072f1681e..e39735272 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -139,7 +139,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) actor->user.RotNum = 0; actor->vel.X *= 2; actor->user.ActorActionFunc = nullptr; - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; break; case NINJA_RUN_R0: @@ -170,7 +170,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) actor->vel.X = 12.5 + RandomRangeF(12.5); actor->user.jump_speed = -200 - RandomRange(250); DoActorBeginJump(actor); - actor->spr.angle = weapActor->spr.angle; + actor->spr.Angles.Yaw = weapActor->spr.Angles.Yaw; } } else @@ -189,7 +189,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) actor->user.ActorActionFunc = nullptr; //actor->user.ActorActionFunc = NullAnimator; if (!sw_ninjahack) - actor->spr.angle = weapActor->spr.angle; + actor->spr.Angles.Yaw = weapActor->spr.Angles.Yaw; break; case COOLG_RUN_R0: @@ -223,7 +223,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) } actor->user.ActorActionFunc = nullptr; // Get angle to player - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos.Y).Angle() + DAngle180; + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos.Y).Angle() + DAngle180; break; case UZI_SMOKE+1: // Shotgun @@ -246,7 +246,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) DoActorBeginJump(actor); actor->user.ActorActionFunc = nullptr; // Get angle to player - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle() + DAngle180; + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle() + DAngle180; break; default: @@ -271,7 +271,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) actor->vel.X = 18.75 + RandomRangeF(25); actor->user.jump_speed = -300 - RandomRange(350); DoActorBeginJump(actor); - actor->spr.angle = weapActor->spr.angle; + actor->spr.Angles.Yaw = weapActor->spr.Angles.Yaw; break; } break; @@ -442,11 +442,11 @@ int DoActorDebris(DSWActor* actor) else { // todo: check correctness - DVector2 nvec = ACTORMOVETICS * maptoworld * actor->spr.angle.ToVector(); + DVector2 nvec = ACTORMOVETICS * maptoworld * actor->spr.Angles.Yaw.ToVector(); if (!move_debris(actor, nvec)) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); } } @@ -473,9 +473,9 @@ int DoActorDebris(DSWActor* actor) int DoFireFly(DSWActor* actor) { actor->clipdist = 16; - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * (0.25 * ACTORMOVETICS), 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * (0.25 * ACTORMOVETICS), 0))) { - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } actor->user.WaitTics = (actor->user.WaitTics + (ACTORMOVETICS << 1)) & 2047; @@ -506,7 +506,7 @@ int DoGenerateSewerDebris(DSWActor* actor) { actor->user.Tics = actor->user.WaitTics; - auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->spr.pos, actor->spr.angle, 12.5); + auto spawned = SpawnActor(STAT_DEAD_ACTOR, 0, Debris[RANDOM_P2(4<<8)>>8], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 12.5); SetOwner(actor, spawned); } @@ -801,7 +801,7 @@ int DoActorStopFall(DSWActor* actor) // don't stand on face or wall sprites - jump again if (actor->user.lowActor && !(actor->user.lowActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) { - actor->spr.angle += DAngle180 + RandomAngle(DAngle90); + actor->spr.Angles.Yaw += DAngle180 + RandomAngle(DAngle90); actor->user.jump_speed = -350; DoActorBeginJump(actor); @@ -850,7 +850,7 @@ int DoActorDeathMove(DSWActor* actor) } actor->clipdist = 12; - move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0)); + move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0)); // only fall on top of floor sprite or sector diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index 07b7809a1..5899bc2eb 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -432,7 +432,7 @@ int DoActorOperate(DSWActor* actor) for (i = 0; i < SIZ(z); i++) { - neartag(actor->spr.pos.plusZ(z[i]), actor->sector(), actor->spr.angle, near, 64., NT_Lotag | NT_Hitag | NT_NoSpriteCheck); + neartag(actor->spr.pos.plusZ(z[i]), actor->sector(), actor->spr.Angles.Yaw, near, 64., NT_Lotag | NT_Hitag | NT_NoSpriteCheck); } if (near.hitSector != nullptr) @@ -837,7 +837,7 @@ int DoActorCantMoveCloser(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, MID_SPEED); actor->user.Flags |= (SPR_FIND_PLAYER); @@ -862,7 +862,7 @@ int DoActorCantMoveCloser(DSWActor* actor) int DoActorMoveCloser(DSWActor* actor) { // if cannot move the sprite - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { if (ActorMoveHitReact(actor)) return 0; @@ -889,7 +889,7 @@ int DoActorMoveCloser(DSWActor* actor) else { // turn to face player - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); } } @@ -1086,7 +1086,7 @@ int InitActorRunAway(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, FAST_SPEED); actor->user.Flags |= (SPR_RUN_AWAY); } @@ -1173,7 +1173,7 @@ int InitActorAttack(DSWActor* actor) //NewStateGroup(actor, actor->user.ActorActionSet->Stand); // face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); // If it's your own kind, lay off! if (actor->user.ID == actor->user.targetActor->user.ID && !actor->user.targetActor->user.PlayerP) @@ -1262,7 +1262,7 @@ int InitActorEvade(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, FAST_SPEED); // NOT doing a RUN_AWAY actor->user.Flags &= ~(SPR_RUN_AWAY); @@ -1289,7 +1289,7 @@ int InitActorWanderAround(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, NORM_SPEED); } @@ -1312,7 +1312,7 @@ int InitActorFindPlayer(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); DoActorSetSpeed(actor, MID_SPEED); actor->user.Flags |= (SPR_FIND_PLAYER); @@ -1387,7 +1387,7 @@ int DoActorDuck(DSWActor* actor) int DoActorMoveJump(DSWActor* actor) { - move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0)); + move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0)); if (!(actor->user.Flags & (SPR_JUMPING|SPR_FALLING))) { @@ -1416,7 +1416,7 @@ Collision move_scan(DSWActor* actor, DAngle ang, double dst, DVector3& stop) // save off position info auto pos = actor->spr.pos; - auto sang = actor->spr.angle; + auto sang = actor->spr.Angles.Yaw; auto loz = actor->user.loz; auto hiz = actor->user.hiz; lowActor = actor->user.lowActor; @@ -1426,7 +1426,7 @@ Collision move_scan(DSWActor* actor, DAngle ang, double dst, DVector3& stop) ssp = actor->sector(); // do the move - actor->spr.angle = ang; + actor->spr.Angles.Yaw = ang; auto vec = ang.ToVector() * dst; Collision ret = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, cliptype, 1); @@ -1439,7 +1439,7 @@ Collision move_scan(DSWActor* actor, DAngle ang, double dst, DVector3& stop) // reset position information actor->spr.pos = pos; - actor->spr.angle = sang; + actor->spr.Angles.Yaw = sang; actor->user.loz = loz; actor->user.hiz = hiz; actor->user.lowActor = lowActor; @@ -1530,13 +1530,13 @@ DAngle FindNewAngle(DSWActor* actor, int dir, double DistToMove) // look directly ahead for a ledge if (!(actor->user.Flags & (SPR_NO_SCAREDZ | SPR_JUMPING | SPR_FALLING | SPR_SWIMMING | SPR_DEAD))) { - actor->spr.angle = new_ang; + actor->spr.Angles.Yaw = new_ang; if (DropAhead(actor, actor->user.lo_step)) { - actor->spr.angle = oang; + actor->spr.Angles.Yaw = oang; continue; } - actor->spr.angle = oang; + actor->spr.Angles.Yaw = oang; } #endif @@ -1578,7 +1578,7 @@ DAngle FindNewAngle(DSWActor* actor, int dir, double DistToMove) if (actor->user.TargetDist > 250) actor->user.TargetDist -= 218.75; - actor->spr.angle = save_ang; + actor->spr.Angles.Yaw = save_ang; return save_ang; } @@ -1657,7 +1657,7 @@ int InitActorReposition(DSWActor* actor) return 0; } - actor->spr.angle = ang; + actor->spr.Angles.Yaw = ang; DoActorSetSpeed(actor, FAST_SPEED); actor->user.Flags &= ~(SPR_RUN_AWAY); } @@ -1687,7 +1687,7 @@ int InitActorReposition(DSWActor* actor) DoActorSetSpeed(actor, MID_SPEED); } - actor->spr.angle = ang; + actor->spr.Angles.Yaw = ang; } @@ -1709,7 +1709,7 @@ int InitActorReposition(DSWActor* actor) int DoActorReposition(DSWActor* actor) { // still might hit something and have to handle it. - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { if (ActorMoveHitReact(actor)) return 0; diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index 50ad815af..cde04b300 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -602,7 +602,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type auto breakActor = insertActor(0, STAT_DEFAULT); breakActor->spr.cstat = 0; breakActor->spr.extra = 0; - breakActor->spr.angle = ang; + breakActor->spr.Angles.Yaw = ang; breakActor->spr.picnum = ST1; breakActor->spr.scale = DVector2(1, 1); SetActorZ(breakActor, hit_pos); diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index de499f969..508169a75 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -853,9 +853,9 @@ int DoBunnyBeginJumpAttack(DSWActor* actor) auto rndang = RandomAngle(DAngle45) - DAngle22_5; if (coll.type != kHitNone) - actor->spr.angle += DAngle180 + rndang; + actor->spr.Angles.Yaw += DAngle180 + rndang; else - actor->spr.angle = tang + rndang; + actor->spr.Angles.Yaw = tang + rndang; DoActorSetSpeed(actor, FAST_SPEED); @@ -879,7 +879,7 @@ int DoBunnyMoveJump(DSWActor* actor) { if (actor->user.Flags & (SPR_JUMPING | SPR_FALLING)) { - move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0)); + move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0)); if (actor->user.Flags & (SPR_JUMPING)) DoActorJump(actor); @@ -1044,10 +1044,10 @@ int DoBunnyQuickJump(DSWActor* actor) } actor->spr.pos.XY() = hitActor->spr.pos.XY(); - actor->spr.angle = hitActor->spr.angle; - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw = hitActor->spr.Angles.Yaw; + actor->spr.Angles.Yaw += DAngle180; HelpMissileLateral(actor, 2000); - actor->spr.angle = hitActor->spr.angle; + actor->spr.Angles.Yaw = hitActor->spr.Angles.Yaw; NewStateGroup(actor, sg_BunnyScrew); NewStateGroup(hitActor, sg_BunnyScrew); @@ -1112,7 +1112,7 @@ int DoBunnyRipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face bunny - target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); + target->spr.Angles.Yaw = (actor->spr.pos - target->spr.pos).Angle(); return 0; } @@ -1145,7 +1145,7 @@ void BunnyHatch(DSWActor* actor) auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); actorNew->spr.pos = actor->spr.pos; actorNew->spr.scale = DVector2(0.46875, 0.375); // Baby size - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->spr.pal = 0; SetupBunny(actorNew); actorNew->spr.shade = actor->spr.shade; @@ -1205,7 +1205,7 @@ DSWActor* BunnyHatch2(DSWActor* actor) auto actorNew = insertActor(actor->sector(), STAT_DEFAULT); actorNew->spr.pos = actor->spr.pos; actorNew->spr.scale = DVector2(0.46875, 0.375); // Baby size - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->spr.pal = 0; SetupBunny(actorNew); actorNew->spr.shade = actor->spr.shade; @@ -1234,7 +1234,7 @@ DSWActor* BunnyHatch2(DSWActor* actor) actorNew->spr.scale = DVector2(1, 1); actorNew->vel.X = 9.375 + RandomRangeF(62.5); actorNew->user.Health = 1; // Easy to pop. Like shootn' skeet. - actorNew->spr.angle += RandomAngle(22.5) - RandomAngle(22.5); + actorNew->spr.Angles.Yaw += RandomAngle(22.5) - RandomAngle(22.5); } else PickJumpMaxSpeed(actorNew, -600); @@ -1321,7 +1321,7 @@ int DoBunnyMove(DSWActor* actor) NewStateGroup(actor,sg_BunnyStand); break; default: - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); actor->user.jump_speed = -350; DoActorBeginJump(actor); actor->user.ActorActionFunc = DoActorMoveJump; diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index 0fb17eb35..96e81c851 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -558,7 +558,7 @@ int NewCoolg(DSWActor* actor) { ANIMATOR DoActorDecide; - auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->sector(), actor->spr.pos, actor->spr.angle, 50/16.); + auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 50/16.); ChangeState(actorNew, &s_CoolgBirth[0]); actorNew->user.StateEnd = s_CoolgDie; @@ -750,9 +750,9 @@ int DoCoolgCircle(DSWActor* actor) { double bound; - actor->spr.angle += mapangle(actor->user.Counter2); + actor->spr.Angles.Yaw += mapangle(actor->user.Counter2); - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { InitActorReposition(actor); return 0; @@ -810,7 +810,7 @@ int DoCoolgDeath(DSWActor* actor) DoActorSlide(actor); // slide while falling - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS); DoFindGroundPoint(actor); diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 1f56c031c..b52cbe986 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -115,7 +115,7 @@ int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view) // Get which of the 8 angles of the sprite to draw (0-7) // rotation ranges from 0-7 DAngle angle2 = (tsp->pos - view).Angle(); - rotation = (tsp->angle + DAngle180 + DAngle22_5 * 0.5 - angle2).Buildang() & 2047; + rotation = (tsp->Angles.Yaw + DAngle180 + DAngle22_5 * 0.5 - angle2).Buildang() & 2047; rotation = (rotation >> 8) & 7; if (ownerActor->user.RotNum == 5) @@ -385,7 +385,7 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp) DVector2 scale; double z_amt_per_pixel; - auto angle = tsp->angle + DAngle180; + auto angle = tsp->Angles.Yaw + DAngle180; if (!ownerActor->hasU() || ownerActor->vel.X == 0) { @@ -544,7 +544,7 @@ DSWActor* CopySprite(spritetypebase const* tsp, sectortype* newsector) actorNew->spr.scale = tsp->scale; actorNew->spr.xoffset = tsp->xoffset; actorNew->spr.yoffset = tsp->yoffset; - actorNew->spr.angle = tsp->angle; + actorNew->spr.Angles.Yaw = tsp->Angles.Yaw; actorNew->spr.xint = tsp->xint; actorNew->spr.yint = tsp->yint; actorNew->spr.inittype = tsp->inittype; @@ -693,7 +693,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub { tsp->picnum = DART_PIC; - tsp->angle -= DAngle90 + mapangle(24); + tsp->Angles.Yaw -= DAngle90 + mapangle(24); tsp->scale = DVector2(DART_REPEAT, DART_REPEAT); tsp->cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL); } @@ -757,7 +757,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub if (tsp->statnum == STAT_STAR_QUEUE) { tsp->picnum = DART_PIC; - tsp->angle -= DAngle90; + tsp->Angles.Yaw -= DAngle90; tsp->scale = DVector2(DART_REPEAT, DART_REPEAT); tsp->cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL); } @@ -788,7 +788,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub { // move sprite forward some so he looks like he's // climbing - pos.XY() = pp->si.XY() + tsp->angle.ToVector() * 13; + pos.XY() = pp->si.XY() + tsp->Angles.Yaw.ToVector() * 13; } else { @@ -798,7 +798,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub pos.Z = tsp->pos.Z + pp->si.Z + pp->getViewHeightDiff(); tsp->pos = pos; - tsp->angle = pp->siang; + tsp->Angles.Yaw = pp->siang; //continue; } else @@ -812,7 +812,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub { pp = tActor->user.PlayerP; tsp->pos = pp->actor->getRenderPos(interpfrac); - tsp->angle = pp->angle.interpolatedang(interpfrac); + tsp->Angles.Yaw = pp->angle.interpolatedang(interpfrac); } } @@ -966,7 +966,7 @@ std::pair GameInterface::GetCoordinates() { auto ppActor = Player[myconnectindex].actor; if (!ppActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle); - return std::make_pair(ppActor->spr.pos, ppActor->spr.angle); + return std::make_pair(ppActor->spr.pos, ppActor->spr.Angles.Yaw); } //--------------------------------------------------------------------------- @@ -1007,7 +1007,7 @@ void PrintSpriteInfo(PLAYER* pp) Printf("POSX:%2.3f, ", actor->spr.pos.X); Printf("POSY:%2.3f, ", actor->spr.pos.Y); Printf("POSZ:%2.3f,", actor->spr.pos.Z); - Printf("ANG:%2.0f\n", actor->spr.angle.Degrees()); + Printf("ANG:%2.0f\n", actor->spr.Angles.Yaw.Degrees()); } } } @@ -1280,7 +1280,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly) if (pp->sop_remote) { DSWActor* ractor = pp->remoteActor; - tang = TEST_BOOL1(ractor) ? ractor->spr.angle : (pp->sop_remote->pmid.XY() - tpos.XY()).Angle(); + tang = TEST_BOOL1(ractor) ? ractor->spr.Angles.Yaw : (pp->sop_remote->pmid.XY() - tpos.XY()).Angle(); } if (pp->Flags & (PF_VIEW_FROM_OUTSIDE)) @@ -1464,7 +1464,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, if (spnum >= 0) { - const auto daang = -((!SyncInput() ? actor->spr.angle : actor->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees(); + const auto daang = -((!SyncInput() ? actor->spr.Angles.Yaw : actor->interpolatedangle(interpfrac)) - cang).Normalized360().Degrees(); auto vect = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim); // This repeat scale is correct. diff --git a/source/games/sw/src/eel.cpp b/source/games/sw/src/eel.cpp index 3ba55d07e..7e781e5a3 100644 --- a/source/games/sw/src/eel.cpp +++ b/source/games/sw/src/eel.cpp @@ -551,7 +551,7 @@ int DoEelDeath(DSWActor* actor) DoActorSlide(actor); // slide while falling - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS); DoFindGroundPoint(actor); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 414d4dc6d..41acf44e1 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1961,7 +1961,7 @@ inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, DAngle range) inline bool FacingRange(DSWActor* a1, DSWActor* a2, DAngle range) { - return absangle((a1->spr.pos - a2->spr.pos).Angle(), a2->spr.angle) < range; + return absangle((a1->spr.pos - a2->spr.pos).Angle(), a2->spr.Angles.Yaw) < range; } inline void SET_BOOL1(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL1; } inline void SET_BOOL2(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL2; } @@ -2084,7 +2084,7 @@ inline void SetActorSizeX(DSWActor* sp) inline bool Facing(DSWActor* actor1, DSWActor* actor2) { - return absangle((actor1->spr.pos - actor2->spr.pos).Angle(), actor2->spr.angle) < DAngle90; + return absangle((actor1->spr.pos - actor2->spr.pos).Angle(), actor2->spr.Angles.Yaw) < DAngle90; } // Given a z height and sprite return the correct y repeat value diff --git a/source/games/sw/src/girlninj.cpp b/source/games/sw/src/girlninj.cpp index 1e92d8a28..9fb584b07 100644 --- a/source/games/sw/src/girlninj.cpp +++ b/source/games/sw/src/girlninj.cpp @@ -793,7 +793,7 @@ int DoGirlNinjaMove(DSWActor* actor) int GirlNinjaJumpActionFunc(DSWActor* actor) { // if cannot move the sprite - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { return 0; } diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index 867f260cf..a85e12e4a 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -465,17 +465,17 @@ int DoHornetCircle(DSWActor* actor) { double bound; - actor->spr.angle += mapangle(actor->user.Counter2); + actor->spr.Angles.Yaw += mapangle(actor->user.Counter2); - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { //ActorMoveHitReact(actor); // try moving in the opposite direction actor->user.Counter2 = -actor->user.Counter2; - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { InitActorReposition(actor); return 0; @@ -533,7 +533,7 @@ int DoHornetDeath(DSWActor* actor) DoActorSlide(actor); // slide while falling - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, 1, ACTORMOVETICS); diff --git a/source/games/sw/src/interpso.cpp b/source/games/sw/src/interpso.cpp index f81959fd4..85e539f13 100644 --- a/source/games/sw/src/interpso.cpp +++ b/source/games/sw/src/interpso.cpp @@ -238,7 +238,7 @@ static void so_setspriteanginterpolation(so_interp *interp, DSWActor* actor) data->curelement = soi_sprang; data->oldipos = data->lastipos = - data->lastoldipos = actor->spr.angle.Degrees(); + data->lastoldipos = actor->spr.Angles.Yaw.Degrees(); data->lastangdiff = nullAngle; data->actorofang = actor; } @@ -401,7 +401,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings actorofang->user.oangdiff = nullAngle; if (!interpolating) data->lastangdiff = nullAngle; - data->oldipos = actorofang->spr.angle.Degrees(); + data->oldipos = actorofang->spr.Angles.Yaw.Degrees(); } } else @@ -446,7 +446,7 @@ void so_dointerpolations(double interpfrac) // Stick at beg continue; // target went poof. interp->data[i].bakipos = (interp->data[i].curelement == soi_sprang) ? - actorofang->spr.angle.Degrees() : + actorofang->spr.Angles.Yaw.Degrees() : getvalue(interp->data[i]); } if (interp->tic == 0) // Only if the SO has just moved @@ -513,7 +513,7 @@ void so_dointerpolations(double interpfrac) // Stick at beg { DSWActor* actor = data->actorofang; if (!actor) continue; - actor->spr.angle = (DAngle::fromDeg(data->lastoldipos) + data->lastangdiff * ratio).Normalized360(); + actor->spr.Angles.Yaw = (DAngle::fromDeg(data->lastoldipos) + data->lastangdiff * ratio).Normalized360(); } else { @@ -548,7 +548,7 @@ void so_restoreinterpolations(void) // Stick at end of drawscree if (data->curelement == soi_sprang) { auto actorofang = interp->data[i].actorofang; - if (actorofang) actorofang->spr.angle = DAngle::fromDeg(data->bakipos); + if (actorofang) actorofang->spr.Angles.Yaw = DAngle::fromDeg(data->bakipos); } else { diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 3cca49ca7..a5fe19583 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -310,7 +310,7 @@ void JS_InitMirrors(void) { mirror[mirrorcnt].cameraActor = itActor; // Set up camera variables - itActor->user.sang = itActor->spr.angle; // Set current angle to sprite angle + itActor->user.sang = itActor->spr.Angles.Yaw; // Set current angle to sprite angle Found_Cam = true; } } @@ -323,7 +323,7 @@ void JS_InitMirrors(void) { mirror[mirrorcnt].cameraActor = itActor; // Set up camera variables - itActor->user.sang = itActor->spr.angle; // Set current angle to sprite angle + itActor->user.sang = itActor->spr.Angles.Yaw; // Set current angle to sprite angle Found_Cam = true; } } @@ -569,7 +569,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio) camactor->user.sang += oscillation_angle; // TAG6 = Turn radius - if (absangle(camactor->spr.angle, camactor->user.sang) >= maxang) + if (absangle(camactor->spr.Angles.Yaw, camactor->user.sang) >= maxang) { camactor->user.sang -= oscillation_angle; RESET_BOOL3(camactor); // Reverse turn direction. @@ -581,7 +581,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio) camactor->user.sang -= oscillation_angle; // TAG6 = Turn radius - if (absangle(camactor->spr.angle, camactor->user.sang) >= maxang) + if (absangle(camactor->spr.Angles.Yaw, camactor->user.sang) >= maxang) { camactor->user.sang += oscillation_angle; SET_BOOL3(camactor); // Reverse turn direction. @@ -590,7 +590,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio) } else if (!TEST_BOOL2(camactor)) { - camactor->user.sang = camactor->spr.angle; // Copy sprite angle to tag5 + camactor->user.sang = camactor->spr.Angles.Yaw; // Copy sprite angle to tag5 } // Set the horizon value. diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 947c08025..ddcf47482 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -302,7 +302,7 @@ int DoWallBloodDrip(DSWActor* actor) void SpawnMidSplash(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle); + auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreSplash, actor->sector(), ActorVectOfMiddle(actor), actor->spr.Angles.Yaw); actorNew->spr.shade = -12; actorNew->spr.scale.X = ((70 - RandomRange(20)) * REPEAT_SCALE); @@ -328,7 +328,7 @@ void SpawnMidSplash(DSWActor* actor) void SpawnFloorSplash(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreFloorSplash, actor->sector(), actor->spr.pos, actor->spr.angle); + auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_GoreFloorSplash, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw); actorNew->spr.shade = -12; actorNew->spr.scale.X = ((70 - RandomRange(20)) * REPEAT_SCALE); @@ -405,15 +405,15 @@ int DoBloodSpray(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { SpawnMidSplash(actor); - QueueWallBlood(actor, hitActor->spr.angle); - WallBounce(actor, hitActor->spr.angle); + QueueWallBlood(actor, hitActor->spr.Angles.Yaw); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); } else { actor->user.change.X = actor->user.change.Y = 0; SpawnMidSplash(actor); - QueueWallBlood(actor, hitActor->spr.angle); + QueueWallBlood(actor, hitActor->spr.Angles.Yaw); KillActor(actor); return true; } @@ -432,7 +432,7 @@ int DoBloodSpray(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -529,7 +529,7 @@ int DoBloodSpray(DSWActor* actor) if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER))) { - auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSpray, actor->sector(), actor->spr.pos, actor->spr.angle, 6.25); + auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSpray, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 6.25); SetOwner(actor, actorNew); actorNew->spr.shade = -12; @@ -597,7 +597,7 @@ int DoPhosphorus(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hitActor->spr.angle); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); } else @@ -626,7 +626,7 @@ int DoPhosphorus(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -726,7 +726,7 @@ int DoPhosphorus(DSWActor* actor) if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) { - auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 6.25); + auto actorNew = SpawnActor(STAT_SKIP4, PUFF, s_PhosphorExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 6.25); actorNew->spr.hitag = LUMINOUS; // Always full brightness SetOwner(actor, actorNew); @@ -800,7 +800,7 @@ int DoChemBomb(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hitActor->spr.angle); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); } else @@ -828,7 +828,7 @@ int DoChemBomb(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -948,7 +948,7 @@ int DoChemBomb(DSWActor* actor) // if you haven't bounced or your going slow do some puffs if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) { - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), actor->spr.pos, actor->spr.angle, 6.25); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 6.25); SetOwner(actor, actorNew); actorNew->spr.shade = -40; @@ -1029,7 +1029,7 @@ int DoCaltrops(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hitActor->spr.angle); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 10000); } else @@ -1048,7 +1048,7 @@ int DoCaltrops(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -1182,7 +1182,7 @@ int SpawnRadiationCloud(DSWActor* actor) return -1; auto actorNew = SpawnActor(STAT_MISSILE, RADIATION_CLOUD, s_RadiationCloud, actor->sector(), - actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.angle); + actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.Angles.Yaw); SetOwner(GetOwner(actor), actorNew); actorNew->user.WaitTics = 1 * 120; @@ -1200,7 +1200,7 @@ int SpawnRadiationCloud(DSWActor* actor) //if (RANDOM_P2(1024) < 512) //actorNew->spr.cstat |= (CSTAT_SPRITE_YFLIP); - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->vel.X = RandomRangeF(2); actorNew->user.Counter = 0; @@ -1209,7 +1209,7 @@ int SpawnRadiationCloud(DSWActor* actor) if (actor->user.ID == MUSHROOM_CLOUD || actor->user.ID == 3121) { actorNew->user.Radius = 2000; - actorNew->user.change.XY() = actorNew->spr.angle.ToVector() * actorNew->vel.X * 0.25; + actorNew->user.change.XY() = actorNew->spr.Angles.Yaw.ToVector() * actorNew->vel.X * 0.25; actorNew->vel.Z = 1 + RandomRangeF(2); } else @@ -1331,7 +1331,7 @@ int InitSpriteChemBomb(DSWActor* actor) // Spawn a shot // Inserting and setting up variables auto actorNew = SpawnActor(STAT_MISSILE, CHEMBOMB, s_ChemBomb, actor->sector(), - actor->spr.pos, actor->spr.angle, CHEMBOMB_VELOCITY); + actor->spr.pos, actor->spr.Angles.Yaw, CHEMBOMB_VELOCITY); actorNew->user.Flags |= (SPR_XFLIP_TOGGLE); @@ -1368,7 +1368,7 @@ int InitChemBomb(DSWActor* actor) { // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_ChemBomb, actor->sector(), actor->spr.pos, actor->spr.angle, CHEMBOMB_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_ChemBomb, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, CHEMBOMB_VELOCITY); actorNew->user.Flags |= (SPR_XFLIP_TOGGLE); @@ -1587,7 +1587,7 @@ void SpawnFlashBombOnActor(DSWActor* actor) } auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, actor->sector(), - actor->spr.pos, actor->spr.angle); + actor->spr.pos, actor->spr.Angles.Yaw); if (actor != nullptr) actor->user.flameActor = actorNew; @@ -1688,7 +1688,7 @@ int InitCaltrops(DSWActor* actor) // Spawn a shot // Inserting and setting up variables auto actorNew = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, actor->sector(), - actor->spr.pos, actor->spr.angle, CHEMBOMB_VELOCITY / 2); + actor->spr.pos, actor->spr.Angles.Yaw, CHEMBOMB_VELOCITY / 2); actorNew->user.Flags |= (SPR_XFLIP_TOGGLE); @@ -1779,7 +1779,7 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity) // } vel = velocity; - DAngle ang = actor->spr.angle; + DAngle ang = actor->spr.Angles.Yaw; for (int i=0; ispr.angle = attached->spr.angle + DAngle270; + actor->spr.Angles.Yaw = attached->spr.Angles.Yaw + DAngle270; } // not activated yet @@ -2070,7 +2070,7 @@ int DoCarryFlagNoDet(DSWActor* actor) if (attached != nullptr) { SetActorZ(actor, ActorVectOfMiddle(attached)); - actor->spr.angle = attached->spr.angle + DAngle270; + actor->spr.Angles.Yaw = attached->spr.Angles.Yaw + DAngle270; actor->spr.pos.Z = attached->spr.pos.Z - (ActorSizeZ(attached) * 0.5); } @@ -2192,7 +2192,7 @@ int SpawnShell(DSWActor* actor, int ShellNum) break; } - auto actorNew = SpawnActor(STAT_SKIP4, id, p, actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 4); + auto actorNew = SpawnActor(STAT_SKIP4, id, p, actor->sector(), ActorVectOfMiddle(actor), actor->spr.Angles.Yaw, 4); actorNew->vel.Z = -velocity; @@ -2208,21 +2208,21 @@ int SpawnShell(DSWActor* actor, int ShellNum) if (ShellNum == -3) { - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; HelpMissileLateral(actorNew,2500); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; HelpMissileLateral(actorNew,1000); // Was 1500 - actorNew->spr.angle += mapangle(712); // somewhat weird number... + actorNew->spr.Angles.Yaw += mapangle(712); // somewhat weird number... } else { - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; HelpMissileLateral(actorNew,2500); - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew,1500); - actorNew->spr.angle -= DAngle22_5; + actorNew->spr.Angles.Yaw -= DAngle22_5; } - actorNew->spr.angle += RandomAngle(22.5) - DAngle22_5/2; + actorNew->spr.Angles.Yaw += RandomAngle(22.5) - DAngle22_5/2; actorNew->norm_ang(); // Set the shell number @@ -2231,12 +2231,12 @@ int SpawnShell(DSWActor* actor, int ShellNum) break; case SHOT_SHELL: actorNew->spr.pos.Z -= 13; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; HelpMissileLateral(actorNew,2500); - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew,1300); - actorNew->spr.angle -= DAngle22_5 * 1.5; - actorNew->spr.angle += RandomAngle(22.5) - DAngle22_5/2; + actorNew->spr.Angles.Yaw -= DAngle22_5 * 1.5; + actorNew->spr.Angles.Yaw += RandomAngle(22.5) - DAngle22_5/2; actorNew->norm_ang(); // Set the shell number diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index ad907f7ba..d90cd30d5 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -2063,7 +2063,7 @@ int DoNinjaMove(DSWActor* actor) int NinjaJumpActionFunc(DSWActor* actor) { // if cannot move the sprite - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { return 0; } diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 5f7e4514a..265512b15 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1200,7 +1200,7 @@ DSWActor* DoPickTarget(DSWActor* actor, DAngle max_delta_ang, int skip_targets) // Get the angle difference - DAngle delta_ang = absangle(angle2, actor->spr.angle); + DAngle delta_ang = absangle(angle2, actor->spr.Angles.Yaw); // If delta_ang not in the range skip this one if (delta_ang > max_delta_ang) @@ -1342,10 +1342,10 @@ void DoPlayerTeleportToOffset(PLAYER* pp) void DoSpawnTeleporterEffect(DSWActor* actor) { extern STATE s_TeleportEffect[]; - DVector2 vect = actor->spr.angle.ToVector() * 32; + DVector2 vect = actor->spr.Angles.Yaw.ToVector() * 32; auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), - ActorVectOfTop(actor).plusZ(16) + vect, actor->spr.angle); + ActorVectOfTop(actor).plusZ(16) + vect, actor->spr.Angles.Yaw); SetActorZ(effectActor, effectActor->spr.pos); @@ -1367,7 +1367,7 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor) { extern STATE s_TeleportEffect[]; - auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfTop(actor).plusZ(16), actor->spr.angle); + auto effectActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfTop(actor).plusZ(16), actor->spr.Angles.Yaw); SetActorZ(effectActor, effectActor->spr.pos); @@ -1413,7 +1413,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp) break; default: { - DoPlayerTeleportToSprite(pp, act_warp->spr.pos, act_warp->spr.angle); + DoPlayerTeleportToSprite(pp, act_warp->spr.pos, act_warp->spr.Angles.Yaw); PlaySound(DIGI_TELEPORT, pp, v3df_none); @@ -1510,14 +1510,14 @@ void UpdatePlayerSpriteAngle(PLAYER* pp) { DSWActor* plActor = pp->actor; plActor->backupang(); - plActor->spr.angle = pp->angle.ang; + plActor->spr.Angles.Yaw = pp->angle.ang; plActor = pp->PlayerUnderActor; if (!Prediction && plActor) { plActor->backupang(); - plActor->spr.angle = pp->angle.ang; + plActor->spr.Angles.Yaw = pp->angle.ang; } } @@ -1561,7 +1561,7 @@ void DoPlayerTurnVehicle(PLAYER* pp, float avel, double zz, double floordist) if (MultiClipTurn(pp, sum, zz, floordist)) { pp->angle.ang = sum; - pp->actor->spr.angle = pp->angle.ang; + pp->actor->spr.Angles.Yaw = pp->angle.ang; } } } @@ -1595,7 +1595,7 @@ void DoPlayerTurnVehicleRect(PLAYER* pp, DVector2* pos, DVector2* opos) if (RectClipTurn(pp, sum, pos, opos)) { pp->angle.ang = sum; - pp->actor->spr.angle = pp->angle.ang; + pp->actor->spr.Angles.Yaw = pp->angle.ang; } } } @@ -1641,7 +1641,7 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel) } pp->angle.ang = new_ang; - pp->actor->spr.angle = pp->angle.ang; + pp->actor->spr.Angles.Yaw = pp->angle.ang; } OperateSectorObject(pp->sop, pp->angle.ang, pp->sop->pmid); @@ -1850,7 +1850,7 @@ void UpdatePlayerSprite(PLAYER* pp) if (pp->Flags & (PF_DEAD)) { ChangeActorSect(pp->actor, pp->cursector); - actor->spr.angle = pp->angle.ang; + actor->spr.Angles.Yaw = pp->angle.ang; UpdatePlayerUnderSprite(pp); return; } @@ -1896,7 +1896,7 @@ void UpdatePlayerSprite(PLAYER* pp) UpdatePlayerUnderSprite(pp); - actor->spr.angle = pp->angle.ang; + actor->spr.Angles.Yaw = pp->angle.ang; } //--------------------------------------------------------------------------- @@ -2373,7 +2373,7 @@ void DoTankTreads(PLAYER* pp) if (!TEST_BOOL2(actor)) { SET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } else @@ -2381,7 +2381,7 @@ void DoTankTreads(PLAYER* pp) if (TEST_BOOL2(actor)) { RESET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } @@ -2394,7 +2394,7 @@ void DoTankTreads(PLAYER* pp) if (!TEST_BOOL2(actor)) { SET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } else @@ -2402,7 +2402,7 @@ void DoTankTreads(PLAYER* pp) if (TEST_BOOL2(actor)) { RESET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } @@ -2415,7 +2415,7 @@ void DoTankTreads(PLAYER* pp) if (!TEST_BOOL2(actor)) { SET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } else @@ -2423,7 +2423,7 @@ void DoTankTreads(PLAYER* pp) if (TEST_BOOL2(actor)) { RESET_BOOL2(actor); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; } } @@ -3415,7 +3415,7 @@ void DoPlayerClimb(PLAYER* pp) // determine where the player is supposed to be in relation to the ladder // move out in front of the ladder - auto nvec = lActor->spr.angle.ToVector() * 31.25; + auto nvec = lActor->spr.Angles.Yaw.ToVector() * 31.25; // set ladder sector pp->LadderSector = near.hitWall->twoSided()? near.hitWall->nextSector() : near.hitWall->sectorp(); @@ -3425,7 +3425,7 @@ void DoPlayerClimb(PLAYER* pp) pp->LadderPosition = lActor->spr.pos.XY() + nvec; - pp->angle.settarget(lActor->spr.angle + DAngle180); + pp->angle.settarget(lActor->spr.Angles.Yaw + DAngle180); } } } @@ -3805,7 +3805,7 @@ bool PlayerOnLadder(PLAYER* pp) // determine where the player is supposed to be in relation to the ladder // move out in front of the ladder - auto npos = lActor->spr.angle.ToVector() * 31.25; + auto npos = lActor->spr.Angles.Yaw.ToVector() * 31.25; pp->LadderSector = near.hitWall->twoSided() ? near.hitWall->nextSector() : near.hitWall->sectorp(); @@ -3813,7 +3813,7 @@ bool PlayerOnLadder(PLAYER* pp) // the sprite pp->LadderPosition = lActor->spr.pos + npos; - pp->angle.settarget(lActor->spr.angle + DAngle180); + pp->angle.settarget(lActor->spr.Angles.Yaw + DAngle180); return true; } @@ -4664,7 +4664,7 @@ void DoPlayerDive(PLAYER* pp) if (bubble != nullptr) { // back it up a bit to get it out of your face - auto vec = (bubble->spr.angle + DAngle180).ToVector() * 12; + auto vec = (bubble->spr.Angles.Yaw + DAngle180).ToVector() * 12; move_sprite(bubble, DVector3(vec, 0), plActor->user.ceiling_dist, plActor->user.floor_dist, 0, synctics); } @@ -5334,7 +5334,7 @@ void DoPlayerStopOperate(PLAYER* pp) { DSWActor* rsp = pp->remoteActor; if (TEST_BOOL1(rsp)) - pp->angle.ang = pp->angle.oang = rsp->spr.angle; + pp->angle.ang = pp->angle.oang = rsp->spr.Angles.Yaw; else pp->angle.ang = pp->angle.oang = (pp->sop_remote->pmid.XY() - pp->actor->spr.pos.XY()).Angle(); } @@ -6004,7 +6004,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) plActor->spr.picnum = plActor->user.State->Pic; plActor->spr.picnum = plActor->user.State->Pic; plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); - plActor->spr.angle = pp->angle.ang; + plActor->spr.Angles.Yaw = pp->angle.ang; DoSpawnTeleporterEffect(plActor); PlaySound(DIGI_TELEPORT, pp, v3df_none); @@ -6153,7 +6153,7 @@ void DoPlayerDeathMoveHead(PLAYER* pp) break; - DAngle wall_ang = hitActor->spr.angle; + DAngle wall_ang = hitActor->spr.Angles.Yaw; DAngle dang = deltaangle(wall_ang, plActor->user.slide_ang); plActor->user.slide_ang = wall_ang + DAngle180 - dang; @@ -7203,7 +7203,7 @@ void PlayerSpawnPosition(PLAYER* pp) ASSERT(spawn_sprite != nullptr); - pp->angle.ang = pp->angle.oang = spawn_sprite->spr.angle; + pp->angle.ang = pp->angle.oang = spawn_sprite->spr.Angles.Yaw; pp->setcursector(spawn_sprite->sector()); if (pp->actor) diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 2fcaef44d..de8c7651d 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -945,7 +945,7 @@ int InitRipperHang(DSWActor* actor) for (auto dang = nullAngle; dang < DAngle360; dang += DAngle22_5) { - auto tang = actor->spr.angle + dang; + auto tang = actor->spr.Angles.Yaw + dang; FAFhitscan(actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->sector(), DVector3(tang.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); @@ -960,7 +960,7 @@ int InitRipperHang(DSWActor* actor) } Found = true; - actor->spr.angle = tang; + actor->spr.Angles.Yaw = tang; break; } @@ -1013,7 +1013,7 @@ int DoRipperHang(DSWActor* actor) int DoRipperMoveHang(DSWActor* actor) { // if cannot move the sprite - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { if (actor->user.coll.type == kHitWall) { @@ -1021,7 +1021,7 @@ int DoRipperMoveHang(DSWActor* actor) actor->user.WaitTics = 2 + ((RANDOM_P2(4 << 8) >> 8) * 120); // hang flush with the wall - actor->spr.angle = actor->user.coll.hitWall->delta().Angle() - DAngle90; + actor->spr.Angles.Yaw = actor->user.coll.hitWall->delta().Angle() - DAngle90; return 0; } @@ -1075,9 +1075,9 @@ int DoRipperBeginJumpAttack(DSWActor* actor) Collision coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS); if (coll.type != kHitNone) - actor->spr.angle += RandomAngle(DAngle45) + DAngle180 - DAngle22_5; + actor->spr.Angles.Yaw += RandomAngle(DAngle45) + DAngle180 - DAngle22_5; else - actor->spr.angle = vec.Angle() + RandomAngle(DAngle45) - DAngle22_5; + actor->spr.Angles.Yaw = vec.Angle() + RandomAngle(DAngle45) - DAngle22_5; DoActorSetSpeed(actor, FAST_SPEED); @@ -1198,7 +1198,7 @@ int DoRipperRipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face ripper - target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); + target->spr.Angles.Yaw = (actor->spr.pos - target->spr.pos).Angle(); return 0; } @@ -1234,7 +1234,7 @@ void RipperHatch(DSWActor* actor) ClearOwner(actorNew); actorNew->spr.pos = actor->spr.pos; actorNew->spr.scale = DVector2(1, 1); - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->spr.pal = 0; SetupRipper(actorNew); diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index b6333cb17..4ddc36dff 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -942,7 +942,7 @@ int InitRipper2Hang(DSWActor* actor) for (DAngle dang = nullAngle; dang < DAngle360; dang += DAngle22_5) { - auto tang = actor->spr.angle + dang; + auto tang = actor->spr.Angles.Yaw + dang; FAFhitscan(actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->sector(), DVector3(tang.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); @@ -957,7 +957,7 @@ int InitRipper2Hang(DSWActor* actor) } Found = true; - actor->spr.angle = tang; + actor->spr.Angles.Yaw = tang; break; } @@ -1011,7 +1011,7 @@ int DoRipper2Hang(DSWActor* actor) int DoRipper2MoveHang(DSWActor* actor) { // if cannot move the sprite - if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) + if (!move_actor(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * actor->vel.X, 0))) { if (actor->user.coll.type == kHitWall) { @@ -1029,7 +1029,7 @@ int DoRipper2MoveHang(DSWActor* actor) actor->user.WaitTics = 0; // Double jump // hang flush with the wall - actor->spr.angle = actor->user.coll.hitWall->delta().Angle() - DAngle90; + actor->spr.Angles.Yaw = actor->user.coll.hitWall->delta().Angle() - DAngle90; return 0; } @@ -1084,9 +1084,9 @@ int DoRipper2BeginJumpAttack(DSWActor* actor) Collision coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS); if (coll.type != kHitNone) - actor->spr.angle += RandomAngle(DAngle45) + DAngle180 - DAngle22_5; + actor->spr.Angles.Yaw += RandomAngle(DAngle45) + DAngle180 - DAngle22_5; else - actor->spr.angle = vec.Angle(); + actor->spr.Angles.Yaw = vec.Angle(); DoActorSetSpeed(actor, FAST_SPEED); @@ -1204,7 +1204,7 @@ int DoRipper2RipHeart(DSWActor* actor) actor->user.WaitTics = 6 * 120; // player face ripper2 - target->spr.angle = (actor->spr.pos - target->spr.pos).Angle(); + target->spr.Angles.Yaw = (actor->spr.pos - target->spr.pos).Angle(); return 0; } @@ -1243,7 +1243,7 @@ void Ripper2Hatch(DSWActor* actor) actorNew->spr.pos = actor->spr.pos; actorNew->spr.scale = DVector2(1, 1); - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->spr.pal = 0; actorNew->spr.shade = -10; SetupRipper2(actorNew); diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index 103368fe9..cac48b002 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -862,7 +862,7 @@ short FindViewSectorInScene(sectortype* cursect, int level) if (cursect == actor->sector()) { // ignore case if sprite is pointing up - if (actor->spr.angle == DAngle270) + if (actor->spr.Angles.Yaw == DAngle270) continue; // only gets to here is sprite is pointing down diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index ec687cba6..6415f1f87 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -914,7 +914,7 @@ void SectorExp(DSWActor* actor, sectortype* sectp, double zh) actor->spr.cstat &= ~(CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR); auto mid = SectorMidPoint(sectp); // randomize the explosions - actor->spr.angle = RandomAngle(45) + DAngle22_5; + actor->spr.Angles.Yaw = RandomAngle(45) + DAngle22_5; actor->spr.pos = { mid.X + RANDOM_P2F(16, 4) - 16, mid.Y + RANDOM_P2F(64, 4) - 64, zh }; // setup vars needed by SectorExp @@ -927,7 +927,7 @@ void SectorExp(DSWActor* actor, sectortype* sectp, double zh) exp->spr.scale.X += (((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE); exp->spr.scale.Y += (((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE); - exp->user.change.XY() = exp->spr.angle.ToVector(5.75); + exp->user.change.XY() = exp->spr.Angles.Yaw.ToVector(5.75); } @@ -2867,8 +2867,8 @@ void DoPanning(void) { sectp = actor->sector(); - nx = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Cos() * 0.25); - ny = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Sin() * 0.25); + nx = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Cos() * 0.25); + ny = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Sin() * 0.25); sectp->addfloorxpan((float)nx); sectp->addfloorypan((float)ny); @@ -2879,8 +2879,8 @@ void DoPanning(void) { sectp = actor->sector(); - nx = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Cos() * 0.25); - ny = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Sin() * 0.25); + nx = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Cos() * 0.25); + ny = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Sin() * 0.25); sectp->addceilingxpan((float)nx); sectp->addceilingypan((float)ny); @@ -2891,8 +2891,8 @@ void DoPanning(void) { wallp = actor->tempwall; - nx = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Cos() * 0.25); - ny = xs_CRoundToInt(actor->vel.X * actor->spr.angle.Sin() * 0.25); + nx = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Cos() * 0.25); + ny = xs_CRoundToInt(actor->vel.X * actor->spr.Angles.Yaw.Sin() * 0.25); wallp->addxpan((float)nx); wallp->addypan((float)ny); diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index f64772718..847910267 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -264,7 +264,7 @@ int SetupSkull(DSWActor* actor) int DoSkullMove(DSWActor* actor) { - auto vect = actor->spr.angle.ToVector() * actor->vel.X; + auto vect = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; double daz = actor->vel.Z; actor->user.coll = move_missile(actor, DVector3(vect, daz), 16, 16, CLIPMASK_MISSILE, ACTORMOVETICS); @@ -299,7 +299,7 @@ int DoSkullBeginDeath(DSWActor* actor) if (num_ord > 3) num_ord = 3; for (i=0; ispr.angle += DAngle180 * (i & 1); + actor->spr.Angles.Yaw += DAngle180 * (i & 1); InitSpriteChemBomb(actor); } break; @@ -311,7 +311,7 @@ int DoSkullBeginDeath(DSWActor* actor) if (num_ord > 10) num_ord = 10; for (i=0; ispr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitCaltrops(actor); } break; @@ -328,7 +328,7 @@ int DoSkullBeginDeath(DSWActor* actor) if (num_ord > 10) num_ord = 10; for (i=0; ispr.angle += DAngle360 * i / num_ord; + actor->spr.Angles.Yaw += DAngle360 * i / num_ord; InitSpriteGrenade(actor); } break; @@ -336,7 +336,7 @@ int DoSkullBeginDeath(DSWActor* actor) SpawnMineExp(actor); for (i=0; i<3; i++) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitPhosphorus(actor); } break; @@ -368,7 +368,7 @@ int DoSkullJump(DSWActor* actor) if(actor->vel.X != 0) DoSkullMove(actor); else - actor->spr.angle += DAngle22_5 * 0.5 * ACTORMOVETICS; + actor->spr.Angles.Yaw += DAngle22_5 * 0.5 * ACTORMOVETICS; if (actor->user.Flags & (SPR_JUMPING)) { @@ -486,13 +486,13 @@ int DoSkullWait(DSWActor* actor) else // above the floor type { - actor->spr.angle += DAngle22_5 * 0.375 * ACTORMOVETICS; + actor->spr.Angles.Yaw += DAngle22_5 * 0.375 * ACTORMOVETICS; DoSkullBob(actor); if (dist < 500) { - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); actor->vel.X = 8 + RandomRangeF(16); actor->user.jump_speed = -700; NewStateGroup(actor, sg_SkullJump); @@ -706,7 +706,7 @@ int DoBettyBeginDeath(DSWActor* actor) if (num_ord > 3) num_ord = 3; for (i=0; ispr.angle += DAngle180 * (i & 1); + actor->spr.Angles.Yaw += DAngle180 * (i & 1); InitSpriteChemBomb(actor); } break; @@ -718,7 +718,7 @@ int DoBettyBeginDeath(DSWActor* actor) if (num_ord > 10) num_ord = 10; for (i=0; ispr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitCaltrops(actor); } break; @@ -734,14 +734,14 @@ int DoBettyBeginDeath(DSWActor* actor) if (num_ord > 10) num_ord = 10; for (i=0; ispr.angle += DAngle360 * i / num_ord; + actor->spr.Angles.Yaw += DAngle360 * i / num_ord; InitSpriteGrenade(actor); } break; default: for (i=0; i<5; i++) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitPhosphorus(actor); SpawnMineExp(actor); } @@ -773,7 +773,7 @@ int DoBettyJump(DSWActor* actor) if(actor->vel.X != 0) DoBettyMove(actor); else - actor->spr.angle += DAngle22_5 * 0.5 * ACTORMOVETICS; + actor->spr.Angles.Yaw += DAngle22_5 * 0.5 * ACTORMOVETICS; if (actor->user.Flags & (SPR_JUMPING)) { @@ -885,13 +885,13 @@ int DoBettyWait(DSWActor* actor) else // above the floor type { - actor->spr.angle += DAngle22_5 * 0.375 * ACTORMOVETICS; + actor->spr.Angles.Yaw += DAngle22_5 * 0.375 * ACTORMOVETICS; DoBettyBob(actor); if (dist < 8000) { - actor->spr.angle = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle(); actor->vel.X = 8 + RandomRangeF(16); actor->user.jump_speed = -700; NewStateGroup(actor, sg_BettyJump); diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index 19ef2ee94..fef8a60f8 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -599,7 +599,7 @@ void GameInterface::UpdateSounds(void) { DSWActor* rsp = pp->remoteActor; if (TEST_BOOL1(rsp)) - tang = rsp->spr.angle; + tang = rsp->spr.Angles.Yaw; else tang = (pp->sop_remote->pmid.XY() - pp->actor->spr.pos.XY()).Angle(); } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 3b5b2c4e2..88f2eee1b 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -928,7 +928,7 @@ DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, const DVe } spawnedActor->spr.scale = DVector2(1, 1); - spawnedActor->spr.angle = init_ang; + spawnedActor->spr.Angles.Yaw = init_ang; spawnedActor->vel.X = vel; return spawnedActor; @@ -1820,7 +1820,7 @@ void SpriteSetup(void) { sectp->u_defined = true; sectp->speed = actor->spr.lotag; - sectp->angle = actor->spr.angle; + sectp->angle = actor->spr.Angles.Yaw; KillActor(actor); } else if (bit & (SECTFX_NO_RIDE)) @@ -1939,7 +1939,7 @@ void SpriteSetup(void) case SECT_WALL_PAN_SPEED: { HitInfo hit{}; - hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); + hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); if (hit.hitWall == nullptr) { @@ -1953,7 +1953,7 @@ void SpriteSetup(void) actor->vel.X = 0; else actor->vel.X = actor->spr.lotag * maptoworld; - actor->spr.angle = mapangle(SP_TAG6(actor)); + actor->spr.Angles.Yaw = mapangle(SP_TAG6(actor)); // attach to the sector that contains the wall ChangeActorSect(actor, hit.hitSector); StartInterpolation(hit.hitWall, Interp_Wall_PanX); @@ -1965,7 +1965,7 @@ void SpriteSetup(void) case WALL_DONT_STICK: { HitInfo hit{}; - hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); + hitscan(actor->spr.pos.plusZ(-8), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); if (hit.hitWall == nullptr) { @@ -2564,10 +2564,10 @@ void SpriteSetup(void) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = actor->spr.pos; - actorNew->spr.angle += DAngle180; + actorNew->spr.Angles.Yaw += DAngle180; actorNew->spr.picnum = actor->spr.picnum; - actorNew->spr.pos += actor->spr.angle.ToVector() * 24; + actorNew->spr.pos += actor->spr.Angles.Yaw.ToVector() * 24; break; } @@ -3593,7 +3593,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = ActorVectOfMiddle(actor); - actorNew->spr.angle = nullAngle; + actorNew->spr.Angles.Yaw = nullAngle; actorNew->spr.extra = 0; // vel @@ -3632,7 +3632,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = ActorVectOfMiddle(actor); - actorNew->spr.angle = nullAngle; + actorNew->spr.Angles.Yaw = nullAngle; actorNew->spr.extra = 0; // vel @@ -3658,7 +3658,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = ActorVectOfMiddle(actor); - actorNew->spr.angle = nullAngle; + actorNew->spr.Angles.Yaw = nullAngle; actorNew->spr.extra = 0; // vel @@ -3687,7 +3687,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = ActorVectOfMiddle(actor); - actorNew->spr.angle = nullAngle; + actorNew->spr.Angles.Yaw = nullAngle; actorNew->spr.extra = 0; // vel @@ -3747,7 +3747,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = ActorVectOfMiddle(actor); - actorNew->spr.angle = nullAngle; + actorNew->spr.Angles.Yaw = nullAngle; actorNew->spr.extra = 0; // vel @@ -3804,7 +3804,7 @@ int ActorCoughItem(DSWActor* actor) actorNew->spr.extra = 0; actorNew->spr.pos.XY() = actor->spr.pos.XY(); actorNew->spr.pos.Z = ActorLowerZ(actor) + 10; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; // vel SP_TAG7(actorNew) = 10; @@ -3873,23 +3873,23 @@ int SpawnItemsMatch(short match) case 90: spawnedActor = BunnyHatch2(itActor); spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER8; // Boy - spawnedActor->spr.angle = itActor->spr.angle; + spawnedActor->spr.Angles.Yaw = itActor->spr.Angles.Yaw; break; case 91: spawnedActor = BunnyHatch2(itActor); spawnedActor->user.spal = spawnedActor->spr.pal = PALETTE_PLAYER0; // Girl - spawnedActor->spr.angle = itActor->spr.angle; + spawnedActor->spr.Angles.Yaw = itActor->spr.Angles.Yaw; break; case 92: spawnedActor = BunnyHatch2(itActor); - spawnedActor->spr.angle = itActor->spr.angle; + spawnedActor->spr.Angles.Yaw = itActor->spr.Angles.Yaw; break; case 40: if (!ItemSpotClear(itActor, STAT_ITEM, ICON_REPAIR_KIT)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_REPAIR_KIT, s_RepairKit, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_REPAIR_KIT, s_RepairKit, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3900,7 +3900,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_STAR)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_STAR, s_IconStar, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_STAR, s_IconStar, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3911,7 +3911,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_MINE)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_MINE, s_IconLgMine, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_MINE, s_IconLgMine, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3922,7 +3922,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MICRO_GUN)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_GUN, s_IconMicroGun, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_GUN, s_IconMicroGun, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3933,7 +3933,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MICRO_BATTERY)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_BATTERY, s_IconMicroBattery, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_MICRO_BATTERY, s_IconMicroBattery, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3944,7 +3944,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GRENADE_LAUNCHER)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_GRENADE_LAUNCHER, s_IconGrenadeLauncher, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_GRENADE_LAUNCHER, s_IconGrenadeLauncher, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3955,7 +3955,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_GRENADE)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_GRENADE, s_IconLgGrenade, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_GRENADE, s_IconLgGrenade, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3966,7 +3966,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_RAIL_GUN)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_GUN, s_IconRailGun, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_GUN, s_IconRailGun, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3977,7 +3977,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_RAIL_AMMO)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_AMMO, s_IconRailAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_RAIL_AMMO, s_IconRailAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3988,7 +3988,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_ROCKET)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_ROCKET, s_IconRocket, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_ROCKET, s_IconRocket, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -3999,7 +3999,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_SHOTGUN)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_SHOTGUN, s_IconShotgun, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_SHOTGUN, s_IconShotgun, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4010,7 +4010,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_SHOTSHELL)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_SHOTSHELL, s_IconLgShotshell, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_SHOTSHELL, s_IconLgShotshell, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4021,7 +4021,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GUARD_HEAD)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4032,7 +4032,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_FIREBALL_LG_AMMO)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_FIREBALL_LG_AMMO, s_IconFireballLgAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_FIREBALL_LG_AMMO, s_IconFireballLgAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4043,7 +4043,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4054,7 +4054,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART_LG_AMMO)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART_LG_AMMO, s_IconHeartLgAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART_LG_AMMO, s_IconHeartLgAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4066,7 +4066,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_ARMOR)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_ARMOR, s_IconArmor, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_ARMOR, s_IconArmor, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4083,7 +4083,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_MEDKIT)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_MEDKIT, s_IconMedkit, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_MEDKIT, s_IconMedkit, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4094,7 +4094,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_SM_MEDKIT)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_SM_MEDKIT, s_IconSmMedkit, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_SM_MEDKIT, s_IconSmMedkit, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4105,7 +4105,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CHEMBOMB)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_CHEMBOMB, s_IconChemBomb, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_CHEMBOMB, s_IconChemBomb, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4116,7 +4116,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_FLASHBOMB)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_FLASHBOMB, s_IconFlashBomb, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_FLASHBOMB, s_IconFlashBomb, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4127,7 +4127,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_NUKE)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_NUKE, s_IconNuke, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_NUKE, s_IconNuke, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4138,7 +4138,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CALTROPS)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_CALTROPS, s_IconCaltrops, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_CALTROPS, s_IconCaltrops, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4149,7 +4149,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_BOOSTER)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_BOOSTER, s_IconBooster, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_BOOSTER, s_IconBooster, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4160,7 +4160,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEAT_CARD)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_HEAT_CARD, s_IconHeatCard, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_HEAT_CARD, s_IconHeatCard, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4171,7 +4171,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_CLOAK)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_CLOAK, s_IconCloak, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_CLOAK, s_IconCloak, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4182,7 +4182,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_NIGHT_VISION)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_NIGHT_VISION, s_IconNightVision, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_NIGHT_VISION, s_IconNightVision, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4194,7 +4194,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_LG_UZI_AMMO)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_UZI_AMMO, s_IconLgUziAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_LG_UZI_AMMO, s_IconLgUziAmmo, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4205,7 +4205,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_GUARD_HEAD)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_GUARD_HEAD, s_IconGuardHead, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4216,7 +4216,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_HEART)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_HEART, s_IconHeart, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4228,7 +4228,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_UZIFLOOR)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_UZIFLOOR, s_IconUziFloor, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_UZIFLOOR, s_IconUziFloor, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4242,7 +4242,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, ICON_UZI)) break; - spawnedActor = SpawnActor(STAT_ITEM, ICON_UZI, s_IconUzi, itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, ICON_UZI, s_IconUzi, itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->user.Flags2 |= SPR2_NEVER_RESPAWN; IconDefault(spawnedActor); @@ -4288,7 +4288,7 @@ int SpawnItemsMatch(short match) if (!ItemSpotClear(itActor, STAT_ITEM, s_Key[num]->Pic)) break; - spawnedActor = SpawnActor(STAT_ITEM, s_Key[num]->Pic, s_Key[num], itActor->sector(), itActor->spr.pos, itActor->spr.angle); + spawnedActor = SpawnActor(STAT_ITEM, s_Key[num]->Pic, s_Key[num], itActor->sector(), itActor->spr.pos, itActor->spr.Angles.Yaw); spawnedActor->spr.picnum = spawnedActor->user.ID = s_Key[num]->Pic; @@ -4625,7 +4625,7 @@ bool ActorDrop(DSWActor* actor, const DVector3& pos, sectortype* new_sector, dou bool DropAhead(DSWActor* actor, double min_height) { - auto vect = actor->spr.pos + actor->spr.angle.ToVector() * 16; + auto vect = actor->spr.pos + actor->spr.Angles.Yaw.ToVector() * 16; auto newsector = actor->sector(); updatesector(vect, &newsector); @@ -4761,7 +4761,7 @@ int DoGrating(DSWActor* actor) const double GRATE_FACTOR = GRATE_FACTORI * maptoworld; // reduce to 0 to 3 value - dir = int(actor->spr.angle.Normalized360().Degrees()) / 90; + dir = int(actor->spr.Angles.Yaw.Normalized360().Degrees()) / 90; DVector2 v(0, 0); if ((dir & 1) == 0) @@ -4801,7 +4801,7 @@ int DoGrating(DSWActor* actor) int DoKey(DSWActor* actor) { - actor->spr.angle += mapangle(14 * ACTORMOVETICS); + actor->spr.Angles.Yaw += mapangle(14 * ACTORMOVETICS); DoGet(actor); return 0; @@ -5001,7 +5001,7 @@ int DoSpawnItemTeleporterEffect(DSWActor* actor) { extern STATE s_TeleportEffect[]; - auto effect = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), actor->spr.pos.plusZ(-12), actor->spr.angle); + auto effect = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), actor->spr.pos.plusZ(-12), actor->spr.Angles.Yaw); effect->spr.shade = -40; effect->spr.scale = DVector2(0.5625, 0.5625); diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index d6be3b145..abe837ef4 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -38,7 +38,7 @@ public: inline void UpdateChangeXY(DSWActor* actor) { - actor->user.change.XY() = actor->spr.angle.ToVector() * actor->vel.X; + actor->user.change.XY() = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; } inline void UpdateChange(DSWActor* actor, double zfactor = 1.0) diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 4b2008936..d7b139017 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -292,7 +292,7 @@ void TrackAddPoint(TRACK* t, TRACK_POINT* tp, DSWActor* actor) TRACK_POINT* tpoint = (tp + t->NumPoints); tpoint->pos = actor->spr.pos; - tpoint->angle = actor->spr.angle; + tpoint->angle = actor->spr.Angles.Yaw; tpoint->tag_low = actor->spr.lotag; tpoint->tag_high = actor->spr.hitag; @@ -308,7 +308,7 @@ DSWActor* TrackClonePoint(DSWActor* actor) actorNew->spr.cstat = 0; actorNew->spr.extra = 0; actorNew->spr.pos = actor->spr.pos; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->spr.lotag = actor->spr.lotag; actorNew->spr.hitag = actor->spr.hitag; @@ -354,12 +354,12 @@ void QuickJumpSetup(short stat, short lotag, short type) TrackAddPoint(t, tp, start_sprite); // add jump point - actor->spr.pos += actor->spr.angle.ToVector() * 4; + actor->spr.pos += actor->spr.Angles.Yaw.ToVector() * 4; actor->spr.lotag = lotag; TrackAddPoint(t, tp, actor); // add end point - end_sprite->spr.pos += end_sprite->spr.angle.ToVector() * 128; + end_sprite->spr.pos += end_sprite->spr.Angles.Yaw.ToVector() * 128; end_sprite->spr.lotag = TRACK_END; end_sprite->spr.hitag = 0; TrackAddPoint(t, tp, end_sprite); @@ -407,7 +407,7 @@ void QuickScanSetup(short stat, short lotag, short type) // add start point start_sprite->spr.lotag = TRACK_START; start_sprite->spr.hitag = 0; - start_sprite->spr.pos += start_sprite->spr.angle.ToVector() * 4; + start_sprite->spr.pos += start_sprite->spr.Angles.Yaw.ToVector() * 4; TrackAddPoint(t, tp, start_sprite); // add jump point @@ -415,7 +415,7 @@ void QuickScanSetup(short stat, short lotag, short type) TrackAddPoint(t, tp, actor); // add end point - end_sprite->spr.pos += end_sprite->spr.angle.ToVector() * 4; + end_sprite->spr.pos += end_sprite->spr.Angles.Yaw.ToVector() * 4; end_sprite->spr.lotag = TRACK_END; end_sprite->spr.hitag = 0; TrackAddPoint(t, tp, end_sprite); @@ -465,7 +465,7 @@ void QuickExitSetup(short stat, short type) KillActor(actor); // add end point - end_sprite->spr.pos += end_sprite->spr.angle.ToVector() * 64; + end_sprite->spr.pos += end_sprite->spr.Angles.Yaw.ToVector() * 64; end_sprite->spr.lotag = TRACK_END; end_sprite->spr.hitag = 0; TrackAddPoint(t, tp, end_sprite); @@ -510,7 +510,7 @@ void QuickLadderSetup(short stat, short lotag, short type) // add start point start_sprite->spr.lotag = TRACK_START; start_sprite->spr.hitag = 0; - start_sprite->spr.pos += (start_sprite->spr.angle + DAngle180).ToVector() * 16; + start_sprite->spr.pos += (start_sprite->spr.Angles.Yaw + DAngle180).ToVector() * 16; TrackAddPoint(t, tp, start_sprite); // add climb point @@ -518,7 +518,7 @@ void QuickLadderSetup(short stat, short lotag, short type) TrackAddPoint(t, tp, actor); // add end point - end_sprite->spr.pos += end_sprite->spr.angle.ToVector() * 32; + end_sprite->spr.pos += end_sprite->spr.Angles.Yaw.ToVector() * 32; end_sprite->spr.lotag = TRACK_END; end_sprite->spr.hitag = 0; TrackAddPoint(t, tp, end_sprite); @@ -849,7 +849,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop) itActor->user.Flags |= (SPR_SO_ATTACHED); - itActor->user.sang = itActor->spr.angle; + itActor->user.sang = itActor->spr.Angles.Yaw; itActor->user.spal = itActor->spr.pal; // search SO's sectors to make sure that it is not on a @@ -1193,7 +1193,7 @@ void SetupSectorObject(sectortype* sectp, short tag) KillActor(actor); break; case SO_LIMIT_TURN: - sop->limit_ang_center = actor->spr.angle; + sop->limit_ang_center = actor->spr.Angles.Yaw; sop->limit_ang_delta = mapangle(actor->spr.lotag); KillActor(actor); break; @@ -1214,7 +1214,7 @@ void SetupSectorObject(sectortype* sectp, short tag) KillActor(actor); break; case SO_ANGLE: - sop->ang = sop->ang_moving = actor->spr.angle; + sop->ang = sop->ang_moving = actor->spr.Angles.Yaw; sop->last_ang = sop->ang_orig = sop->ang; sop->spin_ang = nullAngle; KillActor(actor); @@ -1423,7 +1423,7 @@ void PlaceActorsOnTracks(void) actor->user.track = tag - TAG_ACTOR_TRACK_BEGIN; actor->norm_ang(); // if facing left go backward - if (actor->spr.angle > DAngle90 && actor->spr.angle < DAngle270) + if (actor->spr.Angles.Yaw > DAngle90 && actor->spr.Angles.Yaw < DAngle270) { actor->user.track_dir = -1; } @@ -1459,7 +1459,7 @@ void PlaceActorsOnTracks(void) } // check angle in the "forward" direction - actor->spr.angle = ((tpoint + actor->user.point)->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = ((tpoint + actor->user.point)->pos - actor->spr.pos).Angle(); } } @@ -1675,8 +1675,8 @@ PlayerPart: } } - auto oldang = actor->spr.angle; - actor->spr.angle = actor->user.sang; + auto oldang = actor->spr.Angles.Yaw; + actor->spr.Angles.Yaw = actor->user.sang; if (actor->user.Flags & (SPR_ON_SO_SECTOR)) { @@ -1691,12 +1691,12 @@ PlayerPart: if ((actor->sector()->walls[0].extra & WALLFX_LOOP_REVERSE_SPIN)) { actor->spr.pos.XY() = rotatepoint(sop->pmid.XY(), actor->spr.pos.XY(), -deltaangle); - actor->spr.angle -= deltaangle; + actor->spr.Angles.Yaw -= deltaangle; } else { actor->spr.pos.XY() = rotatepoint(sop->pmid.XY(), actor->spr.pos.XY(), deltaangle); - actor->spr.angle += deltaangle; + actor->spr.Angles.Yaw += deltaangle; } actor->norm_ang(); } @@ -1706,7 +1706,7 @@ PlayerPart: { // NOT part of a sector - independant of any sector actor->spr.pos.XY() = rotatepoint(sop->pmid.XY(), actor->spr.pos.XY(), deltaangle); - actor->spr.angle += deltaangle; + actor->spr.Angles.Yaw += deltaangle; actor->norm_ang(); } @@ -1716,7 +1716,7 @@ PlayerPart: SetActorZ(sop->so_actors[i], actor->spr.pos); } - actor->user.oangdiff += ::deltaangle(oldang, actor->spr.angle); + actor->user.oangdiff += ::deltaangle(oldang, actor->spr.Angles.Yaw); if ((actor->spr.extra & SPRX_BLADE)) { @@ -2763,7 +2763,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); } else { @@ -2780,7 +2780,7 @@ void DoActorHitTrackEndPoint(DSWActor* actor) if (actor->user.track >= 0) { auto tp = Track[actor->user.track].TrackPoint + actor->user.point; - actor->spr.angle = (tp->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tp->pos - actor->spr.pos).Angle(); } else { @@ -2903,7 +2903,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_JUMP: if (actor->user.ActorActionSet->Jump) { - actor->spr.angle = tpoint->angle; + actor->spr.Angles.Yaw = tpoint->angle; if (!tpoint->tag_high) actor->user.jump_speed = ACTOR_STD_JUMP; @@ -2923,7 +2923,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) int zdiff; HitInfo hit{}; - actor->spr.angle = tpoint->angle; + actor->spr.Angles.Yaw = tpoint->angle; ActorLeaveTrack(actor); @@ -2936,7 +2936,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) { actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); - FAFhitscan(actor->spr.pos.plusZ(-24), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); + FAFhitscan(actor->spr.pos.plusZ(-24), actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, 0), hit, CLIPMASK_MISSILE); actor->spr.cstat |= (CSTAT_SPRITE_BLOCK); @@ -2968,7 +2968,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) if (actor->user.ActorActionSet->Jump) { - actor->spr.angle = tpoint->angle; + actor->spr.Angles.Yaw = tpoint->angle; ActorLeaveTrack(actor); @@ -3002,7 +3002,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) if (actor->user.Rot != actor->user.ActorActionSet->Duck) { - actor->spr.angle = tpoint->angle; + actor->spr.Angles.Yaw = tpoint->angle; ActorLeaveTrack(actor); @@ -3027,14 +3027,14 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) if (actor->user.Rot == actor->user.ActorActionSet->Sit || actor->user.Rot == actor->user.ActorActionSet->Stand) return false; - actor->spr.angle = tpoint->angle; + actor->spr.Angles.Yaw = tpoint->angle; z[0] = actor->spr.pos.Z - ActorSizeZ(actor) + 5; z[1] = actor->spr.pos.Z - (ActorSizeZ(actor) * 0.5); for (auto& zz : z) { - neartag(DVector3(actor->spr.pos.XY(), zz), actor->sector(), actor->spr.angle, near, 64., NT_Lotag | NT_Hitag); + neartag(DVector3(actor->spr.pos.XY(), zz), actor->sector(), actor->spr.Angles.Yaw, near, 64., NT_Lotag | NT_Hitag); if (near.actor() != nullptr) { @@ -3238,18 +3238,18 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) // determine where the player is supposed to be in relation to the ladder // move out in front of the ladder - auto vec = lActor->spr.angle.ToVector() * 6.25; + auto vec = lActor->spr.Angles.Yaw.ToVector() * 6.25; actor->spr.pos.XY() = lActor->spr.pos.XY() + vec; - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; // // Get the z height to climb // double z = ActorZOfTop(actor) - (ActorSizeZ(actor) * 0.5); - neartag(DVector3(actor->spr.pos.XY(), z), actor->sector(), actor->spr.angle, near, 37.5, NT_Lotag | NT_Hitag | NT_NoSpriteCheck); + neartag(DVector3(actor->spr.pos.XY(), z), actor->sector(), actor->spr.Angles.Yaw, near, 37.5, NT_Lotag | NT_Hitag | NT_NoSpriteCheck); if (near.hitWall == nullptr) { @@ -3367,7 +3367,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG))) { - actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tpoint->pos - actor->spr.pos).Angle(); } double dist = (actor->spr.pos.XY() - tpoint->pos.XY()).Length(); @@ -3383,7 +3383,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) if (!(actor->user.Flags & (SPR_CLIMBING | SPR_DONT_UPDATE_ANG))) { // calculate a new angle to the target - actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tpoint->pos - actor->spr.pos).Angle(); } if (actor->user.Flags & (SPR_ZDIFF_MODE)) @@ -3429,7 +3429,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) actor->vel.Z = 0; - actor->spr.angle = (tpoint->pos - actor->spr.pos).Angle(); + actor->spr.Angles.Yaw = (tpoint->pos - actor->spr.pos).Angle(); ActorLeaveTrack(actor); actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); @@ -3446,7 +3446,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) else { // calculate a new x and y - vec.XY() = actor->spr.angle.ToVector() * actor->vel.X; + vec.XY() = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; } if (actor->vel.Z != 0) diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 2168a7fc0..a852cf275 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3178,7 +3178,7 @@ int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK short WaitTics = 64; // for FastShrap short shrap_type; int shrap_rand_zamt = 0; - DAngle shrap_angl = parentActor->spr.angle; + DAngle shrap_angl = parentActor->spr.Angles.Yaw; short shrap_delta_size = 0; short shrap_amt = 0; @@ -3684,11 +3684,11 @@ AutoShrap: if (p->random_disperse) { - actor->spr.angle = shrap_angl + mapangle(RANDOM_P2(p->ang_range << 5) >> 5) - (ang_range * 0.5); + actor->spr.Angles.Yaw = shrap_angl + mapangle(RANDOM_P2(p->ang_range << 5) >> 5) - (ang_range * 0.5); } else { - actor->spr.angle = start_angl + (dangl * i); + actor->spr.Angles.Yaw = start_angl + (dangl * i); } // for FastShrap @@ -3735,7 +3735,7 @@ AutoShrap: actor->user.pos.Y = shrap_ysize * REPEAT_SCALE; actor->user.Counter = (RANDOM_P2(2048<<5)>>5); - move_missile(actor, DVector3(actor->spr.angle.ToVector() * 16, 0), 8, 8, CLIPMASK_MISSILE, MISSILEMOVETICS); + move_missile(actor, DVector3(actor->spr.Angles.Yaw.ToVector() * 16, 0), 8, 8, CLIPMASK_MISSILE, MISSILEMOVETICS); if (RANDOM_P2(1024)<700) actor->user.ID = 0; @@ -4054,20 +4054,20 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, DAngle hit_angle, const DVe if (actor == weapActor) { p = HariKariBlood; - hit_angle = actor->spr.angle; + hit_angle = actor->spr.Angles.Yaw; hitpos = ActorVectOfTop(actor).plusZ(ActorSizeZ(actor) * (1./16.)); } else { p = ExtraBlood; - hit_angle = weapActor->spr.angle + DAngle180; + hit_angle = weapActor->spr.Angles.Yaw + DAngle180; hitpos.XY() = actor->spr.pos.XY(); hitpos.Z = ActorZOfTop(weapActor) + (ActorSizeZ(weapActor) * 0.25); } break; case SERP_RUN_R0: p = ExtraBlood; - hit_angle = weapActor->spr.angle + DAngle180; + hit_angle = weapActor->spr.Angles.Yaw + DAngle180; hitpos.XY() = actor->spr.pos.XY(); hitpos.Z = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25); break; @@ -4083,19 +4083,19 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, DAngle hit_angle, const DVe case STAR1: case CROSSBOLT: p = SomeBlood; - hit_angle = weapActor->spr.angle + DAngle180; + hit_angle = weapActor->spr.Angles.Yaw + DAngle180; hitpos.XY() = actor->spr.pos.XY(); hitpos.Z = weapActor->spr.pos.Z; break; case PLASMA_FOUNTAIN: p = PlasmaFountainBlood; - hit_angle = weapActor->spr.angle; + hit_angle = weapActor->spr.Angles.Yaw; hitpos.XY() = actor->spr.pos.XY(); hitpos.Z = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25); break; default: p = SomeBlood; - hit_angle = weapActor->spr.angle + DAngle180; + hit_angle = weapActor->spr.Angles.Yaw + DAngle180; hitpos.XY() = actor->spr.pos.XY(); hitpos.Z = ActorZOfTop(weapActor) + (ActorSizeZ(weapActor) * 0.25); break; @@ -4143,11 +4143,11 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, DAngle hit_angle, const DVe if (p->random_disperse) { - actorNew->spr.angle = hit_angle + mapangle((RANDOM_P2(p->ang_range<<5)>>5) - (p->ang_range >> 1)); + actorNew->spr.Angles.Yaw = hit_angle + mapangle((RANDOM_P2(p->ang_range<<5)>>5) - (p->ang_range >> 1)); } else { - actorNew->spr.angle = start_angle + (dangl * i); + actorNew->spr.Angles.Yaw = start_angle + (dangl * i); } actorNew->user.Flags |= (SPR_BOUNCE); @@ -4451,7 +4451,7 @@ bool WeaponMoveHit(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); return true; } @@ -4460,7 +4460,7 @@ bool WeaponMoveHit(DSWActor* actor) // on walls, so look with hitscan HitInfo hit{}; - hitscan(actor->spr.pos, actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, actor->vel.Z), hit, CLIPMASK_MISSILE); + hitscan(actor->spr.pos, actor->sector(), DVector3(actor->spr.Angles.Yaw.ToVector() * 1024, actor->vel.Z), hit, CLIPMASK_MISSILE); if (!hit.hitSector) { @@ -5136,7 +5136,7 @@ int ActorHealth(DSWActor* actor, short amt) PlaySound(DIGI_NINJACHOKE, actor, v3df_follow); InitPlasmaFountain(nullptr, actor); InitBloodSpray(actor,false,105); - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle() + DAngle90; + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle() + DAngle90; actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); if (sw_ninjahack) NewStateGroup(actor, sg_NinjaHariKari); @@ -5680,7 +5680,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5745,7 +5745,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5779,7 +5779,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5809,7 +5809,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5837,7 +5837,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5867,7 +5867,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5901,7 +5901,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5936,7 +5936,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -5967,7 +5967,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) { if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage/4, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage/4, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6043,7 +6043,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) // Is the player blocking? if (actor->user.PlayerP->WpnKungFuMove == 3) damage /= 3; - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6057,7 +6057,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6076,7 +6076,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6090,7 +6090,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6109,7 +6109,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6121,7 +6121,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6140,7 +6140,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6152,7 +6152,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6176,7 +6176,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) else if (actor->user.PlayerP) { //PlayerDamageSlide(actor->user.PlayerP, damage, AngToPlayer(actor->user.PlayerP, weapActor)); - PlayerDamageSlide(actor->user.PlayerP, damage/2, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage/2, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6190,7 +6190,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); switch (actor->user.ID) { @@ -6225,7 +6225,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6239,7 +6239,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6274,7 +6274,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6301,7 +6301,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6384,7 +6384,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage>>1, weapActor->spr.angle); + ActorDamageSlide(actor, damage>>1, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6769,7 +6769,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6794,7 +6794,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6859,7 +6859,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6871,7 +6871,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -6892,7 +6892,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) } else if (actor->user.PlayerP) { - PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.angle); + PlayerDamageSlide(actor->user.PlayerP, damage, weapActor->spr.Angles.Yaw); if (PlayerTakeDamage(actor->user.PlayerP, weapActor)) { PlayerUpdateHealth(actor->user.PlayerP, damage); @@ -6906,7 +6906,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor) ActorHealth(actor, damage); ActorPain(actor); ActorStdMissile(actor, weapActor); - ActorDamageSlide(actor, damage, weapActor->spr.angle); + ActorDamageSlide(actor, damage, weapActor->spr.Angles.Yaw); ActorChooseDeath(actor, weapActor); } @@ -7442,7 +7442,7 @@ int DoExpDamageTest(DSWActor* actor) if (actor->user.ID == MUSHROOM_CLOUD) return 0; // Central Nuke doesn't break stuff // Only secondaries do that - TraverseBreakableWalls(actor->sector(), actor->spr.pos, actor->spr.angle, actor->user.Radius); + TraverseBreakableWalls(actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, actor->user.Radius); break_count = 0; max_stat = SIZ(StatBreakList); @@ -7623,7 +7623,7 @@ int DoStar(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -7883,8 +7883,8 @@ int MissileSeek(DSWActor* actor, int16_t delay_tics, DAngle aware_range/*, int16 { // move to correct angle auto ang2tgt = (goal->spr.pos - actor->spr.pos).Angle(); - auto delta_ang = clamp(deltaangle(ang2tgt, actor->spr.angle), -DAngle45 / 8, DAngle45 / 8); - actor->spr.angle -= delta_ang; + auto delta_ang = clamp(deltaangle(ang2tgt, actor->spr.Angles.Yaw), -DAngle45 / 8, DAngle45 / 8); + actor->spr.Angles.Yaw -= delta_ang; double zh = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25); auto vel = clamp((zh - actor->spr.pos.Z)* 0.5, -16., 16.); @@ -7904,7 +7904,7 @@ int MissileSeek(DSWActor* actor, int16_t delay_tics, DAngle aware_range/*, int16 void SetAngleFromChange(DSWActor* actor) { - actor->spr.angle = actor->user.change.Angle(); + actor->spr.Angles.Yaw = actor->user.change.Angle(); } //--------------------------------------------------------------------------- @@ -8061,7 +8061,7 @@ int DoBlurExtend(DSWActor* actor, int16_t interval, int16_t blur_num) int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor) { - auto actorNew = SpawnActor(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sActor->sector(), ActorVectOfBottom(sActor), sActor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sActor->sector(), ActorVectOfBottom(sActor), sActor->spr.Angles.Yaw, 0); actorNew->spr.shade = -40; if (wActor) @@ -8096,7 +8096,7 @@ int DoPlasmaFountain(DSWActor* actor) // move with sprite SetActorZ(actor, attachActor->spr.pos); - actor->spr.angle = attachActor->spr.angle; + actor->spr.Angles.Yaw = attachActor->spr.Angles.Yaw; actor->user.Counter++; if (actor->user.Counter > 3) @@ -8135,7 +8135,7 @@ int DoPlasma(DSWActor* actor) auto oldv = actor->spr.pos; DoBlurExtend(actor, 0, 4); - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; double daz = actor->vel.Z; actor->user.coll = move_missile(actor, DVector3(vec, daz), 16, 16, CLIPMASK_MISSILE, MISSILEMOVETICS); @@ -8266,12 +8266,12 @@ void WallBounce(DSWActor* actor, DAngle ang) actor->user.change.X = davec.Y * k + davec.X * l; actor->user.change.Y = davec.X * k - davec.Y * l; - auto old_ang = actor->spr.angle; + auto old_ang = actor->spr.Angles.Yaw; SetAngleFromChange(actor); // hack to prevent missile from sticking to a wall // - if (old_ang == actor->spr.angle) + if (old_ang == actor->spr.Angles.Yaw) { actor->user.change.XY() = -actor->user.change.XY(); SetAngleFromChange(actor); @@ -8401,7 +8401,7 @@ int DoGrenade(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hitActor->spr.angle); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); } else @@ -8410,7 +8410,7 @@ int DoGrenade(DSWActor* actor) { for (i=0; i<5; i++) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitPhosphorus(actor); } } @@ -8432,7 +8432,7 @@ int DoGrenade(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -8477,7 +8477,7 @@ int DoGrenade(DSWActor* actor) { for (i=0; i<5; i++) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitPhosphorus(actor); } } @@ -8520,7 +8520,7 @@ int DoGrenade(DSWActor* actor) { for (i=0; i<5; i++) { - actor->spr.angle = RandomAngle(); + actor->spr.Angles.Yaw = RandomAngle(); InitPhosphorus(actor); } } @@ -8553,7 +8553,7 @@ int DoGrenade(DSWActor* actor) if (!(actor->user.Flags & (SPR_BOUNCE|SPR_UNDERWATER))) { auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), - actor->spr.pos, actor->spr.angle, 6.25); + actor->spr.pos, actor->spr.Angles.Yaw, 6.25); SetOwner(actor, actorNew); actorNew->spr.shade = -40; @@ -8610,7 +8610,7 @@ int DoVulcanBoulder(DSWActor* actor) if ((hitActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hitActor->spr.angle); + WallBounce(actor, hitActor->spr.Angles.Yaw); ScaleSpriteVector(actor, 40000); } else @@ -8632,7 +8632,7 @@ int DoVulcanBoulder(DSWActor* actor) if (wph->lotag == TAG_WALL_BREAK) { - HitBreakWall(wph, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(wph, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -9046,7 +9046,7 @@ int DoMine(DSWActor* actor) if (hit_wall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit_wall, actor->spr.pos, actor->spr.angle, actor->user.ID); + HitBreakWall(hit_wall, actor->spr.pos, actor->spr.Angles.Yaw, actor->user.ID); actor->user.coll.setNone(); break; } @@ -9123,7 +9123,7 @@ int DoBoltThinMan(DSWActor* actor) { DoBlurExtend(actor, 0, 4); - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; double daz = actor->vel.Z; actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS); @@ -9229,7 +9229,7 @@ int DoEMPBurst(DSWActor* actor) if (attachActor != nullptr) { SetActorZ(actor, attachActor->spr.pos.plusZ(-actor->user.pos.Z)); - actor->spr.angle = attachActor->spr.angle + DAngle180; + actor->spr.Angles.Yaw = attachActor->spr.Angles.Yaw + DAngle180; } // not activated yet @@ -9351,7 +9351,7 @@ int DoLaser(DSWActor* actor) spawn_count++; if (spawn_count < 256) { - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_LaserPuff, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_LaserPuff, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.shade = -40; actorNew->spr.scale = DVector2(0.25, 0.25); @@ -9448,7 +9448,7 @@ int DoRail(DSWActor* actor) spawn_count++; if (spawn_count < 128) { - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, &s_RailPuff[0][0], actor->sector(), actor->spr.pos, actor->spr.angle, 1.25); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, &s_RailPuff[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 1.25); actorNew->vel.X += RandomRangeF(140 / 16.) - RandomRangeF(140 / 16.); actorNew->vel.Z += RandomRangeF(140 / 256.) - RandomRangeF(140 / 256.); @@ -9550,7 +9550,7 @@ int DoRocket(DSWActor* actor) if (!actor->user.Counter) { - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), actor->spr.pos, actor->spr.angle, 6.25); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 6.25); SetOwner(actor, actorNew); actorNew->spr.shade = -40; @@ -9607,7 +9607,7 @@ int DoMicroMini(DSWActor* actor) int SpawnExtraMicroMini(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], actor->sector(), actor->spr.pos, actor->spr.angle, actor->vel.X); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Micro[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, actor->vel.X); SetOwner(GetOwner(actor), actorNew); actorNew->spr.scale = DVector2(actor->spr.scale.X, actor->spr.scale.X); @@ -9622,7 +9622,7 @@ int SpawnExtraMicroMini(DSWActor* actor) actorNew->user.floor_dist = actor->user.floor_dist; actorNew->spr.cstat = actor->spr.cstat; - actorNew->spr.angle += RandomAngle(11.25) - DAngle22_5/2; + actorNew->spr.Angles.Yaw += RandomAngle(11.25) - DAngle22_5/2; actorNew->vel.Z = -actor->vel.Z; actorNew->vel.Z += RandomRangeF(16) - 8; @@ -9650,7 +9650,7 @@ int DoMicro(DSWActor* actor) if (!actor->user.Counter) { auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), - actor->spr.pos, actor->spr.angle, 6.25); + actor->spr.pos, actor->spr.Angles.Yaw, 6.25); SetOwner(GetOwner(actor), actorNew); actorNew->spr.shade = -40; @@ -9706,7 +9706,7 @@ int DoUziBullet(DSWActor* actor) // otherwize the moves are in too big an increment for (int i = 0; i < 2; i++) { - auto vec = actor->spr.angle.ToVector() * actor->vel.X * 0.5; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X * 0.5; double daz = actor->vel.Z * 0.5; auto spos = actor->spr.pos.XY(); @@ -9722,11 +9722,11 @@ int DoUziBullet(DSWActor* actor) { WeaponMoveHit(actor); - auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.shade = -40; actorNew->spr.scale = DVector2(UZI_SMOKE_REPEAT, UZI_SMOKE_REPEAT); SetOwner(GetOwner(actor), actorNew); - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 8; actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER); @@ -9736,7 +9736,7 @@ int DoUziBullet(DSWActor* actor) actorNew->spr.shade = -40; actorNew->spr.scale = DVector2(UZI_SPARK_REPEAT, UZI_SPARK_REPEAT); SetOwner(GetOwner(actor), actorNew); - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); } @@ -9764,7 +9764,7 @@ int DoBoltSeeker(DSWActor* actor) MissileSeek(actor, 30, DAngle90 + DAngle45/*, 4, 48, 6*/); DoBlurExtend(actor, 0, 4); - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; double daz = actor->vel.Z; actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS); @@ -9809,7 +9809,7 @@ int DoElectro(DSWActor* actor) if (actor->user.Counter > 0) MissileSeek(actor, 30, DAngle90/*, 3, 52, 2*/); - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; double daz = actor->vel.Z; actor->user.coll = move_missile(actor, DVector3(vec, daz), CEILING_DIST, FLOOR_DIST, CLIPMASK_MISSILE, MISSILEMOVETICS); @@ -9920,12 +9920,12 @@ int SpawnCoolieExp(DSWActor* actor) actor->user.Counter = RandomRange(120); // This is the wait til birth time! - auto vect = actor->spr.pos + (actor->spr.angle + DAngle180).ToVector() * 4; + auto vect = actor->spr.pos + (actor->spr.Angles.Yaw + DAngle180).ToVector() * 4; vect.Z -= ActorSizeZ(actor) * 0.75; PlaySound(DIGI_COOLIEEXPLODE, actor, v3df_none); - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_EXP, s_BoltExp, actor->sector(), vect, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_EXP, s_BoltExp, actor->sector(), vect, actor->spr.Angles.Yaw, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness SetOwner(actor, actorNew); @@ -9995,7 +9995,7 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor) } } - auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness @@ -10061,7 +10061,7 @@ void SpawnFireballFlames(DSWActor* actor, DSWActor* enemyActor) int SpawnBreakFlames(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES+1, s_BreakFlames, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES+1, s_BreakFlames, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness @@ -10096,7 +10096,7 @@ int SpawnBreakFlames(DSWActor* actor) void SpawnBreakStaticFlames(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_STATIC_FIRE, FIREBALL_FLAMES, nullptr, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_STATIC_FIRE, FIREBALL_FLAMES, nullptr, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); if (RandomRange(1000) > 500) actorNew->spr.picnum = 3143; @@ -10134,7 +10134,7 @@ void SpawnFireballExp(DSWActor* actor) PlaySound(DIGI_SMALLEXP, actor, v3df_none); - auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_EXP, s_FireballExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_EXP, s_FireballExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.scale = DVector2(0.8125, 0.8125); SetOwner(GetOwner(actor), actorNew); @@ -10170,7 +10170,7 @@ void SpawnGoroFireballExp(DSWActor* actor) PlaySound(DIGI_MEDIUMEXP, actor, v3df_none); - auto actorNew = SpawnActor(STAT_MISSILE, 0, s_FireballExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, 0, s_FireballExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.scale = DVector2(0.25, 0.25); @@ -10203,7 +10203,7 @@ void SpawnBoltExp(DSWActor* actor) PlaySound(DIGI_BOLTEXPLODE, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, BOLT_EXP, s_BoltExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, BOLT_EXP, s_BoltExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10262,7 +10262,7 @@ void SpawnTankShellExp(DSWActor* actor) PlaySound(DIGI_BOLTEXPLODE, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, TANK_SHELL_EXP, s_TankShellExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, TANK_SHELL_EXP, s_TankShellExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10284,7 +10284,7 @@ void SpawnNuclearSecondaryExp(DSWActor* actor, DAngle ang) { ASSERT(actor->hasU()); - auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(), actor->spr.pos, actor->spr.angle, 32); + auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 32); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10346,7 +10346,7 @@ void SpawnNuclearExp(DSWActor* actor) } // Spawn big mushroom cloud - auto expActor = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_NukeMushroom, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_NukeMushroom, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(own, expActor); @@ -10361,7 +10361,7 @@ void SpawnNuclearExp(DSWActor* actor) // Do central explosion - expActor = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_GrenadeExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + expActor = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_GrenadeExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); SetOwner(own, expActor); expActor->spr.shade = -128; @@ -10408,9 +10408,9 @@ void SpawnTracerExp(DSWActor* actor) return ; if (actor->user.ID == BOLT_THINMAN_R1) - expActor = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, s_TracerExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + expActor = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, s_TracerExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); else - expActor = SpawnActor(STAT_MISSILE, TRACER_EXP, s_TracerExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + expActor = SpawnActor(STAT_MISSILE, TRACER_EXP, s_TracerExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10443,7 +10443,7 @@ void SpawnMicroExp(DSWActor* actor) if (actor->hasU() && (actor->user.Flags & SPR_SUICIDE)) return ; - auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_MicroExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_MicroExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10498,7 +10498,7 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECT* sop) actor->user.pos.XY() = sop->pmid.XY() - actor->spr.pos.XY(); actor->user.pos.Z = sop->mid_sector->floorz - actor->spr.pos.Z; - actor->user.sang = actor->spr.angle; + actor->user.sang = actor->spr.Angles.Yaw; } //--------------------------------------------------------------------------- @@ -10511,7 +10511,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECT* sop, { unsigned sn; - auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_BigGunFlame, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, MICRO_EXP, s_BigGunFlame, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(Operator, expActor); @@ -10571,7 +10571,7 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECT* sop, void SpawnGrenadeSecondaryExp(DSWActor* actor, DAngle ang) { ASSERT(actor->hasU()); - auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeSmallExp, actor->sector(), actor->spr.pos, actor->spr.angle, 64); + auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeSmallExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 64); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10644,7 +10644,7 @@ void SpawnGrenadeExp(DSWActor* actor) pos.Z = ActorZOfMiddle(actor) + (RandomRange(1000)-RandomRange(1000)) * zmaptoworld; } - auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(), pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_GrenadeExp, actor->sector(), pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness @@ -10735,7 +10735,7 @@ void SpawnMineExp(DSWActor* actor) PlaySound(DIGI_MINEBLOW, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, MINE_EXP, s_MineExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, MINE_EXP, s_MineExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(GetOwner(actor), expActor); @@ -10790,7 +10790,7 @@ DSWActor* SpawnSectorExp(DSWActor* actor) PlaySound(DIGI_30MMEXPLODE, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.shade = -40; @@ -10811,7 +10811,7 @@ DSWActor* SpawnLargeExp(DSWActor* actor) { PlaySound(DIGI_30MMEXPLODE, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, GRENADE_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.shade = -40; @@ -10846,12 +10846,12 @@ void SpawnMeteorExp(DSWActor* actor) if (actor->user.spal == 25) // Serp ball { - expActor = SpawnActor(STAT_MISSILE, METEOR_EXP, s_TeleportEffect2, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + expActor = SpawnActor(STAT_MISSILE, METEOR_EXP, s_TeleportEffect2, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); } else { PlaySound(DIGI_MEDIUMEXP, actor, v3df_none); - expActor = SpawnActor(STAT_MISSILE, METEOR_EXP, s_MeteorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + expActor = SpawnActor(STAT_MISSILE, METEOR_EXP, s_MeteorExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); } expActor->spr.hitag = LUMINOUS; //Always full brightness @@ -10883,7 +10883,7 @@ void SpawnLittleExp(DSWActor* actor) short explosion; PlaySound(DIGI_HEADSHOTHIT, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, BOLT_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, BOLT_EXP, s_SectorExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.shade = -127; @@ -11133,7 +11133,7 @@ int DoNapalm(DSWActor* actor) { PlaySound(DIGI_NAPPUFF, actor, v3df_none); - auto expActor = SpawnActor(STAT_MISSILE, NAP_EXP, s_NapExp, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, NAP_EXP, s_NapExp, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness SetOwner(actor, expActor); @@ -11184,7 +11184,7 @@ int DoBloodWorm(DSWActor* actor) { actor->user.change.XY() = -actor->user.change.XY(); actor->user.coll.setNone(); - actor->spr.angle += DAngle180; + actor->spr.Angles.Yaw += DAngle180; return true; } @@ -11220,7 +11220,7 @@ int DoBloodWorm(DSWActor* actor) } } - DAngle ang = actor->spr.angle + DAngle90; + DAngle ang = actor->spr.Angles.Yaw + DAngle90; double amt = (RandomRangeF(128) - 64) * 0.5; auto bpos = actor->spr.pos.XY(); @@ -11354,7 +11354,7 @@ int DoMirv(DSWActor* actor) for (i = 0; i < 2; i++) { auto actorNew = SpawnActor(STAT_MISSILE, MIRV_METEOR, &sg_MirvMeteor[0][0], actor->sector(), - actor->spr.pos, actor->spr.angle + angs[i], 50); + actor->spr.pos, actor->spr.Angles.Yaw + angs[i], 50); actorNew->user.RotNum = 5; NewStateGroup(actorNew, &sg_MirvMeteor[0]); @@ -11530,10 +11530,10 @@ int DoRing(DSWActor* actor) } // rotate the ring - actor->spr.angle += mapangle(5 * RINGMOVETICS); + actor->spr.Angles.Yaw += mapangle(5 * RINGMOVETICS); // put it out there - actor->spr.pos += actor->spr.angle.ToVector() * actor->user.Dist; + actor->spr.pos += actor->spr.Angles.Yaw.ToVector() * actor->user.Dist; if (pp) actor->spr.pos.Z -= actor->user.Dist * pp->horizon.horiz.Tan() * 2.; // horizon math sucks... SetActor(actor, actor->spr.pos); @@ -11611,10 +11611,10 @@ void InitSpellRing(PLAYER* pp) actorNew->user.floor_dist = 10; // put it out there - actorNew->spr.pos += actorNew->spr.angle.ToVector() * actorNew->user.Dist; + actorNew->spr.pos += actorNew->spr.Angles.Yaw.ToVector() * actorNew->user.Dist; actorNew->spr.pos.Z += pp->actor->getOffsetZ() + 20 - (actorNew->user.Dist * pp->horizon.horiz.Tan() * 2.); // horizon math sucks... - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; actorNew->backuppos(); @@ -11667,9 +11667,9 @@ int DoSerpRing(DSWActor* actor) // rotate the heads if (actor->user.Flags & (SPR_BOUNCE)) - actor->spr.angle += mapangle(28 * RINGMOVETICS); + actor->spr.Angles.Yaw += mapangle(28 * RINGMOVETICS); else - actor->spr.angle -= mapangle(28 * RINGMOVETICS); + actor->spr.Angles.Yaw -= mapangle(28 * RINGMOVETICS); // put it out there actor->spr.pos += actor->user.slide_ang.ToVector() * actor->user.Dist; @@ -11712,7 +11712,7 @@ int DoSerpRing(DSWActor* actor) { extern STATE* sg_SkullJump[]; actor->user.ID = SKULL_R0; - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); actor->vel.X = dist * (3. / 64) + RandomRangeF(16); actor->user.jump_speed = -800; change_actor_stat(actor, STAT_ENEMY); @@ -11763,20 +11763,20 @@ int InitLavaThrow(DSWActor* actor) short w; // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); double nz = ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25); // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, LAVA_BOULDER, s_LavaBoulder, actor->sector(), - DVector3(actor->spr.pos.XY(), nz), actor->spr.angle, NINJA_BOLT_VELOCITY); + DVector3(actor->spr.pos.XY(), nz), actor->spr.Angles.Yaw, NINJA_BOLT_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.scale = DVector2(1.125, 1.125); actorNew->spr.shade = -15; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; if (RANDOM_P2(1024) > 512) actorNew->spr.cstat |= (CSTAT_SPRITE_XFLIP); @@ -11815,7 +11815,7 @@ void InitVulcanBoulder(DSWActor* actor) if (SP_TAG7(actor)) { delta = SP_TAG5(actor); - nang = actor->spr.angle + mapangle((RandomRange(delta) - (delta >> 1))); + nang = actor->spr.Angles.Yaw + mapangle((RandomRange(delta) - (delta >> 1))); } else { @@ -11834,7 +11834,7 @@ void InitVulcanBoulder(DSWActor* actor) double scale = 0.125 + RandomRange(72) * REPEAT_SCALE; actorNew->spr.scale = DVector2(scale, scale); actorNew->spr.shade = -40; - actorNew->spr.angle = nang; + actorNew->spr.Angles.Yaw = nang; actorNew->user.Counter = 0; zsize = ActorSizeZ(actorNew); @@ -11888,7 +11888,7 @@ int InitSerpRing(DSWActor* actor) ang_diff = DAngle360 / max_missiles; - ang_start = actor->spr.angle - DAngle180; + ang_start = actor->spr.Angles.Yaw - DAngle180; PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none); @@ -11908,9 +11908,9 @@ int InitSerpRing(DSWActor* actor) actorNew->user.pos.Z = 50; // ang around the serp is now slide_ang - actorNew->user.slide_ang = actorNew->spr.angle; + actorNew->user.slide_ang = actorNew->spr.Angles.Yaw; // randomize the head turning angle - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); // control direction of spinning actor->user.Flags ^= SPR_BOUNCE; @@ -11998,9 +11998,9 @@ void InitSpellNapalm(PLAYER* pp) if (mp[i].dist_over != 0) { - actor->spr.angle += mp[i].ang; + actor->spr.Angles.Yaw += mp[i].ang; HelpMissileLateral(actor, mp[i].dist_over); - actor->spr.angle -= mp[i].ang; + actor->spr.Angles.Yaw -= mp[i].ang; } UpdateChange(actor); @@ -12044,7 +12044,7 @@ int InitEnemyNapalm(DSWActor* actor) for (i = 0; i < SIZ(mp); i++) { auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL1, s_Napalm, actor->sector(), - DVector3(actor->spr.pos, ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25)), actor->spr.angle, NAPALM_VELOCITY); + DVector3(actor->spr.pos, ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25)), actor->spr.Angles.Yaw, NAPALM_VELOCITY); actorNew->spr.hitag = LUMINOUS; //Always full brightness if (i==0) // Only attach sound to first projectile @@ -12073,9 +12073,9 @@ int InitEnemyNapalm(DSWActor* actor) if (mp[i].dist_over != 0) { - actorNew->spr.angle += mp[i].ang; + actorNew->spr.Angles.Yaw += mp[i].ang; HelpMissileLateral(actorNew, mp[i].dist_over); - actorNew->spr.angle -= mp[i].ang; + actorNew->spr.Angles.Yaw -= mp[i].ang; } // find the distance to the target (player) @@ -12146,7 +12146,7 @@ int InitEnemyMirv(DSWActor* actor) PlaySound(DIGI_MIRVFIRE, actor, v3df_none); auto actorNew = SpawnActor(STAT_MISSILE, MIRV_METEOR, s_Mirv, actor->sector(), - DVector3(actor->spr.pos, ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25)), actor->spr.angle, MIRV_VELOCITY); + DVector3(actor->spr.pos, ActorZOfTop(actor) + (ActorSizeZ(actor) * 0.25)), actor->spr.Angles.Yaw, MIRV_VELOCITY); PlaySound(DIGI_MIRVWIZ, actorNew, v3df_follow); @@ -12201,12 +12201,12 @@ int InitSwordAttack(PLAYER* pp) bubble = SpawnBubble(pp->actor); if (bubble != nullptr) { - bubble->spr.angle = pp->angle.ang; + bubble->spr.Angles.Yaw = pp->angle.ang; auto random_amt = RandomAngle(DAngle22_5 / 4) - DAngle22_5 / 8; // back it up a bit to get it out of your face - auto ang = bubble->spr.angle + dangs[i] + random_amt; + auto ang = bubble->spr.Angles.Yaw + dangs[i] + random_amt; auto vec = ang.ToVector() * 240; move_missile(bubble, DVector3(vec, 0), plActor->user.ceiling_dist, plActor->user.floor_dist, CLIPMASK_PLAYER, 1); @@ -12369,12 +12369,12 @@ int InitFistAttack(PLAYER* pp) bubble = SpawnBubble(pp->actor); if (bubble != nullptr) { - bubble->spr.angle = pp->angle.ang; + bubble->spr.Angles.Yaw = pp->angle.ang; auto random_amt = RandomAngle(DAngle22_5 / 4) - DAngle22_5 / 8; // back it up a bit to get it out of your face - auto angle = bubble->spr.angle + dangs[i] + random_amt; + auto angle = bubble->spr.Angles.Yaw + dangs[i] + random_amt; auto vec = angle.ToVector() * 240; move_missile(bubble, DVector3(vec, 0), plActor->user.ceiling_dist, plActor->user.floor_dist, CLIPMASK_PLAYER, 1); @@ -12555,7 +12555,7 @@ int InitSumoNapalm(DSWActor* actor) PlaySound(DIGI_NAPFIRE, actor, v3df_none); - DAngle angle = actor->spr.angle; + DAngle angle = actor->spr.Angles.Yaw; for (int j = 0; j < 4; j++) { for (size_t i = 0; i < countof(mp); i++) @@ -12622,7 +12622,7 @@ int InitSumoSkull(DSWActor* actor) PlaySound(DIGI_SERPSUMMONHEADS, actor, v3df_none); - auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_ENEMY, SKULL_R0, &s_SkullWait[0][0], actor->sector(), ActorVectOfMiddle(actor), actor->spr.Angles.Yaw, 0); actorNew->vel.X = 31.25; SetOwner(actor, actorNew); @@ -12631,7 +12631,7 @@ int InitSumoSkull(DSWActor* actor) actorNew->spr.pal = 0; // randomize the head turning angle - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); // control direction of spinning actor->user.Flags ^= SPR_BOUNCE; @@ -12757,7 +12757,7 @@ int WeaponAutoAim(DSWActor* actor, DSWActor* mislActor, DAngle ang, bool test) hitActor->user.Flags |= (SPR_ATTACKED); auto delta = hitActor->spr.pos.XY() - mislActor->spr.pos.XY(); - mislActor->spr.angle = delta.Angle(); + mislActor->spr.Angles.Yaw = delta.Angle(); double dist = delta.Length(); if (dist != 0) @@ -12808,7 +12808,7 @@ int WeaponAutoAimZvel(DSWActor* actor, DSWActor* missileActor, double *zvel, DAn hitActor->user.Flags |= (SPR_TARGETED); hitActor->user.Flags |= (SPR_ATTACKED); - missileActor->spr.angle = (hitActor->spr.pos.XY() - missileActor->spr.pos.XY()).Angle(); + missileActor->spr.Angles.Yaw = (hitActor->spr.pos.XY() - missileActor->spr.pos.XY()).Angle(); double dist = (missileActor->spr.pos.XY() - hitActor->spr.pos.XY()).Length(); if (dist != 0) @@ -13023,7 +13023,7 @@ int InitStar(PLAYER* pp) for (size_t i = 0; i < countof(dang); i++) { - auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector,pos, actorNew->spr.angle + dang[i], actorNew->vel.X); + auto actorNew2 = SpawnActor(STAT_MISSILE, STAR1, s_Star, pp->cursector,pos, actorNew->spr.Angles.Yaw + dang[i], actorNew->vel.X); SetOwner(GetOwner(actorNew), actorNew2); actorNew2->spr.scale = DVector2(STAR_REPEAT, STAR_REPEAT); @@ -13406,9 +13406,9 @@ int InitLaser(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 900); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13444,7 +13444,7 @@ int InitLaser(PLAYER* pp) if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(5); + actorNew->spr.Angles.Yaw -= mapangle(5); } UpdateChange(actorNew); @@ -13505,9 +13505,9 @@ int InitRail(PLAYER* pp) actor->clipdist = 0; actorNew->clipdist = 2; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 700); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13524,7 +13524,7 @@ int InitRail(PLAYER* pp) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(4); + actorNew->spr.Angles.Yaw -= mapangle(4); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -13555,7 +13555,7 @@ int InitZillaRail(DSWActor* actor) // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], actor->sector(), pos, actor->spr.angle, 75); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], actor->sector(), pos, actor->spr.Angles.Yaw, 75); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.8125, 0.8125); @@ -13578,9 +13578,9 @@ int InitZillaRail(DSWActor* actor) actor->clipdist = 0; actorNew->clipdist = 2; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 700); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13597,7 +13597,7 @@ int InitZillaRail(DSWActor* actor) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(4); + actorNew->spr.Angles.Yaw -= mapangle(4); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -13684,9 +13684,9 @@ int InitRocket(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 900); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13707,7 +13707,7 @@ int InitRocket(PLAYER* pp) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(5); + actorNew->spr.Angles.Yaw -= mapangle(5); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -13788,9 +13788,9 @@ int InitBunnyRocket(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 900); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13811,7 +13811,7 @@ int InitBunnyRocket(PLAYER* pp) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(5); + actorNew->spr.Angles.Yaw -= mapangle(5); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -13881,9 +13881,9 @@ int InitNuke(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 900); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13904,7 +13904,7 @@ int InitNuke(PLAYER* pp) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(5); + actorNew->spr.Angles.Yaw -= mapangle(5); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -13933,7 +13933,7 @@ int InitEnemyNuke(DSWActor* actor) auto npos = actor->spr.pos.plusZ(40); // Spawn a shot - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), npos, actor->spr.angle, 700/16.); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), npos, actor->spr.Angles.Yaw, 700/16.); if (actor->user.ID == ZOMBIE_RUN_R0) SetOwner(GetOwner(actor), actorNew); @@ -13958,9 +13958,9 @@ int InitEnemyNuke(DSWActor* actor) actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 500); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -13979,7 +13979,7 @@ int InitEnemyNuke(DSWActor* actor) actorNew->vel.Z = zvel * 0.5; if (WeaponAutoAim(actor, actorNew, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(5); + actorNew->spr.Angles.Yaw -= mapangle(5); } else zvel = actorNew->vel.Z; // Let autoaiming set zvel now @@ -14068,10 +14068,10 @@ int InitMicro(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; const int MICRO_LATERAL = 5000; HelpMissileLateral(actorNew, 1000 + (RandomRange(MICRO_LATERAL) - (MICRO_LATERAL / 2))); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -14106,7 +14106,7 @@ int InitMicro(PLAYER* pp) } else { - actorNew->spr.angle += mapangle((RandomRange(MICRO_ANG) - (MICRO_ANG / 2)) - 16); + actorNew->spr.Angles.Yaw += mapangle((RandomRange(MICRO_ANG) - (MICRO_ANG / 2)) - 16); } UpdateChange(actorNew); @@ -14450,9 +14450,9 @@ int InitSerpSpell(DSWActor* actor) for (i = 0; i < 2; i++) { - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], actor->sector(), actor->spr.pos, actor->spr.angle, 93.75); + auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 93.75); actorNew->spr.pos.Z = ActorZOfTop(actor); @@ -14476,14 +14476,14 @@ int InitSerpSpell(DSWActor* actor) auto oclipdist = actor->clipdist; actor->clipdist = 0.25; - actorNew->spr.angle += lat_ang[i]; + actorNew->spr.Angles.Yaw += lat_ang[i]; HelpMissileLateral(actorNew, 4200); - actorNew->spr.angle -= lat_ang[i]; + actorNew->spr.Angles.Yaw -= lat_ang[i]; // find the distance to the target (player) SetZVelFromTarget(actorNew, actor); - actorNew->spr.angle += delta_ang[i]; + actorNew->spr.Angles.Yaw += delta_ang[i]; UpdateChange(actorNew); @@ -14508,7 +14508,7 @@ int SpawnDemonFist(DSWActor* actor) if (actor->user.Flags & (SPR_SUICIDE)) return -1; - auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 0); + auto expActor = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), ActorVectOfMiddle(actor), actor->spr.Angles.Yaw, 0); expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.shade = -40; @@ -14552,9 +14552,9 @@ int InitSerpMonstSpell(DSWActor* actor) for (i = 0; i < 1; i++) { - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); - auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], actor->sector(), actor->spr.pos, actor->spr.angle, 31.25); + auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 31.25); actorNew->user.spal = actorNew->spr.pal = 25; // Bright Red actorNew->spr.pos.Z = ActorZOfTop(actor); @@ -14578,14 +14578,14 @@ int InitSerpMonstSpell(DSWActor* actor) auto oclipdist = actor->clipdist; actor->clipdist = 0.25; - actorNew->spr.angle += lat_ang[i]; + actorNew->spr.Angles.Yaw += lat_ang[i]; HelpMissileLateral(actorNew, 4200); - actorNew->spr.angle -= lat_ang[i]; + actorNew->spr.Angles.Yaw -= lat_ang[i]; // find the distance to the target (player) SetZVelFromTarget(actorNew, actor); - actorNew->spr.angle += delta_ang[i]; + actorNew->spr.Angles.Yaw += delta_ang[i]; UpdateChange(actorNew); @@ -14627,12 +14627,12 @@ int InitEnemyRocket(DSWActor* actor) PlaySound(DIGI_NINJARIOTATTACK, actor, v3df_none); // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R2, &s_Rocket[0][0], actor->sector(), - actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5)-16), actor->user.targetActor->spr.angle, NINJA_BOLT_VELOCITY); + actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5)-16), actor->user.targetActor->spr.Angles.Yaw, NINJA_BOLT_VELOCITY); // Set default palette actorNew->spr.pal = actorNew->user.spal = 17; // White @@ -14645,7 +14645,7 @@ int InitEnemyRocket(DSWActor* actor) actorNew->spr.scale = DVector2(0.4375, 0.4375); actorNew->spr.shade = -15; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 4; actorNew->user.RotNum = 5; @@ -14699,17 +14699,17 @@ int InitEnemyRail(DSWActor* actor) PlaySound(DIGI_RAILFIRE, actor, v3df_dontpan|v3df_doppler); // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // add a bit of randomness if (RANDOM_P2(1024) < 512) - actor->spr.angle += mapangle(RANDOM_P2(128) - 64); + actor->spr.Angles.Yaw += mapangle(RANDOM_P2(128) - 64); // Spawn a shot // Inserting and setting up variables auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], actor->sector(), - actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5) - 8), actor->spr.angle, 75); + actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5) - 8), actor->spr.Angles.Yaw, 75); if (actor->user.ID == ZOMBIE_RUN_R0) SetOwner(GetOwner(actor), actorNew); @@ -14771,19 +14771,19 @@ int InitZillaRocket(DSWActor* actor) PlaySound(DIGI_NINJARIOTATTACK, actor, v3df_none); // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); for (int i = 0; i < (int)SIZ(mp); i++) { // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R2, &s_Rocket[0][0], actor->sector(), - actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5) - 16), actor->user.targetActor->spr.angle, NINJA_BOLT_VELOCITY); + actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5) - 16), actor->user.targetActor->spr.Angles.Yaw, NINJA_BOLT_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.4375, 0.4375); actorNew->spr.shade = -15; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 4; actorNew->user.RotNum = 5; @@ -14804,9 +14804,9 @@ int InitZillaRocket(DSWActor* actor) if (mp[i].dist_over != 0) { - actorNew->spr.angle += mp[i].ang; + actorNew->spr.Angles.Yaw += mp[i].ang; HelpMissileLateral(actorNew, mp[i].dist_over); - actorNew->spr.angle -= mp[i].ang; + actorNew->spr.Angles.Yaw -= mp[i].ang; } MissileSetPos(actorNew, DoBoltThinMan, mp[i].dist_out); @@ -14829,17 +14829,17 @@ int InitEnemyStar(DSWActor* actor) int dist; // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, actor->sector(), - ActorVectOfMiddle(actor), actor->user.targetActor->spr.angle, NINJA_STAR_VELOCITY); + ActorVectOfMiddle(actor), actor->user.targetActor->spr.Angles.Yaw, NINJA_STAR_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.25, 0.25); actorNew->spr.shade = -25; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 4; UpdateChange(actorNew); @@ -14864,17 +14864,17 @@ int InitEnemyCrossbow(DSWActor* actor) int dist; // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), - ActorVectOfMiddle(actor).plusZ(-14), actor->user.targetActor->spr.angle, 50); + ActorVectOfMiddle(actor).plusZ(-14), actor->user.targetActor->spr.Angles.Yaw, 50); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.25, 0.40625); actorNew->spr.shade = -25; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 4; actorNew->user.RotNum = 5; @@ -14906,18 +14906,18 @@ int InitSkelSpell(DSWActor* actor) PlaySound(DIGI_SPELEC, actor, v3df_none); // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, ELECTRO_ENEMY, s_Electro, actor->sector(), - actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5)), actor->user.targetActor->spr.angle, SKEL_ELECTRO_VELOCITY); + actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5)), actor->user.targetActor->spr.Angles.Yaw, SKEL_ELECTRO_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.scale.X += (-0.3125); actorNew->spr.scale.Y += (-0.3125); actorNew->spr.shade = -40; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 4; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); @@ -14939,7 +14939,7 @@ int InitSkelSpell(DSWActor* actor) int InitCoolgFire(DSWActor* actor) { // get angle to player and also face player when attacking - actor->spr.angle = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); // Spawn a shot // Inserting and setting up variables @@ -14947,14 +14947,14 @@ int InitCoolgFire(DSWActor* actor) PlaySound(DIGI_CGMAGIC, actor, v3df_follow); auto actorNew = SpawnActor(STAT_MISSILE, COOLG_FIRE, s_CoolgFire, actor->sector(), - actor->spr.pos.plusZ(-16), actor->user.targetActor->spr.angle, COOLG_FIRE_VELOCITY); + actor->spr.pos.plusZ(-16), actor->user.targetActor->spr.Angles.Yaw, COOLG_FIRE_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.hitag = LUMINOUS; actorNew->spr.scale = DVector2(0.28125, 0.28125); actorNew->spr.shade = -40; actorNew->vel.Z = 0; - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; actorNew->clipdist = 2; actorNew->user.ceiling_dist = (4); actorNew->user.floor_dist = (4); @@ -14969,7 +14969,7 @@ int InitCoolgFire(DSWActor* actor) SetZVelFromTarget(actorNew, actor, false, -16); UpdateChange(actorNew); - auto vec = actor->spr.angle.ToVector() * 45.5; + auto vec = actor->spr.Angles.Yaw.ToVector() * 45.5; move_missile(actorNew, DVector3(vec, 0), actorNew->user.ceiling_dist, actorNew->user.floor_dist, 0, 3); @@ -15008,7 +15008,7 @@ int InitCoolgDrip(DSWActor* actor) { short w; - auto actorNew = SpawnActor(STAT_MISSILE, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.3125, 0.3125); @@ -15047,7 +15047,7 @@ int GenerateDrips(DSWActor* actor) return 1; } - auto actorNew = SpawnActor(STAT_SHRAP, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_SHRAP, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.3125, 0.3125); @@ -15117,7 +15117,7 @@ void InitFireballTrap(DSWActor* actor) PlaySound(DIGI_FIREBALL1, actor, v3df_none); // Spawn a shot - auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->sector(), actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->spr.angle, FIREBALL_TRAP_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->sector(), actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->spr.Angles.Yaw, FIREBALL_TRAP_VELOCITY); actorNew->spr.hitag = LUMINOUS; //Always full brightness SetOwner(actor, actorNew); @@ -15145,7 +15145,7 @@ void InitBoltTrap(DSWActor* actor) PlaySound(DIGI_RIOTFIRE, actor, v3df_none); // Spawn a shot - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->spr.angle, BOLT_TRAP_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), actor->spr.pos.plusZ(-ActorSizeZ(actor)), actor->spr.Angles.Yaw, BOLT_TRAP_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.5, 0.5); @@ -15170,7 +15170,7 @@ void InitBoltTrap(DSWActor* actor) void InitSpearTrap(DSWActor* actor) { // Spawn a shot - auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), ActorVectOfMiddle(actor), actor->spr.angle, 750/16.); + auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], actor->sector(), ActorVectOfMiddle(actor), actor->spr.Angles.Yaw, 750/16.); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.25, 0.40625); @@ -15246,12 +15246,12 @@ int InitTracerUzi(PLAYER* pp) auto oclipdist = plActor->clipdist; plActor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; if (pp->Flags & (PF_TWO_UZI) && pp->WpnUziType == 0) HelpMissileLateral(actorNew, lat_dist[RANDOM_P2(2<<8)>>8]); else HelpMissileLateral(actorNew, lat_dist[0]); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (MissileSetPos(actorNew, DoTracerStart, 800)) { @@ -15267,7 +15267,7 @@ int InitTracerUzi(PLAYER* pp) WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false); // a bit of randomness - actorNew->spr.angle += mapangle(RandomRange(30) - 15); + actorNew->spr.Angles.Yaw += mapangle(RandomRange(30) - 15); UpdateChange(actorNew); @@ -15289,7 +15289,7 @@ int InitTracerTurret(DSWActor* actor, DSWActor* Operator, DAngle horiz) // Inserting and setting up variables auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, actor->sector(), - actor->spr.pos.plusZ(horiz.Tan() * 36.), actor->spr.angle, TRACER_VELOCITY); + actor->spr.pos.plusZ(horiz.Tan() * 36.), actor->spr.Angles.Yaw, TRACER_VELOCITY); actorNew->spr.hitag = LUMINOUS; //Always full brightness if (Operator!= nullptr) @@ -15311,7 +15311,7 @@ int InitTracerTurret(DSWActor* actor, DSWActor* Operator, DAngle horiz) WeaponAutoAim(actor, actorNew, DAngle22_5 / 4, false); // a bit of randomness - actorNew->spr.angle += mapangle(RandomRange(30) - 15); + actorNew->spr.Angles.Yaw += mapangle(RandomRange(30) - 15); UpdateChange(actorNew); @@ -15332,7 +15332,7 @@ int InitTracerAutoTurret(DSWActor* actor, const DVector3& change) // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, actor->sector(), actor->spr.pos, actor->spr.angle, TRACER_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, 0, s_Tracer, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, TRACER_VELOCITY); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.scale = DVector2(0.15625, 0.15625); @@ -15380,7 +15380,7 @@ int BulletHitSprite(DSWActor* actor, DSWActor* hitActor, const DVector3& hit_pos if (ID>0) id = ID; - auto actorNew = SpawnActor(STAT_MISSILE, id, s_UziSmoke, §or[0], hit_pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, id, s_UziSmoke, §or[0], hit_pos, actor->spr.Angles.Yaw, 0); actorNew->spr.shade = -40; if (hitActor->user.PlayerP) @@ -15407,7 +15407,7 @@ int BulletHitSprite(DSWActor* actor, DSWActor* hitActor, const DVector3& hit_pos } SetOwner(actor, actorNew); - actorNew->spr.angle = actor->spr.angle; + actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw; SetActorZ(actorNew, hit_pos); actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); @@ -15416,20 +15416,20 @@ int BulletHitSprite(DSWActor* actor, DSWActor* hitActor, const DVector3& hit_pos if ((RANDOM_P2(1024<<5)>>5) < 512+128) { if (!hitActor->user.PlayerP) - SpawnBlood(hitActor, nullptr, actor->spr.angle, &hit_pos); + SpawnBlood(hitActor, nullptr, actor->spr.Angles.Yaw, &hit_pos); else { auto hpp = hit_pos.plusZ(20); - SpawnBlood(hitActor, nullptr, actor->spr.angle, &hpp); + SpawnBlood(hitActor, nullptr, actor->spr.Angles.Yaw, &hpp); } // blood comes out the other side? if ((RANDOM_P2(1024<<5)>>5) < 256) { if (!hitActor->user.PlayerP) - SpawnBlood(hitActor, nullptr, actor->spr.angle + DAngle180, &hit_pos); + SpawnBlood(hitActor, nullptr, actor->spr.Angles.Yaw + DAngle180, &hit_pos); if (hitActor->user.ID != TRASHCAN && hitActor->user.ID != ZILLA_RUN_R0) - QueueWallBlood(hitActor, actor->spr.angle); //QueueWallBlood needs bullet angle. + QueueWallBlood(hitActor, actor->spr.Angles.Yaw); //QueueWallBlood needs bullet angle. } } @@ -15451,9 +15451,9 @@ bool HitscanSpriteAdjust(DSWActor* actor, walltype* hit_wall) { if (hit_wall) { - actor->spr.angle = hit_wall->normalAngle(); + actor->spr.Angles.Yaw = hit_wall->normalAngle(); } - DAngle ang = actor->spr.angle; + DAngle ang = actor->spr.Angles.Yaw; auto vect = ang.ToVector(); @@ -15681,7 +15681,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp) if (!SW_SHAREWARE) PlaySound(DIGI_CANNON, pp, v3df_dontpan|v3df_doppler); - auto actorNew = SpawnActor(STAT_MISSILE, 0, s_TankShell, actor->sector(), actor->spr.pos, actor->spr.angle, TANK_SHELL_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, 0, s_TankShell, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, TANK_SHELL_VELOCITY); SetOwner(pp->actor, actorNew); actorNew->spr.scale = DVector2(0.125, 0.125); @@ -15701,7 +15701,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp) WeaponAutoAim(actor, actorNew, DAngle22_5 / 2, false); // a bit of randomness - actorNew->spr.angle += mapangle(RandomRange(30) - 15); + actorNew->spr.Angles.Yaw += mapangle(RandomRange(30) - 15); actorNew->norm_ang(); UpdateChange(actorNew); @@ -15751,7 +15751,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp) else { picked = nullptr; - angle = actor->spr.angle; + angle = actor->spr.Angles.Yaw; } npos.Z = actor->spr.pos.Z + (RandomRangeF(20) - 10); @@ -15799,7 +15799,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp) } else { - actorNew->spr.angle += mapangle((RandomRange(MICRO_ANG) - (MICRO_ANG / 2)) - 16); + actorNew->spr.Angles.Yaw += mapangle((RandomRange(MICRO_ANG) - (MICRO_ANG / 2)) - 16); } UpdateChange(actorNew); @@ -15819,7 +15819,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp) { if (SW_SHAREWARE) return false; // JBF: verify - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), actor->spr.pos, actor->spr.angle, ROCKET_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, &s_Rocket[0][0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, ROCKET_VELOCITY); SetOwner(pp->actor, actorNew); actorNew->spr.scale = DVector2(0.625, 0.625); @@ -15858,7 +15858,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp) { if (SW_SHAREWARE) return false; // JBF: verify - auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->sector(), actor->spr.pos, actor->spr.angle, FIREBALL_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL, s_Fireball, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, FIREBALL_VELOCITY); SetOwner(pp->actor, actorNew); actorNew->spr.scale = DVector2(0.625, 0.625); @@ -15877,7 +15877,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp) WeaponAutoAim(actor, actorNew, DAngle22_5 / 2, false); // a bit of randomness - actorNew->spr.angle += mapangle(RandomRange(30) - 15); + actorNew->spr.Angles.Yaw += mapangle(RandomRange(30) - 15); actorNew->norm_ang(); UpdateChange(actorNew); @@ -15905,7 +15905,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp) // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector, actor->spr.pos, actor->spr.angle, 75); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R1, &s_Rail[0][0], pp->cursector, actor->spr.pos, actor->spr.Angles.Yaw, 75); SetOwner(pp->actor, actorNew); actorNew->spr.scale = DVector2(0.8125, 0.8125); @@ -15950,7 +15950,7 @@ int InitTurretLaser(DSWActor* actor, PLAYER* pp) // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector, actor->spr.pos, actor->spr.angle, 18.75); + auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R0, s_Laser, pp->cursector, actor->spr.pos, actor->spr.Angles.Yaw, 18.75); SetOwner(pp->actor, actorNew); actorNew->spr.scale = DVector2(0.8125, 0.8125); @@ -16006,7 +16006,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp) else { setFreeAimVelocity(dax, daz, DAngle::fromDeg(min(pp->horizon.horiz.Degrees(), 11.0515)), 1000 - RandomRangeF(80) + 40); - daang = actor->spr.angle; + daang = actor->spr.Angles.Yaw; } FAFhitscan(npos, actor->sector(), DVector3(daang.ToVector() * dax, daz), hit, CLIPMASK_MISSILE); @@ -16368,7 +16368,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop) hit.hitActor = hitt; if (hitt != nullptr) { - DAngle delta = absangle(actor->spr.angle, daang); + DAngle delta = absangle(actor->spr.Angles.Yaw, daang); if (delta > DAngle22_5) { // don't shoot if greater than 128 @@ -16380,14 +16380,14 @@ int InitTurretMgun(SECTOR_OBJECT* sop) // and not close WeaponHitscanShootFeet(actor, hitt, &daz); - daang = actor->spr.angle + RandomAngle(22.5 / 4) - DAngle22_5 / 8; + daang = actor->spr.Angles.Yaw + RandomAngle(22.5 / 4) - DAngle22_5 / 8; } else { // randomize the z for shots daz += RandomRangeF(120) - 60; // never auto aim the angle - daang = actor->spr.angle + RandomAngle(22.5 / 2) - DAngle22_5 / 4; + daang = actor->spr.Angles.Yaw + RandomAngle(22.5 / 2) - DAngle22_5 / 4; } } } @@ -16523,7 +16523,7 @@ int InitEnemyUzi(DSWActor* actor) if (AimHitscanToTarget(actor, &daz, &daang, 200) != nullptr) { // set angle to player and also face player when attacking - actor->spr.angle = daang; + actor->spr.Angles.Yaw = daang; daang += mapangle(RandomRange(24) - 12); daz += RandomRange(40 * 256) / 256. - 20; } @@ -16536,7 +16536,7 @@ int InitEnemyUzi(DSWActor* actor) return 0; daz = 0; - daang = actor->spr.angle + RandomAngle(DAngle22_5) - DAngle22_5/2; + daang = actor->spr.Angles.Yaw + RandomAngle(DAngle22_5) - DAngle22_5/2; } // todo: confirm the ToVector factor. @@ -16700,9 +16700,9 @@ int InitGrenade(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 800); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; // don't do smoke for this movement actorNew->user.Flags |= (SPR_BOUNCE); @@ -16744,7 +16744,7 @@ int InitSpriteGrenade(DSWActor* actor) // Spawn a shot // Inserting and setting up variables auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], actor->sector(), - actor->spr.pos.plusZ(-40), actor->spr.angle, GRENADE_VELOCITY); + actor->spr.pos.plusZ(-40), actor->spr.Angles.Yaw, GRENADE_VELOCITY); actorNew->user.RotNum = 5; NewStateGroup(actorNew, &sg_Grenade[0]); @@ -16771,9 +16771,9 @@ int InitSpriteGrenade(DSWActor* actor) UpdateChange(actorNew); - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 800); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; // don't do smoke for this movement actorNew->user.Flags |= (SPR_BOUNCE); @@ -16853,7 +16853,7 @@ int InitEnemyMine(DSWActor* actor) // Spawn a shot // Inserting and setting up variables - auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, actor->sector(), actor->spr.pos.plusZ(-40), actor->spr.angle, MINE_VELOCITY); + auto actorNew = SpawnActor(STAT_MISSILE, MINE, s_Mine, actor->sector(), actor->spr.pos.plusZ(-40), actor->spr.Angles.Yaw, MINE_VELOCITY); SetOwner(actor, actorNew); actorNew->spr.scale = DVector2(0.5, 0.5); @@ -16874,9 +16874,9 @@ int InitEnemyMine(DSWActor* actor) actorNew->user.Flags |= (SPR_UNDERWATER); MissileSetPos(actorNew, DoMine, 300); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; MissileSetPos(actorNew, DoMine, 300); - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; actorNew->user.change. Z = -5000 / 256.; UpdateChangeXY(actorNew); @@ -16897,7 +16897,7 @@ int HelpMissileLateral(DSWActor* actor, int dist) actor->vel.X = dist * maptoworld; // not worth changing 28 call locations... - auto vec = actor->spr.angle.ToVector() * actor->vel.X; + auto vec = actor->spr.Angles.Yaw.ToVector() * actor->vel.X; actor->clipdist = 2; @@ -16953,9 +16953,9 @@ int InitFireball(PLAYER* pp) auto oclipdist = actor->clipdist; actor->clipdist = 0; - actorNew->spr.angle += DAngle90; + actorNew->spr.Angles.Yaw += DAngle90; HelpMissileLateral(actorNew, 2100); - actorNew->spr.angle -= DAngle90; + actorNew->spr.Angles.Yaw -= DAngle90; if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew)) actorNew->user.Flags |= (SPR_UNDERWATER); @@ -16972,7 +16972,7 @@ int InitFireball(PLAYER* pp) actorNew->vel.Z = 0.5; if (WeaponAutoAimZvel(pp->actor, actorNew, &zvel, DAngle22_5 / 4, false) == -1) { - actorNew->spr.angle -= mapangle(9); + actorNew->spr.Angles.Yaw -= mapangle(9); } UpdateChangeXY(actorNew); @@ -17000,18 +17000,18 @@ int InitEnemyFireball(DSWActor* actor) PlaySound(DIGI_FIREBALL1, actor, v3df_none); // get angle to player and also face player when attacking - actor->spr.angle = (targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); + actor->spr.Angles.Yaw = (targetActor->spr.pos.XY() - actor->spr.pos.XY()).Angle(); double size_z = ActorSizeZ(actor) * 0.625; double nz = actor->spr.pos.Z - size_z + 4; - auto change = actor->spr.angle.ToVector() * GORO_FIREBALL_VELOCITY; + auto change = actor->spr.Angles.Yaw.ToVector() * GORO_FIREBALL_VELOCITY; double lastvel = 0; for (int i = 0; i < 2; i++) { auto actorNew = SpawnActor(STAT_MISSILE, GORO_FIREBALL, s_Fireball, actor->sector(), - DVector3(actor->spr.pos, nz), actor->spr.angle, GORO_FIREBALL_VELOCITY); + DVector3(actor->spr.pos, nz), actor->spr.Angles.Yaw, GORO_FIREBALL_VELOCITY); actorNew->spr.hitag = LUMINOUS; //Always full brightness actorNew->spr.scale = DVector2(0.34375, 0.3125); @@ -17021,9 +17021,9 @@ int InitEnemyFireball(DSWActor* actor) actorNew->vel.Z = 0; actorNew->clipdist = 1; - actorNew->spr.angle += lat_ang[i]; + actorNew->spr.Angles.Yaw += lat_ang[i]; HelpMissileLateral(actorNew, 500); - actorNew->spr.angle -= lat_ang[i]; + actorNew->spr.Angles.Yaw -= lat_ang[i]; actorNew->user.change.XY() = change; @@ -17373,7 +17373,7 @@ int SpawnSplash(DSWActor* actor) DoActorZrange(actor); MissileWaterAdjust(actor); - auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), DVector3(actor->spr.pos.XY(), actor->user.loz), actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, SPLASH, s_Splash, actor->sector(), DVector3(actor->spr.pos.XY(), actor->user.loz), actor->spr.Angles.Yaw, 0); if (sectu && (sectp->extra & SECTFX_LIQUID_MASK) == SECTFX_LIQUID_LAVA) actorNew->user.spal = actorNew->spr.pal = PALETTE_RED_LIGHTING; @@ -17481,7 +17481,7 @@ DSWActor* SpawnBubble(DSWActor* actor) if (Prediction) return nullptr; - auto actorNew = SpawnActor(STAT_MISSILE, BUBBLE, s_Bubble, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, BUBBLE, s_Bubble, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); double scale = (8 + (RANDOM_P2(8 << 8) >> 8)) * REPEAT_SCALE; actorNew->spr.scale = DVector2(scale, scale); @@ -17530,7 +17530,7 @@ int SpawnVehicleSmoke(DSWActor* actor) if (MoveSkip2 != 0) return false; - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_VehicleSmoke, actor->sector(), actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_VehicleSmoke, actor->sector(), actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.Angles.Yaw, 0); actorNew->user.WaitTics = 1*120; actorNew->spr.shade = -40; @@ -17543,7 +17543,7 @@ int SpawnVehicleSmoke(DSWActor* actor) if (RANDOM_P2(1024) < 512) actorNew->spr.cstat |= (CSTAT_SPRITE_YFLIP); - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->vel.X = RandomRangeF(2); UpdateChangeXY(actorNew); actorNew->vel.Z = 4 + RandomRangeF(4); @@ -17559,7 +17559,7 @@ int SpawnVehicleSmoke(DSWActor* actor) int SpawnSmokePuff(DSWActor* actor) { - auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_WaterSmoke, actor->sector(), actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_WaterSmoke, actor->sector(), actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.Angles.Yaw, 0); actorNew->user.WaitTics = 1*120; actorNew->spr.shade = -40; @@ -17572,7 +17572,7 @@ int SpawnSmokePuff(DSWActor* actor) if (RANDOM_P2(1024) < 512) actorNew->spr.cstat |= (CSTAT_SPRITE_YFLIP); - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); actorNew->vel.X = RandomRangeF(2); UpdateChangeXY(actorNew); actorNew->vel.Z = 4 + RandomRangeF(4); @@ -17840,10 +17840,10 @@ void QueueHole(sectortype* hit_sect, walltype* hit_wall, const DVector3& pos) spawnedActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); spawnedActor->spr.cstat2 |= CSTAT2_SPRITE_DECAL; - spawnedActor->spr.angle = hit_wall->normalAngle(); + spawnedActor->spr.Angles.Yaw = hit_wall->normalAngle(); // move it back some - auto vec = spawnedActor->spr.angle.ToVector(); + auto vec = spawnedActor->spr.Angles.Yaw.ToVector(); auto sect = spawnedActor->sector(); @@ -17900,7 +17900,7 @@ int QueueFloorBlood(DSWActor* actor) KillActor(FloorBloodQueue[FloorBloodQueueHead]); FloorBloodQueue[FloorBloodQueueHead] = spawnedActor = - SpawnActor(STAT_SKIP4, FLOORBLOOD1, s_FloorBlood1, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + SpawnActor(STAT_SKIP4, FLOORBLOOD1, s_FloorBlood1, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1); @@ -17918,7 +17918,7 @@ int QueueFloorBlood(DSWActor* actor) spawnedActor->clipdist = 0; spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0; spawnedActor->spr.pos = actor->spr.pos.plusZ(1); - spawnedActor->spr.angle = RandomAngle(); // Just make it any old angle + spawnedActor->spr.Angles.Yaw = RandomAngle(); // Just make it any old angle spawnedActor->spr.shade -= 5; // Brighten it up just a bit spawnedActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_FLOOR); @@ -18008,13 +18008,13 @@ int QueueFootPrint(DSWActor* actor) if (rnd_num > 683) FloorBloodQueue[FloorBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT1, s_FootPrint1, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT1, s_FootPrint1, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); else if (rnd_num > 342) FloorBloodQueue[FloorBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT2, s_FootPrint2, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT2, s_FootPrint2, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); else FloorBloodQueue[FloorBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT3, s_FootPrint3, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT3, s_FootPrint3, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1); @@ -18032,7 +18032,7 @@ int QueueFootPrint(DSWActor* actor) spawnedActor->clipdist = 0; spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0; spawnedActor->spr.pos = actor->spr.pos; - spawnedActor->spr.angle = actor->spr.angle; + spawnedActor->spr.Angles.Yaw = actor->spr.Angles.Yaw; spawnedActor->user.Flags &= ~(SPR_SHADOW); switch (FootMode) { @@ -18180,10 +18180,10 @@ DSWActor* QueueWallBlood(DSWActor* actor, DAngle bang) spawnedActor->spr.cstat |= (CSTAT_SPRITE_YCENTER); spawnedActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); - spawnedActor->spr.angle = hit.hitWall->delta().Angle() + DAngle90; + spawnedActor->spr.Angles.Yaw = hit.hitWall->delta().Angle() + DAngle90; // move it back some - auto vec = spawnedActor->spr.angle.ToVector(); + auto vec = spawnedActor->spr.Angles.Yaw.ToVector(); auto sect = spawnedActor->sector(); @@ -18387,7 +18387,7 @@ int DoShrapVelocity(DSWActor* actor) auto hit_sprite = actor->user.coll.actor(); - WallBounce(actor, hit_sprite->spr.angle); + WallBounce(actor, hit_sprite->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); break; @@ -18704,7 +18704,7 @@ int DoItemFly(DSWActor* actor) if ((hit_sprite->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { - WallBounce(actor, hit_sprite->spr.angle); + WallBounce(actor, hit_sprite->spr.Angles.Yaw); ScaleSpriteVector(actor, 32000); } else @@ -18775,7 +18775,7 @@ void QueueLoWangs(DSWActor* actor) if (LoWangsQueue[LoWangsQueueHead] == nullptr) { LoWangsQueue[LoWangsQueueHead] = spawnedActor = - SpawnActor(STAT_GENERIC_QUEUE, actor->spr.picnum, s_DeadLoWang, actor->sector(), actor->spr.pos, actor->spr.angle, 0); + SpawnActor(STAT_GENERIC_QUEUE, actor->spr.picnum, s_DeadLoWang, actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); } else { diff --git a/source/games/sw/src/zombie.cpp b/source/games/sw/src/zombie.cpp index 88d22f413..0ee282e71 100644 --- a/source/games/sw/src/zombie.cpp +++ b/source/games/sw/src/zombie.cpp @@ -790,7 +790,7 @@ void SpawnZombie(PLAYER* pp, DSWActor* weaponActor) auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector, pp->actor->getPosWithOffsetZ(), pp->angle.ang, 0); SetOwner(actorNew, ownerActor); actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal; - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); SetupZombie(actorNew); actorNew->spr.shade = -10; actorNew->user.Flags2 |= (SPR2_DONT_TARGET_OWNER); @@ -839,11 +839,11 @@ void SpawnZombie2(DSWActor* actor) } - auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->spr.pos, actor->spr.angle, 0); + auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 0); actorNew->user.Counter3 = 0; SetOwner(ownerActor, actorNew); actorNew->spr.pal = actorNew->user.spal = ownerActor->user.spal; - actorNew->spr.angle = RandomAngle(); + actorNew->spr.Angles.Yaw = RandomAngle(); SetupZombie(actorNew); actorNew->spr.shade = -10; actorNew->user.Flags2 |= (SPR2_DONT_TARGET_OWNER);