- the rest of Blood's flags, part II

This commit is contained in:
Christoph Oelckers 2021-12-18 20:07:47 +01:00
parent 13186cec6d
commit 955996dddc
4 changed files with 26 additions and 26 deletions

View file

@ -343,8 +343,8 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas
gHitInfo.clearObj(); gHitInfo.clearObj();
int x = pSprite->x; int x = pSprite->x;
int y = pSprite->y; int y = pSprite->y;
int bakCstat = pSprite->cstat; auto bakCstat = pSprite->cstat;
pSprite->cstat &= ~256; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
if (nRange) if (nRange)
{ {
hitscangoal.x = x + MulScale(nRange << 4, Cos(pSprite->ang), 30); 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 x1 = pSprite->x+MulScale(nOffset, Cos(pSprite->ang+512), 30);
int y1 = pSprite->y+MulScale(nOffset, Sin(pSprite->ang+512), 30); int y1 = pSprite->y+MulScale(nOffset, Sin(pSprite->ang+512), 30);
int z1 = pSprite->z+nZOffset; int z1 = pSprite->z+nZOffset;
int bakCstat = pSprite->cstat; auto bakCstat = pSprite->cstat;
pSprite->cstat &= ~256; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
if (nRange) if (nRange)
{ {
hitscangoal.x = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30); 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; return 3;
} }
} }
int bakCstat = pOther->cstat; auto bakCstat = pOther->cstat;
pOther->cstat &= ~256; pOther->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
gHitInfo.clearObj(); gHitInfo.clearObj();
pos = gHitInfo.hitpos; // must make a copy! pos = gHitInfo.hitpos; // must make a copy!
hitscan(pos, pOther->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); 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(); auto pSprite = &actor->s();
Collision scratch; Collision scratch;
int bakCstat = pSprite->cstat; auto bakCstat = pSprite->cstat;
int32_t nTemp1; int32_t nTemp1;
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
getzrange(pSprite->pos, pSprite->sector(), (int32_t*)ceilZ, *ceilColl, (int32_t*)floorZ, *floorColl, nDist, nMask); getzrange(pSprite->pos, pSprite->sector(), (int32_t*)ceilZ, *ceilColl, (int32_t*)floorZ, *floorColl, nDist, nMask);

View file

@ -268,27 +268,27 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame)
if (pFrame->transparent) if (pFrame->transparent)
pSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
else else
pSprite->cstat &= ~2; pSprite->cstat &= ~CSTAT_SPRITE_TRANSLUCENT;
if (pFrame->transparent2) if (pFrame->transparent2)
pSprite->cstat |= CSTAT_SPRITE_TRANS_FLIP; pSprite->cstat |= CSTAT_SPRITE_TRANS_FLIP;
else else
pSprite->cstat &= ~512; pSprite->cstat &= ~CSTAT_SPRITE_TRANS_FLIP;
if (pFrame->blockable) if (pFrame->blockable)
pSprite->cstat |= CSTAT_SPRITE_BLOCK; pSprite->cstat |= CSTAT_SPRITE_BLOCK;
else else
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK;
if (pFrame->hittable) if (pFrame->hittable)
pSprite->cstat |= 256; pSprite->cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
else else
pSprite->cstat &= ~256; pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
if (pFrame->invisible) if (pFrame->invisible)
pSprite->cstat |= CSTAT_SPRITE_INVISIBLE; pSprite->cstat |= CSTAT_SPRITE_INVISIBLE;
else else
pSprite->cstat &= (unsigned short)~32768; pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE;
if (pFrame->pushable) if (pFrame->pushable)
pSprite->cstat |= 4096; pSprite->cstat |= CSTAT_SPRITE_BLOOD_BIT1;
else else
pSprite->cstat &= ~4096; pSprite->cstat &= ~CSTAT_SPRITE_BLOOD_BIT1;
if (pFrame->smoke) if (pFrame->smoke)
pSprite->flags |= 256; pSprite->flags |= 256;
else else

View file

