- SW: Use BIT() inline in a few places that were changed in "- SW: Replace the last few remaining TEST() macro uses and remove from mytypes.h."

Originally, `BIT()` was going to be dropped in a subsequent commit but we've elected not to.
This commit is contained in:
Mitchell Richters 2021-12-30 11:03:40 +11:00
parent c61d82cead
commit 1b077251e3
4 changed files with 8 additions and 8 deletions

View file

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

View file

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

View file

@ -1641,10 +1641,10 @@ void SpriteSetup(void)
actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);;
}
if (SP_TAG8(actor) & (1 << 0))
if (SP_TAG8(actor) & BIT(0))
actor->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
if (SP_TAG8(actor) & (1 << 1))
if (SP_TAG8(actor) & BIT(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 (pp->WpnGotOnceFlags & (1 << WPN))
if (pp->WpnGotOnceFlags & BIT(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 && (pp->WpnGotOnceFlags & (1 << WPN)))
if (gNet.NoRespawn && (pp->WpnGotOnceFlags & BIT(WPN)))
return false;
return true;

View file

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