From 35d74c7f9f264664263425c0e10e7607d271c0c8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 31 Aug 2022 22:55:59 +0200 Subject: [PATCH] - some MOVExy replacements. --- source/games/sw/src/game.h | 1 - source/games/sw/src/jweapon.cpp | 3 +-- source/games/sw/src/sector.cpp | 3 +-- source/games/sw/src/swactor.h | 3 +-- source/games/sw/src/weapon.cpp | 6 ++---- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index d1cbf32a4..5035c6695 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -939,7 +939,6 @@ struct USER void set_int_change_z(int x) { change.Z = x * zinttoworld; } void add_int_change_x(int x) { change.X += x * inttoworld; } void add_int_change_y(int x) { change.Y += x * inttoworld; } - void add_int_change_z(int x) { change.Z += x * zinttoworld; } // frequently repeated patterns void addCounterToChange() { change.Z += Counter * zinttoworld; } diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index c3bdbcec9..ce658991a 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1172,8 +1172,7 @@ int SpawnRadiationCloud(DSWActor* actor) if (actor->user.ID == MUSHROOM_CLOUD || actor->user.ID == 3121) { actorNew->user.Radius = 2000; - actorNew->user.set_int_change_x((MOVEx(actorNew->spr.xvel>>2, actorNew->int_ang()))); - actorNew->user.set_int_change_y((MOVEy(actorNew->spr.xvel>>2, actorNew->int_ang()))); + actorNew->user.change.XY() = MOVExy(actorNew->spr.xvel >> 2, actorNew->spr.angle); actorNew->spr.zvel = Z(1) + RANDOM_P2(Z(2)); } else diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 49969364c..b91aaedfe 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -856,8 +856,7 @@ void SectorExp(DSWActor* actor, sectortype* sectp, double zh) exp->spr.xrepeat += (RANDOM_P2(32<<8)>>8) - 16; exp->spr.yrepeat += (RANDOM_P2(32<<8)>>8) - 16; - exp->user.set_int_change_x(MOVEx(92, exp->int_ang())); - exp->user.set_int_change_y(MOVEy(92, exp->int_ang())); + exp->user.change.XY() = MOVExy(92, exp->spr.angle); } diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index 7e44b7522..d158443c9 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -38,8 +38,7 @@ public: inline void UpdateChangeXY(DSWActor* actor) { - actor->user.set_int_change_x(MOVEx(actor->spr.xvel, actor->int_ang())); - actor->user.set_int_change_y(MOVEy(actor->spr.xvel, actor->int_ang())); + actor->user.change.XY() = MOVExy(actor->spr.xvel, actor->spr.angle); } inline void UpdateChange(DSWActor* actor, double zfactor = 1.0) diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 9f6eea75a..6018b4197 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -9891,8 +9891,7 @@ void SpawnNuclearSecondaryExp(DSWActor* actor, short ang) //ang = RANDOM_P2(2048); int32_t const vel = (2048+128) + RandomRange(2048); - expActor->user.set_int_change_x(MOVEx(vel, ang)); - expActor->user.set_int_change_y(MOVEy(vel, ang)); + expActor->user.change.XY() = MOVExy(vel, DAngle::fromBuild(ang)); expActor->user.Radius = 200; // was NUKE_RADIUS expActor->user.coll = move_missile(expActor, DVector3(expActor->user.change.XY(), 0), expActor->user.ceiling_dist,expActor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS); @@ -10152,8 +10151,7 @@ void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang) //ang = RANDOM_P2(2048); vel = (1024+512) + RandomRange(1024); - expActor->user.set_int_change_x(MOVEx(vel, ang)); - expActor->user.set_int_change_y(MOVEy(vel, ang)); + expActor->user.change.XY() = MOVExy(vel, DAngle::fromBuild(ang)); expActor->user.coll = move_missile(expActor, DVector3(expActor->user.change.XY(), 0), expActor->user.ceiling_dist,expActor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);