@ -346,7 +346,7 @@ void OperateSprite(DBloodActor* actor, EVENT event)
break; break;
case kCmdOn: case kCmdOn:
pXSprite->state = 1; pXSprite->state = 1;
pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE;
pSprite->cstat |= CSTAT_SPRITE_BLOCK; pSprite->cstat |= CSTAT_SPRITE_BLOCK;
break; break;
case kCmdToggle: case kCmdToggle:
@ -496,7 +496,7 @@ void OperateSprite(DBloodActor* actor, EVENT event)
SetSpriteState(actor, 1); SetSpriteState(actor, 1);
break; break;
default: default:
pSprite->cstat &= (unsigned short)~CSTAT_SPRITE_INVISIBLE; pSprite->cstat &= ~CSTAT_SPRITE_INVISIBLE;
actExplodeSprite(actor); actExplodeSprite(actor);
break; break;
} }
@ -875,7 +875,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
x = actor->basePoint.x; x = actor->basePoint.x;
y = actor->basePoint.y; y = actor->basePoint.y;
if (pSprite->cstat&8192) if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD)
{ {
if (vbp) if (vbp)
RotatePoint((int*)&x, (int*)&y, vbp, a4, a5); 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->x = x+vc-a4;
pSprite->y = y+v8-a5; pSprite->y = y+v8-a5;
} }
else if (pSprite->cstat&16384) else if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE)
{ {
if (vbp) if (vbp)
RotatePoint((int*)& x, (int*)& y, -vbp, a4, a4); RotatePoint((int*)& x, (int*)& y, -vbp, a4, a4);
@ -929,7 +929,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4)
continue; continue;
int top, bottom; int top, bottom;
GetSpriteExtents(pSprite, &top, &bottom); GetSpriteExtents(pSprite, &top, &bottom);
if (pSprite->cstat&8192) if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);
pSprite->z += pSector->floorz-oldZ; pSprite->z += pSector->floorz-oldZ;
@ -956,7 +956,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4)
spritetype* pSprite = &actor->s(); spritetype* pSprite = &actor->s();
if (pSprite->statnum == kStatMarker || pSprite->statnum == kStatPathMarker) if (pSprite->statnum == kStatMarker || pSprite->statnum == kStatPathMarker)
continue; continue;
if (pSprite->cstat&16384) if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);
pSprite->z += pSector->ceilingz-oldZ; pSprite->z += pSector->ceilingz-oldZ;
@ -1068,7 +1068,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2)
while (auto actor = it.Next()) while (auto actor = it.Next())
{ {
spritetype *pSprite = &actor->s(); spritetype *pSprite = &actor->s();
if (pSprite->cstat&8192) if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);
pSprite->z = actor->basePoint.z+MulScale(dz1, GetWaveValue(a2, nWave), 16); 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()) while (auto actor = it.Next())
{ {
spritetype* pSprite = &actor->s(); spritetype* pSprite = &actor->s();
if (pSprite->cstat & 16384) if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);
pSprite->z = actor->basePoint.z + MulScale(dz2, GetWaveValue(a2, nWave), 16); pSprite->z = actor->basePoint.z + MulScale(dz2, GetWaveValue(a2, nWave), 16);
@ -1837,7 +1837,7 @@ void ProcessMotion(void)
while (auto actor = it.Next()) while (auto actor = it.Next())
{ {
auto pSprite = &actor->s(); auto pSprite = &actor->s();
if (pSprite->cstat&24576) if (pSprite->cstat & CSTAT_SPRITE_MOVE_MASK)
{ {
viewBackupSpriteLoc(actor); viewBackupSpriteLoc(actor);
pSprite->z += vdi; pSprite->z += vdi;
@ -2112,7 +2112,7 @@ void trInit(TArray<DBloodActor*>& actors)
break; break;
} }
if (pXSprite->Vector) pSprite->cstat |= CSTAT_SPRITE_BLOCK_HITSCAN; 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) void FireballTrapSeqCallback(int, DBloodActor* actor)
{ {
spritetype* pSprite = &actor->s(); 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); actFireMissile(actor, 0, 0, 0, 0, (pSprite->cstat & CSTAT_SPRITE_YFLIP) ? 0x4000 : -0x4000, kMissileFireball);
else else
actFireMissile(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileFireball); actFireMissile(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileFireball);

View file

@ -1730,7 +1730,7 @@ void AltFireLifeLeech(int , PLAYER *pPlayer)
if (missile) if (missile)
{ {
auto pMissile = &missile->s(); auto pMissile = &missile->s();
pMissile->cstat |= 4096; pMissile->cstat |= CSTAT_SPRITE_BLOOD_BIT1;
XSPRITE *pXSprite = &missile->x(); XSPRITE *pXSprite = &missile->x();
pXSprite->Push = 1; pXSprite->Push = 1;
pXSprite->Proximity = 1; pXSprite->Proximity = 1;