- SW: Replace the last few remaining TEST() macro uses and remove from mytypes.h.

This commit is contained in:
Mitchell Richters 2021-12-29 17:07:10 +11:00 committed by Christoph Oelckers
parent 1439d5f268
commit ae49a55fce
5 changed files with 9 additions and 11 deletions

View file

@ -42,8 +42,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
=========================== ===========================
*/ */
#define TEST(flags,mask) ((flags) & (mask))
// mask definitions // mask definitions
constexpr int BIT(int shift) constexpr int BIT(int shift)

View file

@ -349,8 +349,8 @@ void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
if (pp->WpnAmmo[WeaponNum] <= 0) if (pp->WpnAmmo[WeaponNum] <= 0)
{ {
// star and mine // star and mine
if (TEST(WeaponIsAmmo, BIT(WeaponNum))) if (WeaponIsAmmo & (1 << WeaponNum))
pp->WpnFlags &= ~(BIT(WeaponNum)); pp->WpnFlags &= ~(1 << WeaponNum);
pp->WpnAmmo[WeaponNum] = 0; pp->WpnAmmo[WeaponNum] = 0;
} }

View file

@ -1121,7 +1121,7 @@ void KillMatchingCrackSprites(short match)
{ {
if (actor->spr.hitag == match) if (actor->spr.hitag == match)
{ {
if (TEST(SP_TAG8(actor), BIT(2))) if (SP_TAG8(actor) & (1 << 2))
continue; continue;
KillActor(actor); KillActor(actor);

View file

@ -1641,10 +1641,10 @@ void SpriteSetup(void)
actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);; actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);;
} }
if (TEST(SP_TAG8(actor), BIT(0))) if (SP_TAG8(actor) & (1 << 0))
actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE); ; 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); actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE);
change_actor_stat(actor, STAT_SPRITE_HIT_MATCH); 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)) if (actor->user.Flags2 & (SPR2_NEVER_RESPAWN))
return true; return true;
if (TEST(pp->WpnGotOnceFlags, BIT(WPN))) if (pp->WpnGotOnceFlags & (1 << WPN))
return false; return false;
return true; return true;
@ -4967,7 +4967,7 @@ bool CanGetWeapon(PLAYERp pp, DSWActor* actor, int WPN)
return true; return true;
// No Respawn - can't get a weapon again if you already got it // 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 false;
return true; return true;

View file

@ -8230,7 +8230,7 @@ int DoGrenade(DSWActor* actor)
// special case so grenade can ring gong // special case so grenade can ring gong
if (hitActor->spr.lotag == TAG_SPRITE_HIT_MATCH) 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); DoMatchEverything(nullptr, hitActor->spr.hitag, -1);
} }