- the remaining RESET() calls.

This commit is contained in:
Christoph Oelckers 2021-12-27 19:07:39 +01:00
parent e29d0f50cf
commit 08fcfb382c
13 changed files with 44 additions and 47 deletions

View file

@ -602,23 +602,23 @@ int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, int ang, int typ
{
if (break_info->breaknum == -1)
{
RESET(wallp->cstat, CSTAT_WALL_MASKED|CSTAT_WALL_1WAY|CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
wallp->cstat &= ~(CSTAT_WALL_MASKED|CSTAT_WALL_1WAY|CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
wallp->overpicnum = 0;
if (wallp->twoSided())
{
nwp = wallp->nextWall();
RESET(nwp->cstat, CSTAT_WALL_MASKED|CSTAT_WALL_1WAY|CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
nwp->cstat &= ~(CSTAT_WALL_MASKED|CSTAT_WALL_1WAY|CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
nwp->overpicnum = 0;
}
}
else
{
RESET(wallp->cstat, CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
wallp->cstat &= ~(CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
wallp->overpicnum = break_info->breaknum;
if (wallp->twoSided())
{
nwp = wallp->nextWall();
RESET(nwp->cstat, CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
nwp->cstat &= ~(CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK);
nwp->overpicnum = break_info->breaknum;
}
}
@ -651,9 +651,9 @@ bool UserBreakWall(WALLp wp)
{
// do it the old way and get rid of wall - assumed to be masked
DoSpawnSpotsForKill(match);
RESET(wp->cstat, flags);
wp->cstat &= ~(flags);
if (wp->twoSided())
RESET(wp->nextWall()->cstat, flags);
wp->nextWall()->cstat &= ~(flags);
// clear tags
wp->hitag = wp->lotag = 0;
@ -683,9 +683,9 @@ bool UserBreakWall(WALLp wp)
else if (SP_TAG8(actor) == 1)
{
// clear flags
RESET(wp->cstat, flags);
wp->cstat &= ~(flags);
if (wp->twoSided())
RESET(wp->nextWall()->cstat, flags);
wp->nextWall()->cstat &= ~(flags);
// clear tags
wp->hitag = wp->lotag = 0;
if (wp->twoSided())
@ -699,9 +699,9 @@ bool UserBreakWall(WALLp wp)
wp->picnum = SP_TAG5(actor);
// clear flags
RESET(wp->cstat, block_flags);
wp->cstat &= ~(block_flags);
if (wp->twoSided())
RESET(wp->nextWall()->cstat, block_flags);
wp->nextWall()->cstat &= ~(block_flags);
// clear tags
wp->hitag = wp->lotag = 0;

View file

@ -221,7 +221,7 @@ int DoShadowFindGroundPoint(tspriteptr_t tspr)
// because the ceiling and floors get moved out of the way for drawing.
save_cstat = tspr->cstat;
RESET(tspr->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
tspr->cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
FAFgetzrangepoint(tspr->pos.X, tspr->pos.Y, tspr->pos.Z, tspr->sector(), &hiz, &ceilhit, &loz, &florhit);
tspr->cstat = save_cstat;
@ -241,7 +241,7 @@ int DoShadowFindGroundPoint(tspriteptr_t tspr)
// reset the blocking bit of what you hit and try again -
// recursive
bak_cstat = hitactor->spr.cstat;
RESET(hitactor->spr.cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
hitactor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
loz = DoShadowFindGroundPoint(tspr);
hitactor->spr.cstat = bak_cstat;
}
@ -1006,7 +1006,7 @@ void CircleCamera(int *nx, int *ny, int *nz, sectortype** vsect, binangle *nang,
if (!TEST(hitactor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{
auto flag_backup = hitactor->spr.cstat;
RESET(hitactor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
hitactor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
CircleCamera(nx, ny, nz, vsect, nang, q16horiz);
hitactor->spr.cstat = flag_backup;

View file

@ -826,7 +826,7 @@ int DoGirlNinjaSpecial(DSWActor* actor)
{
if (actor->user.spal == PALETTE_PLAYER5)
{
RESET(actor->spr.cstat,CSTAT_SPRITE_TRANSLUCENT);
actor->spr.cstat &= ~(CSTAT_SPRITE_TRANSLUCENT);
actor->spr.hitag = 0;
actor->spr.shade = -10;
}

View file

@ -459,7 +459,7 @@ int DoBloodSpray(DSWActor* actor)
actor->user.sy = actor->user.sz; // ceiling and floor are equal - white wall
}
RESET(actor->spr.cstat,CSTAT_SPRITE_INVISIBLE);
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE);
ChangeState(actor, s_BloodSprayDrip);
}

View file

@ -43,7 +43,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/
#define TEST(flags,mask) ((flags) & (mask))
#define RESET(flags,mask) ((flags) &= ~(mask))
#define FLIP(flags,mask) ((flags) ^= (mask))
// mask definitions

View file

@ -1959,7 +1959,7 @@ int DoNinjaGrabThroat(DSWActor* actor)
if ((actor->user.WaitTics -= ACTORMOVETICS) <= 0)
{
UpdateSinglePlayKills(actor);
RESET(actor->user.Flags2, SPR2_DYING);
actor->user.Flags2 &= ~(SPR2_DYING);
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP);
change_actor_stat(actor, STAT_DEAD_ACTOR);
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -2101,7 +2101,7 @@ int DoNinjaSpecial(DSWActor* actor)
{
if (actor->user.spal == PALETTE_PLAYER5)
{
RESET(actor->spr.cstat,CSTAT_SPRITE_TRANSLUCENT);
actor->spr.cstat &= ~(CSTAT_SPRITE_TRANSLUCENT);
actor->spr.hitag = 0;
actor->spr.shade = -10;
}
@ -2239,8 +2239,6 @@ void PlayerDeathReset(PLAYERp pp)
pp->sop_remote = nullptr;
pp->sop = nullptr;
DoPlayerResetMovement(pp);
//if (pp->CurWpn)
// RESET(pp->CurWpn->flags, PANF_DEATH_HIDE);
DamageData[actor->user.WeaponNum].Init(pp);
}

View file

@ -353,7 +353,7 @@ void PlayerUpdateAmmo(PLAYERp pp, short UpdateWeaponNum, short value)
{
// star and mine
if (TEST(WeaponIsAmmo, BIT(WeaponNum)))
RESET(pp->WpnFlags, BIT(WeaponNum));
pp->WpnFlags &= ~(BIT(WeaponNum));
pp->WpnAmmo[WeaponNum] = 0;
}
@ -948,7 +948,7 @@ void InitWeaponSword(PLAYERp pp)
// needed for death sequence when the SWORD was your weapon when you died
if (pp->Wpn[WPN_SWORD] && TEST(pp->Wpn[WPN_SWORD]->flags, PANF_DEATH_HIDE))
{
RESET(pp->Wpn[WPN_SWORD]->flags, PANF_DEATH_HIDE);
pp->Wpn[WPN_SWORD]->flags &= ~(PANF_DEATH_HIDE);
pp->Flags &= ~(PF_WEAPON_RETRACT|PF_WEAPON_DOWN);
pSetState(pp->CurWpn, pp->CurWpn->PresentState);
return;
@ -1345,7 +1345,7 @@ void InitWeaponStar(PLAYERp pp)
// needed for death sequence when the STAR was your weapon when you died
if (pp->Wpn[WPN_STAR] && TEST(pp->Wpn[WPN_STAR]->flags, PANF_DEATH_HIDE))
{
RESET(pp->Wpn[WPN_STAR]->flags, PANF_DEATH_HIDE);
pp->Wpn[WPN_STAR]->flags &= ~(PANF_DEATH_HIDE);
pp->Flags &= ~(PF_WEAPON_RETRACT);
pSetState(pp->CurWpn, pp->CurWpn->PresentState);
return;

View file

@ -1313,7 +1313,7 @@ void DoSpawnTeleporterEffect(DSWActor* actor)
effectActor->spr.shade = -40;
effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42;
effectActor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
RESET(effectActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
effectActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
}
@ -1331,7 +1331,7 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor)
effectActor->spr.shade = -40;
effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42;
effectActor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
RESET(effectActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
effectActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
effectActor->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
}
@ -4261,7 +4261,7 @@ void DoPlayerStopDiveNoWarp(PLAYERp pp)
pp->Flags &= ~(PF_DIVING|PF_DIVING_IN_LAVA);
DoPlayerDivePalette(pp);
DoPlayerNightVisionPalette(pp);
RESET(pp->actor->spr.cstat, CSTAT_SPRITE_YCENTER);
pp->actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
if (pp == Player + screenpeek)
{
COVER_SetReverb(0);

View file

@ -109,7 +109,7 @@ void ResetWallWarpHitscan(sectortype* sect)
// Travel all the way around loop setting wall bits
do
{
RESET(wall_num->cstat, CSTAT_WALL_WARP_HITSCAN);
wall_num->cstat &= ~(CSTAT_WALL_WARP_HITSCAN);
wall_num = wall_num->point2Wall();
}
while (wall_num != start_wall);

View file

@ -692,7 +692,7 @@ void KillActor(DSWActor* actor)
if (actor->user.track != -1)
{
if (Track[actor->user.track].flags)
RESET(Track[actor->user.track].flags, TF_TRACK_OCCUPIED);
Track[actor->user.track].flags &= ~(TF_TRACK_OCCUPIED);
}
}
@ -908,7 +908,7 @@ void PicAnimOff(short picnum)
if (!anim_type)
return;
RESET(picanm[picnum].sf, PICANM_ANIMTYPE_MASK);
picanm[picnum].sf &= ~(PICANM_ANIMTYPE_MASK);
}
bool IconSpawn(DSWActor* actor)
@ -1589,7 +1589,7 @@ void SpriteSetup(void)
// Non ST1 sprites that are tagged like them
if (TEST_BOOL1(actor) && actor->spr.picnum != ST1)
{
RESET(actor->spr.extra,
actor->spr.extra &= ~(
SPRX_BOOL4|
SPRX_BOOL5|
SPRX_BOOL6|
@ -2822,8 +2822,8 @@ KeyMain:
ChangeState(actor, s_Key[num]);
RESET(picanm[actor->spr.picnum].sf, PICANM_ANIMTYPE_MASK);
RESET(picanm[actor->spr.picnum + 1].sf, PICANM_ANIMTYPE_MASK);
picanm[actor->spr.picnum].sf &= ~(PICANM_ANIMTYPE_MASK);
picanm[actor->spr.picnum + 1].sf &= ~(PICANM_ANIMTYPE_MASK);
change_actor_stat(actor, STAT_ITEM);
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN | CSTAT_SPRITE_ONE_SIDE);
actor->user.Radius = 500;
@ -4231,8 +4231,8 @@ int SpawnItemsMatch(short match)
ChangeState(spawnedActor, s_Key[num]);
RESET(picanm[spawnedActor->spr.picnum].sf, PICANM_ANIMTYPE_MASK);
RESET(picanm[spawnedActor->spr.picnum + 1].sf, PICANM_ANIMTYPE_MASK);
picanm[spawnedActor->spr.picnum].sf &= ~(PICANM_ANIMTYPE_MASK);
picanm[spawnedActor->spr.picnum + 1].sf &= ~(PICANM_ANIMTYPE_MASK);
SetupItemForJump(itActor, spawnedActor);
@ -4265,7 +4265,7 @@ int NewStateGroup(DSWActor* actor, STATEp StateGroup[])
// turn anims off because people keep setting them in the
// art file
RESET(picanm[actor->spr.picnum].sf, PICANM_ANIMTYPE_MASK);
picanm[actor->spr.picnum].sf &= ~(PICANM_ANIMTYPE_MASK);
return 0;
}

View file

@ -876,7 +876,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
case SO_SHOOT_POINT:
ClearOwner(itActor);
change_actor_stat(itActor, STAT_SO_SHOOT_POINT);
RESET(itActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
itActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
break;
default:
break;
@ -2120,7 +2120,7 @@ void CallbackSOsink(ANIMp ap, void *data)
destsect->floorshade = srcsect->floorshade;
// destsect->floorz = srcsect->floorz;
RESET(destsect->floorstat, CSTAT_SECTOR_ALIGN);
destsect->floorstat &= ~(CSTAT_SECTOR_ALIGN);
destsect->u_defined = true;
ASSERT(srcsect->hasU());
@ -2154,7 +2154,7 @@ void CallbackSOsink(ANIMp ap, void *data)
// Take out any blocking walls
for(auto& wal : wallsofsector(destsect))
{
RESET(wal.cstat, CSTAT_WALL_BLOCK);
wal.cstat &= ~(CSTAT_WALL_BLOCK);
}
return;
@ -2421,7 +2421,7 @@ void DoTrack(SECTOR_OBJECTp sop, short locktics, int *nx, int *ny)
AnimSet(ANIM_Floorz, *sectp, (*sectp)->floorz + Z((*sectp)->height), 128);
(*sectp)->floorshade += (*sectp)->height / 6;
RESET((*sectp)->extra, SECTFX_NO_RIDE);
(*sectp)->extra &= ~(SECTFX_NO_RIDE);
}
}
}
@ -2852,7 +2852,7 @@ void DoAutoTurretObject(SECTOR_OBJECTp sop)
void DoActorHitTrackEndPoint(DSWActor* actor)
{
RESET(Track[actor->user.track].flags, TF_TRACK_OCCUPIED);
Track[actor->user.track].flags &= ~(TF_TRACK_OCCUPIED);
// jump the current track & determine if you should go to another
if (TEST(actor->user.Flags, SPR_RUN_AWAY))
@ -2900,7 +2900,7 @@ void ActorLeaveTrack(DSWActor* actor)
return;
actor->user.Flags &= ~(SPR_FIND_PLAYER|SPR_RUN_AWAY|SPR_CLIMBING);
RESET(Track[actor->user.track].flags, TF_TRACK_OCCUPIED);
Track[actor->user.track].flags &= ~(TF_TRACK_OCCUPIED);
actor->user.track = -1;
}

View file

@ -72,7 +72,7 @@ void ProcessVisOn(void)
if (own != nullptr)
{
ASSERT(own->hasU());
RESET(own->user.Flags2, SPR2_VIS_SHADING);
own->user.Flags2 &= ~(SPR2_VIS_SHADING);
}
KillActor(actor);
}

View file

@ -3184,8 +3184,8 @@ int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK
{
// has a user - is programmed
change_actor_stat(parentActor, STAT_MISC);
RESET(parentActor->spr.extra, SPRX_BREAKABLE);
RESET(parentActor->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
parentActor->spr.extra &= ~(SPRX_BREAKABLE);
parentActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
}
}
@ -5180,7 +5180,7 @@ int ActorStdMissile(DSWActor* actor, DSWActor* weapActor)
// attempt to see if it was killed
ASSERT(goal->spr.insector());
if (goal->hasU())
RESET(goal->user.Flags, SPR_TARGETED);
goal->user.Flags &= ~(SPR_TARGETED);
}
return 0;
@ -11570,7 +11570,7 @@ int InitSerpRing(DSWActor* actor)
// defaults do change the statnum
EnemyDefaults(actorNew, nullptr, nullptr);
change_actor_stat(actorNew, STAT_SKIP4);
RESET(actorNew->spr.extra, SPRX_PLAYER_OR_ENEMY);
actorNew->spr.extra &= ~(SPRX_PLAYER_OR_ENEMY);
actorNew->spr.clipdist = (128+64) >> 2;
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
@ -17673,7 +17673,7 @@ int QueueFootPrint(DSWActor* actor)
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = actor->spr.pos;
spawnedActor->spr.ang = actor->spr.ang;
RESET(spawnedActor->user.Flags, SPR_SHADOW);
spawnedActor->user.Flags &= ~(SPR_SHADOW);
switch (FootMode)
{
case BLOOD_FOOT: