diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index c48245dc9..b9e3ed827 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -343,8 +343,8 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas gHitInfo.clearObj(); int x = pSprite->x; int y = pSprite->y; - int bakCstat = pSprite->cstat; - pSprite->cstat &= ~256; + auto bakCstat = pSprite->cstat; + pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; if (nRange) { hitscangoal.x = x + MulScale(nRange << 4, Cos(pSprite->ang), 30); @@ -388,8 +388,8 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in int x1 = pSprite->x+MulScale(nOffset, Cos(pSprite->ang+512), 30); int y1 = pSprite->y+MulScale(nOffset, Sin(pSprite->ang+512), 30); int z1 = pSprite->z+nZOffset; - int bakCstat = pSprite->cstat; - pSprite->cstat &= ~256; + auto bakCstat = pSprite->cstat; + pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; if (nRange) { hitscangoal.x = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30); @@ -445,8 +445,8 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in return 3; } } - int bakCstat = pOther->cstat; - pOther->cstat &= ~256; + auto bakCstat = pOther->cstat; + pOther->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; gHitInfo.clearObj(); pos = gHitInfo.hitpos; // must make a copy! hitscan(pos, pOther->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); @@ -560,7 +560,7 @@ void GetZRange(DBloodActor *actor, int *ceilZ, Collision *ceilColl, int *floorZ, auto pSprite = &actor->s(); Collision scratch; - int bakCstat = pSprite->cstat; + auto bakCstat = pSprite->cstat; int32_t nTemp1; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL; getzrange(pSprite->pos, pSprite->sector(), (int32_t*)ceilZ, *ceilColl, (int32_t*)floorZ, *floorColl, nDist, nMask); diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 484c095db..3e16f0691 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -268,27 +268,27 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) if (pFrame->transparent) pSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; else - pSprite->cstat &= ~2; + pSprite->cstat &= ~CSTAT_SPRITE_TRANSLUCENT; if (pFrame->transparent2) pSprite->cstat |= CSTAT_SPRITE_TRANS_FLIP; else - pSprite->cstat &= ~512; + pSprite->cstat &= ~CSTAT_SPRITE_TRANS_FLIP; if (pFrame->blockable) pSprite->cstat |= CSTAT_SPRITE_BLOCK; else pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; if (pFrame->hittable) - pSprite->cstat |= 256; + pSprite->cstat |= CSTAT_SPRITE_BLOCK_HITSCAN; else - pSprite->cstat &= ~256; + pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; if (pFrame->invisible) pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; else - pSprite->cstat &= (unsigned short)~32768; + pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE; if (pFrame->pushable) - pSprite->cstat |= 4096; + pSprite->cstat |= CSTAT_SPRITE_BLOOD_BIT1; else - pSprite->cstat &= ~4096; + pSprite->cstat &= ~CSTAT_SPRITE_BLOOD_BIT1; if (pFrame->smoke) pSprite->flags |= 256; else diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index cf6f2a228..25fdbb26d 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -346,7 +346,7 @@ void OperateSprite(DBloodActor* actor, EVENT event) break; case kCmdOn: pXSprite->state = 1; - pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE; + pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE; pSprite->cstat |= CSTAT_SPRITE_BLOCK; break; case kCmdToggle: @@ -496,7 +496,7 @@ void OperateSprite(DBloodActor* actor, EVENT event) SetSpriteState(actor, 1); break; default: - pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE; + pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE; actExplodeSprite(actor); break; } @@ -875,7 +875,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 x = actor->basePoint.x; y = actor->basePoint.y; - if (pSprite->cstat&8192) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD) { if (vbp) RotatePoint((int*)&x, (int*)&y, vbp, a4, a5); @@ -884,7 +884,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 pSprite->x = x+vc-a4; pSprite->y = y+v8-a5; } - else if (pSprite->cstat&16384) + else if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE) { if (vbp) RotatePoint((int*)& x, (int*)& y, -vbp, a4, a4); @@ -929,7 +929,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4) continue; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); - if (pSprite->cstat&8192) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD) { viewBackupSpriteLoc(actor); pSprite->z += pSector->floorz-oldZ; @@ -956,7 +956,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4) spritetype* pSprite = &actor->s(); if (pSprite->statnum == kStatMarker || pSprite->statnum == kStatPathMarker) continue; - if (pSprite->cstat&16384) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE) { viewBackupSpriteLoc(actor); pSprite->z += pSector->ceilingz-oldZ; @@ -1068,7 +1068,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2) while (auto actor = it.Next()) { spritetype *pSprite = &actor->s(); - if (pSprite->cstat&8192) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD) { viewBackupSpriteLoc(actor); pSprite->z = actor->basePoint.z+MulScale(dz1, GetWaveValue(a2, nWave), 16); @@ -1082,7 +1082,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2) while (auto actor = it.Next()) { spritetype* pSprite = &actor->s(); - if (pSprite->cstat & 16384) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE) { viewBackupSpriteLoc(actor); pSprite->z = actor->basePoint.z + MulScale(dz2, GetWaveValue(a2, nWave), 16); @@ -1837,7 +1837,7 @@ void ProcessMotion(void) while (auto actor = it.Next()) { auto pSprite = &actor->s(); - if (pSprite->cstat&24576) + if (pSprite->cstat & CSTAT_SPRITE_MOVE_MASK) { viewBackupSpriteLoc(actor); pSprite->z += vdi; @@ -2112,7 +2112,7 @@ void trInit(TArray& actors) break; } if (pXSprite->Vector) pSprite->cstat |= CSTAT_SPRITE_BLOCK_HITSCAN; - if (pXSprite->Push) pSprite->cstat |= 4096; + if (pXSprite->Push) pSprite->cstat |= CSTAT_SPRITE_BLOOD_BIT1; } } @@ -2197,7 +2197,7 @@ void ActivateGenerator(DBloodActor* actor) void FireballTrapSeqCallback(int, DBloodActor* actor) { spritetype* pSprite = &actor->s(); - if (pSprite->cstat&32) + if (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) actFireMissile(actor, 0, 0, 0, 0, (pSprite->cstat & CSTAT_SPRITE_YFLIP) ? 0x4000 : -0x4000, kMissileFireball); else actFireMissile(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileFireball); diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 6f1f66e02..5a3484072 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1730,7 +1730,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer) if (missile) { auto pMissile = &missile->s(); - pMissile->cstat |= 4096; + pMissile->cstat |= CSTAT_SPRITE_BLOOD_BIT1; XSPRITE *pXSprite = &missile->x(); pXSprite->Push = 1; pXSprite->Proximity = 1;