From 8d0013128e03bf6576c408ab921984f1fdda10d4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Dec 2021 12:36:53 +0100 Subject: [PATCH] - Exhumed: use symbolic constant CSTAT_SPRITE_INVISIBLE --- source/games/duke/src/spawn_r.cpp | 32 +++++++++++++-------------- source/games/exhumed/src/bubbles.cpp | 2 +- source/games/exhumed/src/grenade.cpp | 2 +- source/games/exhumed/src/init.cpp | 6 ++--- source/games/exhumed/src/items.cpp | 2 +- source/games/exhumed/src/lavadude.cpp | 4 ++-- source/games/exhumed/src/lion.cpp | 2 +- source/games/exhumed/src/move.cpp | 6 ++--- source/games/exhumed/src/object.cpp | 16 +++++++------- source/games/exhumed/src/player.cpp | 16 +++++++------- source/games/exhumed/src/queen.cpp | 2 +- source/games/exhumed/src/ra.cpp | 6 ++--- source/games/exhumed/src/rat.cpp | 2 +- source/games/exhumed/src/set.cpp | 2 +- source/games/exhumed/src/spider.cpp | 2 +- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index b70a5c4f2..2e84704e5 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -315,7 +315,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case FORCESPHERE: if (!spj) { - sp->cstat = 32768; + sp->cstat = CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 2); } else @@ -466,7 +466,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 2); break; case HENSTAND: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 48; sp->xrepeat = 21; sp->yrepeat = 15; @@ -486,7 +486,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case RRTILE3190: case RRTILE3191: case RRTILE3192: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 8; sp->xrepeat = 32; sp->yrepeat = 26; @@ -494,7 +494,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case RRTILE3120: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 8; sp->xrepeat = 12; sp->yrepeat = 10; @@ -502,7 +502,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case RRTILE3122: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 2; sp->xrepeat = 8; sp->yrepeat = 6; @@ -510,7 +510,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case RRTILE3123: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 8; sp->xrepeat = 13; sp->yrepeat = 13; @@ -518,7 +518,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case RRTILE3124: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 8; sp->xrepeat = 17; sp->yrepeat = 12; @@ -526,7 +526,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case RRTILE3132: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 8; sp->xrepeat = 13; sp->yrepeat = 10; @@ -534,7 +534,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, 1); break; case BOWLINGPIN: - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->clipdist = 48; sp->xrepeat = 23; sp->yrepeat = 23; @@ -605,7 +605,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* ChangeActorStat(act, STAT_MISC); break; } - sp->cstat = 32768; + sp->cstat = CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, 11); break; case SOUNDFX: @@ -1330,7 +1330,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case TREE1: case TREE2: case TIRE: - sp->cstat = 257; // Make it hitable + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; // Make it hitable sp->extra = 1; ChangeActorStat(act, 6); break; @@ -1343,7 +1343,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case CAMERAPOLE: sp->extra = 1; - if (gs.camerashitable) sp->cstat = 257; + if (gs.camerashitable) sp->cstat = CSTAT_SPRITE_BLOCK_ALL; else sp->cstat = 0; if (ud.multimode < 2 && sp->pal != 0) @@ -1380,7 +1380,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->shade = -16; if (sp->xrepeat <= 8) { - sp->cstat = 32768; + sp->cstat = CSTAT_SPRITE_INVISIBLE; sp->xrepeat = sp->yrepeat = 0; } else sp->cstat = 1 + 256; @@ -1421,7 +1421,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->yrepeat = 18; sp->clipdist = MulScale(sp->xrepeat, tileWidth(sp->picnum), 7); act->saved_ammo = 100; - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->lotag = 1; ChangeActorStat(act, STAT_ACTOR); break; @@ -1437,7 +1437,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->yrepeat = 32; sp->clipdist = MulScale(sp->xrepeat, tileWidth(sp->picnum), 7); act->saved_ammo = 20; - sp->cstat = 257; + sp->cstat = CSTAT_SPRITE_BLOCK_ALL; sp->lotag = 1; ChangeActorStat(act, 1); break; @@ -1482,7 +1482,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* { if (sp->picnum == EGG) sp->clipdist = 24; - sp->cstat = 257 | (krand() & 4); + sp->cstat = CSTAT_SPRITE_BLOCK_ALL | (krand() & 4); ChangeActorStat(act, STAT_ZOMBIEACTOR); } break; diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index 1aad7a45d..c98e2751f 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -140,7 +140,7 @@ void BuildBubbleMachine(DExhumedActor* pActor) pActor->nCount = pActor->nFrame; auto pSprite = &pActor->s(); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; ChangeActorStat(pActor, kStatBubbleMachine); } diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 0a218b0c7..50c3e05b7 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -113,7 +113,7 @@ void BuildGrenade(int nPlayer) pSprite->shade = -64; pSprite->xrepeat = 20; pSprite->yrepeat = 20; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->picnum = 1; pSprite->pal = 0; pSprite->clipdist = 30; diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index 8d8143f8a..caa941730 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -701,13 +701,13 @@ void ProcessSpriteTag(DExhumedActor* pActor, int nLotag, int nHitag) case 63: { ChangeActorStat(pActor, 405); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; return; } case 62: { nNetStartSprite[nNetStartSprites] = pActor; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; nNetStartSprites++; return; @@ -766,7 +766,7 @@ void ExamineSprites(TArray& actors) pSprite->x = initx; pSprite->y = inity; pSprite->z = initz; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; nNetStartSprite[nNetStartSprites] = pActor; nNetStartSprites++; } diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index 30baeb86e..1c651ecbf 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -389,7 +389,7 @@ void StartRegenerate(DExhumedActor* pActor) pSprite->ang /= 5; } - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->xrepeat = 1; pSprite->yrepeat = 1; pSprite->pal = 1; diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 08394cb0b..90802b93a 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -125,7 +125,7 @@ void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, in pSprite->x = x; pSprite->y = y; pSprite->z = pSector->floorz; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->xrepeat = 200; pSprite->yrepeat = 200; pSprite->shade = -12; @@ -448,7 +448,7 @@ void AILavaDude::Tick(RunListEvent* ev) { pActor->nAction = 0; pActor->nFrame = 0; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; } break; } diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 6d21129b9..945a61f2f 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -527,7 +527,7 @@ void AILion::Tick(RunListEvent* ev) { runlist_SubRunRec(pSprite->owner); runlist_SubRunRec(pActor->nRun); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; } return; } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 837b7b4bc..1a62663a2 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -840,7 +840,7 @@ void CreatePushBlock(sectortype* pSector) pSprite->x = xAvg; pSprite->y = yAvg; pSprite->z = pSector->floorz - 256; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; int var_28 = 0; @@ -1338,7 +1338,7 @@ DExhumedActor* GrabBody() pActor = insertActor(0, 899); pSprite = &pActor->s(); nBodySprite[nCurBodyNum] = pActor; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; } else pSprite = &pActor->s(); @@ -1467,7 +1467,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) if (nVal.exbits & kHitAux2) { - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; } else { diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 79d208829..d32cf043f 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -396,7 +396,7 @@ DExhumedActor* BuildWallSprite(sectortype* pSector) pSprite->pos.vec2 = wal->center(); pSprite->z = (pSector->floorz + pSector->ceilingz) / 2; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; return pActor; } @@ -464,7 +464,7 @@ DExhumedActor* FindWallSprites(sectortype* pSector) pSprite->x = (var_24 + esi) / 2; pSprite->y = (ecx + edi) / 2; pSprite->z = pSector->floorz; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->owner = -1; pSprite->lotag = 0; pSprite->hitag = 0; @@ -1027,7 +1027,7 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p auto pSprite = &pActor->s(); SlideData[nSlide].pActor = pActor; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->x = pStartWall->x; pSprite->y = pStartWall->y; pSprite->z = pSector->floorz; @@ -1213,7 +1213,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) ChangeActorStat(pActor, 0); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->xvel = 0; pSprite->yvel = 0; pSprite->zvel = 0; @@ -1610,7 +1610,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) } spr->xrepeat = nRepeat; - spr->cstat = 0x8000; + spr->cstat = CSTAT_SPRITE_INVISIBLE; spr->xvel = 0; spr->yvel = 0; spr->zvel = 0; @@ -1854,7 +1854,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) pActor->pTarget = pActor2; pActor->nIndex2 = -1; - pSprite2->cstat = 0x8000; + pSprite2->cstat = CSTAT_SPRITE_INVISIBLE; pSprite2->x = spr->x; pSprite2->y = spr->y; pSprite2->z = spr->z; @@ -1886,7 +1886,7 @@ void ExplodeScreen(DExhumedActor* pActor) BuildSpark(pActor, 0); // shoot out blue orbs } - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; PlayFX2(StaticSound[kSound78], pActor); } @@ -2573,7 +2573,7 @@ void PostProcess() { wal.pal = 1; auto pActor = insertActor(§, 407); - pActor->s().cstat = 0x8000; + pActor->s().cstat = CSTAT_SPRITE_INVISIBLE; } } } diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 4cc19563a..e132d3274 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1423,7 +1423,7 @@ sectdone: if (var_70 == 55) { - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); // loc_1BA74: - repeated block, see in default case @@ -1812,7 +1812,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -1874,7 +1874,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -1936,7 +1936,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -1998,7 +1998,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -2060,7 +2060,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -2122,7 +2122,7 @@ sectdone: goto do_default; } - pSpriteB->cstat = 0x8000; + pSpriteB->cstat = CSTAT_SPRITE_INVISIBLE; DestroyItemAnim(pActorB); //// // loc_1BA74: - repeated block, see in default case @@ -2619,7 +2619,7 @@ sectdone: } else { - pDopple->s().cstat = 0x8000; + pDopple->s().cstat = CSTAT_SPRITE_INVISIBLE; } MoveWeapons(nPlayer); diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index b0de01dcb..661aef77c 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -998,7 +998,7 @@ void AIQueenHead::Tick(RunListEvent* ev) pSprite->xrepeat = 127 - QueenHead.nIndex2; pSprite->yrepeat = 127 - QueenHead.nIndex2; - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; // DEMO-TODO: in disassembly angle was used without masking and thus causing OOB issue. // This behavior probably would be needed emulated for demo compatibility diff --git a/source/games/exhumed/src/ra.cpp b/source/games/exhumed/src/ra.cpp index a2d14d153..1adf22e99 100644 --- a/source/games/exhumed/src/ra.cpp +++ b/source/games/exhumed/src/ra.cpp @@ -92,7 +92,7 @@ void BuildRa(int nPlayer) auto pActor = insertActor(pPlayerSprite->sector(), 203); auto pSprite = &pActor->s(); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->xvel = 0; pSprite->yvel = 0; pSprite->zvel = 0; @@ -164,7 +164,7 @@ void MoveRaToEnemy(int nPlayer) return; } - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pTarget = PlayerList[nPlayer].Actor(); } auto pTargSprite = &pTarget->s(); @@ -213,7 +213,7 @@ void AIRa::Tick(RunListEvent* ev) if (!Ra[nPlayer].nState || Ra[nPlayer].pTarget == nullptr) { - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; } else { diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index 6dcf60a3d..0c11b6eb9 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -364,7 +364,7 @@ void AIRat::Tick(RunListEvent* ev) runlist_FreeRun(pSprite->lotag - 1); runlist_SubRunRec(pActor->nRun); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; DeleteActor(pActor); } return; diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index d682f9b0e..f55503a52 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -104,7 +104,7 @@ void BuildSoul(DExhumedActor* pSet) auto pActor = insertActor(pSetSprite->sector(), 0); auto pSprite = &pActor->s(); - pSprite->cstat = 0x8000; + pSprite->cstat = CSTAT_SPRITE_INVISIBLE; pSprite->shade = -127; pSprite->xrepeat = 1; pSprite->yrepeat = 1; diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index a94c28913..3809ff00c 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -240,7 +240,7 @@ void AISpider::Tick(RunListEvent* ev) runlist_DoSubRunRec(sp->owner); runlist_FreeRun(sp->lotag - 1); runlist_SubRunRec(spp->nRun); - sp->cstat = 0x8000; + sp->cstat = CSTAT_SPRITE_INVISIBLE; DeleteActor(spp); } return;