diff --git a/source/games/sw/src/mytypes.h b/source/games/sw/src/mytypes.h index 60bc500ed..af97a860b 100644 --- a/source/games/sw/src/mytypes.h +++ b/source/games/sw/src/mytypes.h @@ -42,8 +42,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms =========================== */ -#define TEST(flags,mask) ((flags) & (mask)) - // mask definitions constexpr int BIT(int shift) diff --git a/source/games/sw/src/panel.cpp b/source/games/sw/src/panel.cpp index a93fbe01b..1b9e5f7d7 100644 --- a/source/games/sw/src/panel.cpp +++ b/source/games/sw/src/panel.cpp @@ -349,8 +349,8 @@ void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value) if (pp->WpnAmmo[WeaponNum] <= 0) { // star and mine - if (TEST(WeaponIsAmmo, BIT(WeaponNum))) - pp->WpnFlags &= ~(BIT(WeaponNum)); + if (WeaponIsAmmo & (1 << WeaponNum)) + pp->WpnFlags &= ~(1 << WeaponNum); pp->WpnAmmo[WeaponNum] = 0; } diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 327e7e2ef..9cf56bcec 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -1121,7 +1121,7 @@ void KillMatchingCrackSprites(short match) { if (actor->spr.hitag == match) { - if (TEST(SP_TAG8(actor), BIT(2))) + if (SP_TAG8(actor) & (1 << 2)) continue; KillActor(actor); diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index b439ff2ec..a27630988 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1641,10 +1641,10 @@ void SpriteSetup(void) actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);; } - if (TEST(SP_TAG8(actor), BIT(0))) - actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE); ; + if (SP_TAG8(actor) & (1 << 0)) + actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE); - if (TEST(SP_TAG8(actor), BIT(1))) + if (SP_TAG8(actor) & (1 << 1)) actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE); change_actor_stat(actor, STAT_SPRITE_HIT_MATCH); @@ -4955,7 +4955,7 @@ bool CanGetWeapon(PLAYERp pp, DSWActor* actor, int WPN) if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN)) return true; - if (TEST(pp->WpnGotOnceFlags, BIT(WPN))) + if (pp->WpnGotOnceFlags & (1 << WPN)) return false; return true; @@ -4967,7 +4967,7 @@ bool CanGetWeapon(PLAYERp pp, DSWActor* actor, int WPN) return true; // No Respawn - can't get a weapon again if you already got it - if (gNet.NoRespawn && TEST(pp->WpnGotOnceFlags, BIT(WPN))) + if (gNet.NoRespawn && (pp->WpnGotOnceFlags & (1 << WPN))) return false; return true; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index c7296e790..a01ee397a 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -8230,7 +8230,7 @@ int DoGrenade(DSWActor* actor) // special case so grenade can ring gong if (hitActor->spr.lotag == TAG_SPRITE_HIT_MATCH) { - if (TEST(SP_TAG8(hitActor), BIT(3))) + if (SP_TAG8(hitActor) & (1 << 3)) DoMatchEverything(nullptr, hitActor->spr.hitag, -1); }