- SW: Replace TEST\(([\w\-\>.()\[\]]+),\s?([\w\_\|\s]+)\) with ($1 & ($2)).

This commit is contained in:
Mitchell Richters 2021-12-29 16:25:37 +11:00 committed by Christoph Oelckers
parent 48b0058d38
commit 1439d5f268
8 changed files with 15 additions and 15 deletions

View file

@ -374,7 +374,7 @@ TARGETACTOR:
if (itActor == actor || !itActor->hasU())
continue;
if (TEST(itActor->user.Flags, SPR_SUICIDE | SPR_DEAD))
if ((itActor->user.Flags & (SPR_SUICIDE | SPR_DEAD)))
continue;
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, itActor->spr.pos.X, itActor->spr.pos.Y, dist, a, b, c);

View file

@ -768,7 +768,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
if (Player[screenpeek].actor == tActor)
{
pp = Player + screenpeek;
if (display_mirror || TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA))
if (display_mirror || (pp->Flags & (PF_VIEW_FROM_OUTSIDE|PF_VIEW_FROM_CAMERA)))
{
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
tsp->cstat |= (CSTAT_SPRITE_TRANSLUCENT);

View file

@ -6580,7 +6580,7 @@ void pDisplaySprites(PLAYERp pp, double smoothratio)
}
// shading
if (psp->State && TEST(psp->State->flags, psf_ShadeHalf|psf_ShadeNone))
if (psp->State && (psp->State->flags & (psf_ShadeHalf|psf_ShadeNone)))
{
if ((psp->State->flags & psf_ShadeNone))
shade = 0;

View file

@ -2573,7 +2573,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
{
for(auto& wal : wallsofsector(*sectp))
{
if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY) == WALLFX_LOOP_OUTER)
if (wal.extra && (wal.extra & (WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY)) == WALLFX_LOOP_OUTER)
{
x[count] = wal.pos.X;
y[count] = wal.pos.Y;
@ -5940,7 +5940,7 @@ void DoPlayerDeathFlip(PLAYERp pp)
DoPlayerDeathZrange(pp);
if (TEST(pp->Flags,PF_JUMPING|PF_FALLING))
if ((pp->Flags & (PF_JUMPING|PF_FALLING)))
{
if ((pp->Flags & PF_JUMPING))
{
@ -5977,7 +5977,7 @@ void DoPlayerDeathDrown(PLAYERp pp)
DoPlayerDeathZrange(pp);
if (TEST(pp->Flags,PF_JUMPING|PF_FALLING))
if ((pp->Flags & (PF_JUMPING|PF_FALLING)))
{
if ((pp->Flags & PF_JUMPING))
{
@ -6045,7 +6045,7 @@ void DoPlayerDeathCrumble(PLAYERp pp)
DoPlayerDeathZrange(pp);
if (TEST(pp->Flags,PF_JUMPING|PF_FALLING))
if ((pp->Flags & (PF_JUMPING|PF_FALLING)))
{
if ((pp->Flags & PF_JUMPING))
{
@ -6097,7 +6097,7 @@ void DoPlayerDeathExplode(PLAYERp pp)
DoPlayerDeathZrange(pp);
if (TEST(pp->Flags,PF_JUMPING|PF_FALLING))
if ((pp->Flags & (PF_JUMPING|PF_FALLING)))
{
if ((pp->Flags & PF_JUMPING))
{
@ -6439,7 +6439,7 @@ void ChopsCheck(PLAYERp pp)
if (!M_Active() && !(pp->Flags & PF_DEAD) && !pp->sop_riding && numplayers <= 1)
{
if (pp->input.actions & ~SB_RUN || pp->input.fvel || pp->input.svel || pp->input.avel || pp->input.horz ||
TEST(pp->Flags, PF_CLIMBING | PF_FALLING | PF_DIVING))
(pp->Flags & (PF_CLIMBING | PF_FALLING | PF_DIVING)))
{
// Hit a input key or other reason to stop chops
//if (pp->Chops && pp->Chops->State != pp->Chops->State->RetractState)

View file

@ -2672,7 +2672,7 @@ void DoSector(void)
}
// force sync SOs to be updated regularly
if ((sync_flag = TEST(sop->flags, SOBJ_SYNC1|SOBJ_SYNC2)) != 0)
if ((sync_flag = (sop->flags & (SOBJ_SYNC1|SOBJ_SYNC2))) != 0)
{
if (sync_flag == SOBJ_SYNC1)
MoveSectorObjects(sop, synctics);

View file

@ -1508,7 +1508,7 @@ void SpriteSetupPost(void)
if (jActor->spr.picnum == ST1)
continue;
if (TEST(jActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR))
if ((jActor->spr.cstat & (CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR)))
continue;
if (jActor->hasU())

View file

@ -1612,13 +1612,13 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{
if (TEST(sop->flags, SOBJ_SPRITE_OBJ | SOBJ_DONT_ROTATE))
if ((sop->flags & (SOBJ_SPRITE_OBJ | SOBJ_DONT_ROTATE)))
goto PlayerPart;
// move all walls in sectors
for(auto& wal : wallsofsector(*sectp))
{
if (TEST(wal.extra, WALLFX_LOOP_DONT_SPIN | WALLFX_DONT_MOVE))
if ((wal.extra & (WALLFX_LOOP_DONT_SPIN | WALLFX_DONT_MOVE)))
continue;
if (wal.extra && (wal.extra & WALLFX_LOOP_OUTER))
@ -2227,7 +2227,7 @@ void MoveSectorObjects(SECTOR_OBJECTp sop, short locktics)
else
{
// Update the points so there will be no warping
if (TEST(sop->flags, SOBJ_UPDATE|SOBJ_UPDATE_ONCE) ||
if ((sop->flags & (SOBJ_UPDATE|SOBJ_UPDATE_ONCE)) ||
sop->vel ||
(sop->ang != sop->ang_tgt) ||
GlobSpeedSO)

View file

@ -17423,7 +17423,7 @@ bool TestDontStick(DSWActor* actor, walltype* hit_wall)
bool TestDontStickSector(sectortype* hit_sect)
{
if (TEST(hit_sect->extra, SECTFX_DYNAMIC_AREA|SECTFX_SECTOR_OBJECT))
if ((hit_sect->extra & (SECTFX_DYNAMIC_AREA|SECTFX_SECTOR_OBJECT)))
return true;
return false;