From 5b65e214e0e8dbc195f80767392c17f1f0af0200 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Dec 2021 16:02:15 +0100 Subject: [PATCH] - global search & replace of the more frequent sprite flag patterns. --- source/games/blood/src/_polymost.cpp | 8 ++-- source/games/blood/src/actor.cpp | 10 ++--- source/games/blood/src/animatesprite.cpp | 30 +++++++-------- source/games/blood/src/fx.cpp | 4 +- source/games/blood/src/player.cpp | 4 +- source/games/blood/src/seq.cpp | 4 +- source/games/blood/src/warp.cpp | 8 ++-- source/games/duke/src/actors.cpp | 8 ++-- source/games/duke/src/actors_d.cpp | 18 ++++----- source/games/duke/src/actors_r.cpp | 12 +++--- source/games/duke/src/animatesprites_d.cpp | 24 ++++++------ source/games/duke/src/animatesprites_r.cpp | 44 +++++++++++----------- source/games/duke/src/game_misc.cpp | 2 +- source/games/duke/src/player.cpp | 2 +- source/games/duke/src/premap_r.cpp | 2 +- source/games/duke/src/spawn.cpp | 2 +- source/games/duke/src/spawn_d.cpp | 12 +++--- source/games/duke/src/spawn_r.cpp | 22 +++++------ source/games/exhumed/src/anims.cpp | 2 +- source/games/exhumed/src/items.cpp | 2 +- source/games/exhumed/src/sequence.cpp | 4 +- source/games/exhumed/src/spider.cpp | 2 +- 22 files changed, 113 insertions(+), 113 deletions(-) diff --git a/source/games/blood/src/_polymost.cpp b/source/games/blood/src/_polymost.cpp index edaaf2923..ca3f09563 100644 --- a/source/games/blood/src/_polymost.cpp +++ b/source/games/blood/src/_polymost.cpp @@ -72,7 +72,7 @@ void collectTSpritesForPortal(int x, int y, int i, int interpolation) else { nAnim = 8 - nAnim; - pTSprite->cstat |= 4; + pTSprite->cstat |= CSTAT_SPRITE_XFLIP; } break; } @@ -138,7 +138,7 @@ RORHACK: int bakCstat = gView->pSprite->cstat; if (gViewPos == 0) { - gView->pSprite->cstat |= 32768; + gView->pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; } else { @@ -263,7 +263,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int bakCstat = gPlayer[viewPlayer].pSprite->cstat; if (gViewPos == 0) { - gPlayer[viewPlayer].pSprite->cstat |= 32768; + gPlayer[viewPlayer].pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; } else { @@ -295,7 +295,7 @@ void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int bakCstat = gPlayer[viewPlayer].pSprite->cstat; if (gViewPos == 0) { - gPlayer[viewPlayer].pSprite->cstat |= 32768; + gPlayer[viewPlayer].pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; } else { diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index e280f23df..b88b91919 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2724,7 +2724,7 @@ static void actNapalmMove(DBloodActor* actor) actPostSprite(actor, kStatDecoration); seqSpawn(9, actor); - if (Chance(0x8000)) pSprite->cstat |= 4; + if (Chance(0x8000)) pSprite->cstat |= CSTAT_SPRITE_XFLIP; sfxPlay3DSound(actor, 303, 24 + (pSprite->flags & 3), 1); actRadiusDamage(pOwner, pSprite->x, pSprite->y, pSprite->z, pSprite->sector(), 128, 0, 60, kDamageExplode, 15, 120); @@ -5467,7 +5467,7 @@ void actExplodeSprite(DBloodActor* actor) case kMissileFireballNapalm: nType = kExplosionNapalm; seqSpawn(4, actor, -1); - if (Chance(0x8000)) pSprite->cstat |= 4; + if (Chance(0x8000)) pSprite->cstat |= CSTAT_SPRITE_XFLIP; sfxPlay3DSound(actor, 303, -1, 0); GibSprite(actor, GIBTYPE_5, nullptr, nullptr); break; @@ -5475,7 +5475,7 @@ void actExplodeSprite(DBloodActor* actor) case kMissileFlareAlt: nType = kExplosionFireball; seqSpawn(9, actor, -1); - if (Chance(0x8000)) pSprite->cstat |= 4; + if (Chance(0x8000)) pSprite->cstat |= CSTAT_SPRITE_XFLIP; sfxPlay3DSound(actor, 306, 24 + (actor->GetIndex() & 3), FX_GlobalChannel); GibSprite(actor, GIBTYPE_5, nullptr, nullptr); break; @@ -5582,7 +5582,7 @@ void actExplodeSprite(DBloodActor* actor) default: nType = kExplosionStandard; seqSpawn(4, actor, -1); - if (Chance(0x8000)) pSprite->cstat |= 4; + if (Chance(0x8000)) pSprite->cstat |= CSTAT_SPRITE_XFLIP; sfxPlay3DSound(actor, 303, -1, 0); GibSprite(actor, GIBTYPE_5, nullptr, nullptr); break; @@ -6785,7 +6785,7 @@ bool actCheckRespawn(DBloodActor* actor) if (pSprite->type >= kThingBase && pSprite->type < kThingMax) { pXSprite->respawnPending = 3; - if (pSprite->type == kThingTNTBarrel) pSprite->cstat |= 32768; + if (pSprite->type == kThingTNTBarrel) pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; } if (nRespawnTime > 0) { diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 3d05ca21b..f01e39af2 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -204,7 +204,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int break; pNSprite->z = pTSprite->z; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->shade = -128; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; @@ -231,7 +231,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->shade = 26; pNSprite->pal = 0; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->xrepeat = pNSprite->yrepeat = 64; pNSprite->picnum = 2089; break; @@ -246,7 +246,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int GetSpriteExtents(pTSprite, &top, &bottom); pNSprite->shade = 26; pNSprite->pal = 0; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->xrepeat = pNSprite->yrepeat = 24; pNSprite->picnum = 626; pNSprite->z = top; @@ -281,7 +281,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->setsector(pSector); pNSprite->ownerActor = pTSprite->ownerActor; pNSprite->picnum = pTSprite->picnum; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; if (i < 2) pNSprite->cstat |= 514; pNSprite->shade = ClipLow(pTSprite->shade-16, -128); @@ -317,7 +317,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->picnum = 672; else pNSprite->picnum = 754; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->shade = 8; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; @@ -336,7 +336,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->picnum = 672; else pNSprite->picnum = 754; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->shade = 8; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; @@ -380,7 +380,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->z = getflorzofslopeptr(pTSprite->sector(), pNSprite->x, pNSprite->y); pNSprite->shade = 127; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat >> 2; pNSprite->picnum = pTSprite->picnum; @@ -399,7 +399,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int pNSprite->shade = -128; pNSprite->pal = 2; - pNSprite->cstat |= 2; + pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->z = pTSprite->z; pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; @@ -582,7 +582,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in else { nAnim = 8 - nAnim; - pTSprite->cstat |= 4; + pTSprite->cstat |= CSTAT_SPRITE_XFLIP; } break; } @@ -723,11 +723,11 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in } if (pTSprite->flags&1024) { - pTSprite->cstat |= 4; + pTSprite->cstat |= CSTAT_SPRITE_XFLIP; } if (pTSprite->flags&2048) { - pTSprite->cstat |= 8; + pTSprite->cstat |= CSTAT_SPRITE_YFLIP; } switch (pTSprite->statnum) { case kStatDecoration: { @@ -842,7 +842,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in if (IsPlayerSprite(pTSprite)) { PLAYER *pPlayer = &gPlayer[pTSprite->type-kDudePlayer1]; if (powerupCheck(pPlayer, kPwUpShadowCloak) && !powerupCheck(gView, kPwUpBeastVision)) { - pTSprite->cstat |= 2; + pTSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pTSprite->pal = 5; } else if (powerupCheck(pPlayer, kPwUpDeathMask)) { pTSprite->shade = -128; @@ -875,7 +875,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in if (pNTSprite) { pNTSprite->pal = 10; - pNTSprite->cstat |= 4; + pNTSprite->cstat |= CSTAT_SPRITE_XFLIP; } } if (pPlayer->hasFlag&2) { @@ -883,7 +883,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in if (pNTSprite) { pNTSprite->pal = 7; - pNTSprite->cstat |= 4; + pNTSprite->cstat |= CSTAT_SPRITE_XFLIP; } } } @@ -949,7 +949,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in else { nAnim = 8 - nAnim; - pTSprite->cstat |= 4; + pTSprite->cstat |= CSTAT_SPRITE_XFLIP; } break; } diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index 5f56cd5e9..fac6491e5 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -174,9 +174,9 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, int x, int y, int if (pFX->yrepeat > 0) pSprite->yrepeat = pFX->yrepeat; if ((pFX->flags & 1) && Chance(0x8000)) - pSprite->cstat |= 4; + pSprite->cstat |= CSTAT_SPRITE_XFLIP; if ((pFX->flags & 2) && Chance(0x8000)) - pSprite->cstat |= 8; + pSprite->cstat |= CSTAT_SPRITE_YFLIP; if (pFX->seq) { actor->addX(); diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index ab7d922ef..584971184 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1957,7 +1957,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage case kDamageExplode: GibSprite(pActor, GIBTYPE_7, NULL, NULL); GibSprite(pActor, GIBTYPE_15, NULL, NULL); - pPlayer->pSprite->cstat |= 32768; + pPlayer->pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; nDeathSeqID = 17; break; default: @@ -2017,7 +2017,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage sfxPlay3DSound(pPlayer->actor, 717, 0, 0); GibSprite(pActor, GIBTYPE_7, NULL, NULL); GibSprite(pActor, GIBTYPE_15, NULL, NULL); - pPlayer->pSprite->cstat |= 32768; + pPlayer->pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; nDeathSeqID = 2; break; case kDamageBurn: diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 80509f329..e30b33eb3 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -266,7 +266,7 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) } if (pFrame->transparent) - pSprite->cstat |= 2; + pSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; else pSprite->cstat &= ~2; if (pFrame->transparent2) @@ -282,7 +282,7 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) else pSprite->cstat &= ~256; if (pFrame->invisible) - pSprite->cstat |= 32768; + pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; else pSprite->cstat &= (unsigned short)~32768; if (pFrame->pushable) diff --git a/source/games/blood/src/warp.cpp b/source/games/blood/src/warp.cpp index 243a9c9ca..a97cb97ee 100644 --- a/source/games/blood/src/warp.cpp +++ b/source/games/blood/src/warp.cpp @@ -122,19 +122,19 @@ void warpInit(TArray& actors) break; case kMarkerUpLink: pSprite->sector()->upperLink = actor; - pSprite->cstat |= 32768; + pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~257; break; case kMarkerLowLink: pSprite->sector()->lowerLink = actor; - pSprite->cstat |= 32768; + pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~257; break; case kMarkerUpWater: case kMarkerUpStack: case kMarkerUpGoo: pSprite->sector()->upperLink = actor; - pSprite->cstat |= 32768; + pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~257; pSprite->z = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y); break; @@ -142,7 +142,7 @@ void warpInit(TArray& actors) case kMarkerLowStack: case kMarkerLowGoo: pSprite->sector()->lowerLink = actor; - pSprite->cstat |= 32768; + pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~257; pSprite->z = getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y); break; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 7c85bf7da..6d6943795 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -493,7 +493,7 @@ void moveplayers(void) if (spri->xrepeat < 42) { spri->xrepeat += 4; - spri->cstat |= 2; + spri->cstat |= CSTAT_SPRITE_TRANSLUCENT; } else spri->xrepeat = 42; if (spri->yrepeat < 36) @@ -1058,7 +1058,7 @@ void movewaterdrip(DDukeActor *actor, int drip) if (s->zvel == 0) { - s->cstat |= 32768; + s->cstat |= CSTAT_SPRITE_INVISIBLE; if (s->pal != 2 && (isRR() || s->hitag == 0)) S_PlayActorSound(SOMETHING_DRIPPING, actor); @@ -1405,7 +1405,7 @@ void rpgexplode(DDukeActor *actor, int hit, const vec3_t &pos, int EXPLOSION2, i spawn(actor, EXPLOSION2BOT); else { - explosion->s->cstat |= 8; + explosion->s->cstat |= CSTAT_SPRITE_YFLIP; explosion->s->z += (48 << 8); } } @@ -2149,7 +2149,7 @@ void frameeffect1(DDukeActor *actor) return; } else if (t[0] > 4) actor->s->cstat |= 512 + 2; - else if (t[0] > 2) actor->s->cstat |= 2; + else if (t[0] > 2) actor->s->cstat |= CSTAT_SPRITE_TRANSLUCENT; actor->s->xoffset = Owner->s->xoffset; actor->s->yoffset = Owner->s->yoffset; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index d02c2d891..d8382dd2d 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -328,7 +328,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h if (x == 0 || x >= 5 || AFLAMABLE(spri2->picnum)) { - if (spri->picnum != SHRINKSPARK || (spri2->cstat & 257)) + if (spri->picnum != SHRINKSPARK || (spri2->cstat & CSTAT_SPRITE_BLOCK_ALL)) if (dist(actor, act2) < r) { if (badguy(act2) && !cansee(spri2->x, spri2->y, spri2->z + q, spri2->sector(), spri->x, spri->y, spri->z + q, spri->sector())) @@ -336,7 +336,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h fi.checkhitsprite(act2, actor); } } - else if (spri2->extra >= 0 && act2 != actor && (spri2->picnum == TRIPBOMB || badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == STRIPEBALL || (spri2->cstat & 257) || spri2->picnum == DUKELYINGDEAD)) + else if (spri2->extra >= 0 && act2 != actor && (spri2->picnum == TRIPBOMB || badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == STRIPEBALL || (spri2->cstat & CSTAT_SPRITE_BLOCK_ALL) || spri2->picnum == DUKELYINGDEAD)) { if (spri->picnum == SHRINKSPARK && spri2->picnum != SHARK && (act2 == Owner || spri2->xrepeat < 24)) { @@ -871,7 +871,7 @@ void movefallers_d(void) a2->temp_data[0] = 1; a2->s->cstat &= (65535 - 64); if (a2->s->picnum == CEILINGSTEAM || a2->s->picnum == STEAM) - a2->s->cstat |= 32768; + a2->s->cstat |= CSTAT_SPRITE_INVISIBLE; } } } @@ -1798,7 +1798,7 @@ static void weaponcommon_d(DDukeActor* proj) { if (s->zvel < 0) { - k->s->cstat |= 8; k->s->z += (72 << 8); + k->s->cstat |= CSTAT_SPRITE_YFLIP; k->s->z += (72 << 8); } } } @@ -2547,7 +2547,7 @@ static void greenslime(DDukeActor *actor) } else { - s->cstat |= 8; + s->cstat |= CSTAT_SPRITE_YFLIP; makeitfall(actor); } @@ -3140,9 +3140,9 @@ static void fireflyflyingeffect(DDukeActor *actor) } if (Owner->s->xrepeat >= 24 || Owner->s->pal == 1) - actor->s->cstat |= 0x8000; + actor->s->cstat |= CSTAT_SPRITE_INVISIBLE; else - actor->s->cstat &= ~0x8000; + actor->s->cstat &= ~CSTAT_SPRITE_INVISIBLE; double dx = Owner->s->x - ps[p].GetActor()->s->x; double dy = Owner->s->y - ps[p].GetActor()->s->y; @@ -3451,7 +3451,7 @@ static void handle_se28(DDukeActor* actor) while (auto act2 = it.Next()) { if (act2->s->picnum == NATURALLIGHTNING && act2->s->hitag == s->hitag) - act2->s->cstat |= 32768; + act2->s->cstat |= CSTAT_SPRITE_INVISIBLE; } } else if (t[2] > (t[1] >> 3) && t[2] < (t[1] >> 2)) @@ -3488,7 +3488,7 @@ static void handle_se28(DDukeActor* actor) } return; } - else act2->s->cstat |= 32768; + else act2->s->cstat |= CSTAT_SPRITE_INVISIBLE; } } } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 8c3bb181f..d0d93796c 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -272,7 +272,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h auto spri2 = act2->s; if (x == 0 || x >= 5 || AFLAMABLE(spri2->picnum)) { - if (spri2->cstat & 257) + if (spri2->cstat & CSTAT_SPRITE_BLOCK_ALL) if (dist(actor, act2) < r) { if (badguy(act2) && !cansee(spri2->x, spri2->y, spri2->z + q, spri2->sector(), spri->x, spri->y, spri->z + q, spri->sector())) @@ -282,7 +282,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h fi.checkhitsprite(act2, actor); } } - else if (spri2->extra >= 0 && act2 != actor && (badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == BOWLINGPIN || spri2->picnum == STRIPEBALL || (spri2->cstat & 257) || spri2->picnum == DUKELYINGDEAD)) + else if (spri2->extra >= 0 && act2 != actor && (badguy(act2) || spri2->picnum == QUEBALL || spri2->picnum == BOWLINGPIN || spri2->picnum == STRIPEBALL || (spri2->cstat & CSTAT_SPRITE_BLOCK_ALL) || spri2->picnum == DUKELYINGDEAD)) { if (spri->picnum == MORTER && act2 == Owner) { @@ -760,7 +760,7 @@ void respawn_rrra(DDukeActor* oldact, DDukeActor* newact) if (newspr->pal == 8) { - newspr->cstat |= 2; + newspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; } if (newspr->pal != 6) @@ -807,7 +807,7 @@ void movefallers_r(void) ac2->temp_data[0] = 1; ac2->s->cstat &= (65535 - 64); if (ac2->s->picnum == CEILINGSTEAM || ac2->s->picnum == STEAM) - ac2->s->cstat |= 32768; + ac2->s->cstat |= CSTAT_SPRITE_INVISIBLE; } } } @@ -1472,7 +1472,7 @@ static void weaponcommon_r(DDukeActor *proj) { if (s->zvel < 0) { - k->s->cstat |= 8; + k->s->cstat |= CSTAT_SPRITE_YFLIP; k->s->z += (72 << 8); } } @@ -3383,7 +3383,7 @@ void handle_se06_r(DDukeActor *actor) if (ns) { ns->s->cstat = 0; - ns->s->cstat |= 32768; + ns->s->cstat |= CSTAT_SPRITE_INVISIBLE; ns->s->z = s->sector()->floorz - 6144; } deletesprite(actor); diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 21b0a7ea7..0bbd01bc0 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -90,7 +90,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = s->picnum + k; @@ -279,7 +279,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = RPG + k; @@ -300,7 +300,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; @@ -317,7 +317,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr) { - t->cstat |= 2; + t->cstat |= CSTAT_SPRITE_TRANSLUCENT; #if 0 // multiplayer only if (screenpeek == myconnectindex && numplayers >= 2) { @@ -391,7 +391,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; } @@ -518,7 +518,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = (((s->ang + 3072 + 128 - a) & 2047) >> 7) & 7; if (k > 3) { - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; k = 7 - k; } else t->cstat &= ~4; @@ -530,7 +530,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; break; @@ -540,7 +540,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; break; @@ -565,7 +565,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in h->dispicnum = t->picnum; } else if (display_mirror == 1) - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } if (s->statnum == STAT_DUMMYPLAYER || badguy(s) || (s->picnum == APLAYER && h->GetOwner())) @@ -597,7 +597,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in shadowspr->yrepeat = (t->yrepeat >> 3); if (t->yrepeat < 4) t->yrepeat = 4; shadowspr->shade = 127; - shadowspr->cstat |= 2; + shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; shadowspr->z = daz; shadowspr->pal = 4; @@ -682,7 +682,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; } @@ -739,7 +739,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = s->picnum + k; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 77ab54c8f..15f380e7b 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -68,7 +68,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = s->picnum + k; @@ -272,7 +272,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = RRTILE7274 + k; @@ -290,7 +290,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = EMPTYBIKE + k; @@ -302,7 +302,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = EMPTYBOAT + k; @@ -313,7 +313,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = RPG + k; @@ -325,7 +325,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = RPG2 + k; @@ -341,7 +341,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; @@ -358,7 +358,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr) { - t->cstat |= 2; + t->cstat |= CSTAT_SPRITE_TRANSLUCENT; #if 0 // multiplayer only if (screenpeek == myconnectindex && numplayers >= 2) { @@ -434,7 +434,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; } @@ -497,7 +497,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; @@ -523,7 +523,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; @@ -649,7 +649,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = (((s->ang + 3072 + 128 - a) & 2047) >> 7) & 7; if (k > 3) { - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; k = 7 - k; } else t->cstat &= ~4; @@ -661,7 +661,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; break; @@ -671,7 +671,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 6) { k = 12 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; break; @@ -688,7 +688,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; break; @@ -716,7 +716,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in h->dispicnum = t->picnum; } else if (display_mirror == 1) - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } if (!isRRRA() && s->picnum == SBMOVE) @@ -752,7 +752,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in shadowspr->yrepeat = (t->yrepeat >> 3); if (t->yrepeat < 4) t->yrepeat = 4; shadowspr->shade = 127; - shadowspr->cstat |= 2; + shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; shadowspr->z = daz; shadowspr->pal = 4; @@ -809,11 +809,11 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case UFOBEAM: case RRTILE3586: case LADDER: - t->cstat |= 32768; - s->cstat |= 32768; + t->cstat |= CSTAT_SPRITE_INVISIBLE; + s->cstat |= CSTAT_SPRITE_INVISIBLE; break; case DESTRUCTO: - t->cstat |= 32768; + t->cstat |= CSTAT_SPRITE_INVISIBLE; break; case FIRE: case BURNING: @@ -911,7 +911,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; @@ -965,7 +965,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (k > 4) { k = 8 - k; - t->cstat |= 4; + t->cstat |= CSTAT_SPRITE_XFLIP; } else t->cstat &= ~4; t->picnum = s->picnum + k; diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 2cd9387b1..6342c6ebd 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -414,7 +414,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int sprx = spr->x; spry = spr->y; - if ((spr->cstat & 257) != 0) switch (spr->cstat & 48) + if ((spr->cstat & CSTAT_SPRITE_BLOCK_ALL) != 0) switch (spr->cstat & 48) { case 0: //break; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 2b1062bf7..95fd52efb 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -102,7 +102,7 @@ void quickkill(struct player_struct* p) auto pa = p->GetActor(); pa->s->extra = 0; - pa->s->cstat |= 32768; + pa->s->cstat |= CSTAT_SPRITE_INVISIBLE; if (ud.god == 0) fi.guts(pa, TILE_JIBS6, 8, myconnectindex); return; } diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index 11f7fafc0..0d3abf441 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -581,7 +581,7 @@ void prelevel_r(int g, TArray& actors) break; case RRTILE67: - si->cstat |= 32768; + si->cstat |= CSTAT_SPRITE_INVISIBLE; break; case SOUNDFX: diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 378b6c036..95e0a565b 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -628,7 +628,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) int d, clostest = 0; sp->yvel = sectp->extra; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->xrepeat = sp->yrepeat = 0; switch (sp->lotag) diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 51cb25d3c..d2fdc287f 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -164,7 +164,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (spj->sector()->lotag == 2) { sp->z = getceilzofslopeptr(sp->sector(), sp->x, sp->y) + (16 << 8); - sp->cstat |= 8; + sp->cstat |= CSTAT_SPRITE_YFLIP; } else if (spj->sector()->lotag == 1) sp->z = getflorzofslopeptr(sp->sector(), sp->x, sp->y); @@ -215,7 +215,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* break; case NATURALLIGHTNING: sp->cstat &= ~257; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; break; case TRANSPORTERSTAR: case TRANSPORTERBEAM: @@ -668,7 +668,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* sp->yrepeat = spj->yrepeat; sp->zvel = 128; if (sp->sector()->lotag != 2) - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; } ChangeActorStat(act, STAT_DUMMYPLAYER); break; @@ -755,7 +755,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* Printf(TEXTCOLOR_YELLOW "WARNING: WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n", act->GetIndex(), sp->x, sp->y); sp->hitag = 0; } - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 6); break; case BOLT1: @@ -771,7 +771,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* [[fallthrough]]; case MASTERSWITCH: if (sp->picnum == MASTERSWITCH) - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->yvel = 0; ChangeActorStat(act, 6); break; @@ -913,7 +913,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* break; case LOCATORS: - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 7); break; diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 2e84704e5..6528a8b4e 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -57,7 +57,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case RRTILE2027: case RRTILE2028: sp->cstat = 0; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->xrepeat = 0; sp->yrepeat = 0; sp->clipdist = 0; @@ -168,7 +168,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case RRTILE292: case RRTILE293: sp->cstat = 0; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->xrepeat = 0; sp->yrepeat = 0; sp->clipdist = 0; @@ -216,7 +216,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (spj->sector()->lotag == 2) { sp->z = getceilzofslopeptr(sp->sector(), sp->x, sp->y) + (16 << 8); - sp->cstat |= 8; + sp->cstat |= CSTAT_SPRITE_YFLIP; } else if (spj->sector()->lotag == 1) sp->z = getflorzofslopeptr(sp->sector(), sp->x, sp->y); @@ -473,7 +473,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 2); break; case RRTILE295: - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 107); break; case RRTILE296: @@ -610,7 +610,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* break; case SOUNDFX: { - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 2); } break; @@ -668,7 +668,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->yrepeat = spj->yrepeat; sp->zvel = 128; if (sp->sector()->lotag != 2) - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; } ChangeActorStat(act, 13); break; @@ -729,7 +729,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* } [[fallthrough]]; case WATERBUBBLEMAKER: - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 6); break; case BOLT1: @@ -741,7 +741,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* [[fallthrough]]; case MASTERSWITCH: if (sp->picnum == MASTERSWITCH) - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->yvel = 0; ChangeActorStat(act, 6); break; @@ -1066,14 +1066,14 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* break; case LOCATORS: // sp->xrepeat=sp->yrepeat=0; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, STAT_LOCATOR); break; case ACTIVATORLOCKED: case ACTIVATOR: // sp->xrepeat=sp->yrepeat=0; - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; if (sp->picnum == ACTIVATORLOCKED) sectp->lotag ^= 16384; ChangeActorStat(act, STAT_ACTIVATOR); @@ -1491,7 +1491,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, STAT_STANDABLE); break; case RRTILE63: - sp->cstat |= 32768; + sp->cstat |= CSTAT_SPRITE_INVISIBLE; sp->xrepeat = 1; sp->yrepeat = 1; sp->clipdist = 1; diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index ba6efb11a..636c0652f 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -209,7 +209,7 @@ void AIAnim::Tick(RunListEvent* ev) pActor->nIndex = 0; pActor->nIndex2 = nMagicSeq; pActor->nAction |= 0x10; - pSprite->cstat |= 2; + pSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; } else if (nIndex2 == nSavePointSeq) { diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index 1c651ecbf..19d36fdb5 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -128,7 +128,7 @@ void BuildItemAnim(DExhumedActor* pActor) auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pSprite->x, pSprite->y, pSprite->z, pSprite->sector(), nItemAnimInfo[nItem].repeat, 20); if (nItem == 44) { - pAnimActor->s().cstat |= 2; + pAnimActor->s().cstat |= CSTAT_SPRITE_TRANSLUCENT; } ChangeActorStat(pAnimActor, pSprite->statnum); diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index bf6cc9a56..7f358e4ed 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -504,7 +504,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) if (ChunkFlag[nFrameBase] & 1) { pTSprite->xoffset = (int8_t)ChunkXpos[nFrameBase]; - pTSprite->cstat |= 4; + pTSprite->cstat |= CSTAT_SPRITE_XFLIP; } else { @@ -590,7 +590,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) if (ChunkFlag[nBase] & 1) { tsp->xoffset = (int8_t)ChunkXpos[nBase]; - tsp->cstat |= 4; // x-flipped + tsp->cstat |= CSTAT_SPRITE_XFLIP; // x-flipped } else { diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 9a343c185..6f91505bc 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -293,7 +293,7 @@ void AISpider::Tick(RunListEvent* ev) && hiHit.type != kHitSprite && !((sp->sector()->ceilingstat) & CSTAT_SECTOR_SKY)) { - sp->cstat |= 8; + sp->cstat |= CSTAT_SPRITE_YFLIP; sp->z = GetActorHeight(spp) + sp->sector()->ceilingz; sp->zvel = 0;