diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 0660aed54..04ca6be7b 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -49,7 +49,7 @@ static inline void get_wallspr_points(T const * const spr, int32_t *x1, int32_t int32_t xoff = tileLeftOffset(tilenum) + spr->xoffset; int32_t k, l, dax, day; - if (spr->cstat&4) + if (spr->cstat & CSTAT_SPRITE_XFLIP) xoff = -xoff; dax = bsin(ang) * xrepeat; diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index b8aa89033..d6c279bf9 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -1181,7 +1181,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) // Parkar: Moved up to be able to use k0 for the y-flipping code k0 = (float)tspr->z+sext->position_offset.z; - f = ((globalorientation&8) && (spr->cstat&48)!=0) ? -4.f : 4.f; + f = ((globalorientation & 8) && (spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FACING) ? -4.f : 4.f; k0 -= (tspr->yoffset*tspr->yrepeat)*f; if ((globalorientation&128) && !((globalorientation&48)==32)) k0 += (float)(sizyrep<<1); diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index b4b7cb7a3..b23959e67 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -2649,7 +2649,7 @@ void polymost_drawsprite(int32_t snum) auto actor = tspr->ownerActor; - if ((tspr->cstat&48) != 48) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB) tileUpdatePicnum(&tspr->picnum, (actor->GetIndex() & 16383) + 32768); globalpicnum = tspr->picnum; @@ -2671,10 +2671,10 @@ void polymost_drawsprite(int32_t snum) int32_t method = DAMETH_MASK | DAMETH_CLAMPED; - if (tspr->cstat & 2) - method = DAMETH_CLAMPED | ((tspr->cstat & 512) ? DAMETH_TRANS2 : DAMETH_TRANS1); + if (tspr->cstat & CSTAT_SPRITE_TRANSLUCENT) + method = DAMETH_CLAMPED | ((tspr->cstat & CSTAT_SPRITE_TRANS_FLIP) ? DAMETH_TRANS2 : DAMETH_TRANS1); - SetRenderStyleFromBlend(!!(tspr->cstat & 2), tspr->blend, !!(tspr->cstat & 512)); + SetRenderStyleFromBlend(!!(tspr->cstat & CSTAT_SPRITE_TRANSLUCENT), tspr->blend, !!(tspr->cstat & CSTAT_SPRITE_TRANS_FLIP)); drawpoly_alpha = actor->sx().alpha; drawpoly_blend = tspr->blend; @@ -2692,14 +2692,14 @@ void polymost_drawsprite(int32_t snum) if (r_voxels) { - if ((tspr->cstat & 48) != 48 && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]]) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]]) { int num = tiletovox[tspr->picnum]; if (polymost_voxdraw(voxmodels[num], tspr, voxrotate[num])) return; break; // else, render as flat sprite } - if ((tspr->cstat & 48) == 48 && tspr->picnum < MAXVOXELS && voxmodels[tspr->picnum]) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_SLAB && tspr->picnum < MAXVOXELS && voxmodels[tspr->picnum]) { int num = tspr->picnum; polymost_voxdraw(voxmodels[tspr->picnum], tspr, voxrotate[num]); @@ -3299,10 +3299,10 @@ static inline int32_t sameside(const _equation* eq, const FVector2* p1, static inline int comparetsprites(int const k, int const l) { - if ((tspriteptr[k]->cstat & 48) != (tspriteptr[l]->cstat & 48)) - return (tspriteptr[k]->cstat & 48) - (tspriteptr[l]->cstat & 48); + if ((tspriteptr[k]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != (tspriteptr[l]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)) + return (tspriteptr[k]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) - (tspriteptr[l]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK); - if ((tspriteptr[k]->cstat & 48) == 16 && tspriteptr[k]->ang != tspriteptr[l]->ang) + if ((tspriteptr[k]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL && tspriteptr[k]->ang != tspriteptr[l]->ang) return tspriteptr[k]->ang - tspriteptr[l]->ang; if (tspriteptr[k]->statnum != tspriteptr[l]->statnum) @@ -3313,7 +3313,7 @@ static inline int comparetsprites(int const k, int const l) if (tspriteptr[k]->x == tspriteptr[l]->x && tspriteptr[k]->y == tspriteptr[l]->y && tspriteptr[k]->z == tspriteptr[l]->z && - (tspriteptr[k]->cstat & 48) == (tspriteptr[l]->cstat & 48) && + (tspriteptr[k]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == (tspriteptr[l]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && tspriteptr[k]->ownerActor != tspriteptr[l]->ownerActor) return tspriteptr[k]->ownerActor->GetIndex() - tspriteptr[l]->ownerActor->GetIndex(); @@ -3360,14 +3360,14 @@ static void sortsprites(int const start, int const end) auto const s = tspriteptr[k]; spritesxyz[k].z = s->z; - if ((s->cstat & 48) != 32) + if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR) { int32_t yoff = tileTopOffset(s->picnum) + s->yoffset; int32_t yspan = (tileHeight(s->picnum) * s->yrepeat << 2); spritesxyz[k].z -= (yoff * s->yrepeat) << 2; - if (!(s->cstat & 128)) + if (!(s->cstat & CSTAT_SPRITE_YCENTER)) spritesxyz[k].z -= (yspan >> 1); if (abs(spritesxyz[k].z - globalposz) < (yspan >> 1)) spritesxyz[k].z = globalposz; @@ -3399,7 +3399,7 @@ static bool spriteIsModelOrVoxel(const tspritetype* tspr) if (mdinfo.modelid >= 0 && mdinfo.framenum >= 0) return true; } - auto slabalign = (tspr->cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_SLAB; + auto slabalign = (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_SLAB; if (r_voxels && !slabalign && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]]) return true; return (slabalign && voxmodels[tspr->picnum]); } @@ -3445,7 +3445,7 @@ void renderDrawMasks(void) spritesxyz[i].x = Scale(xp + yp, xdimen << 7, yp); } - else if ((tspriteptr[i]->cstat & 48) == 0) + else if ((tspriteptr[i]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { killsprite: if (!modelp) @@ -3495,12 +3495,12 @@ void renderDrawMasks(void) for (intptr_t i = pm_spritesortcnt; i < numSprites;) { int32_t py = spritesxyz[i].y; - int32_t pcstat = tspriteptr[i]->cstat & 48; + int32_t pcstat = tspriteptr[i]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK; int32_t pangle = tspriteptr[i]->ang; int j = i + 1; if (!spriteIsModelOrVoxel(tspriteptr[i])) { - while (j < numSprites && py == spritesxyz[j].y && pcstat == (tspriteptr[j]->cstat & 48) && (pcstat != 16 || pangle == tspriteptr[j]->ang) + while (j < numSprites && py == spritesxyz[j].y && pcstat == (tspriteptr[j]->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && (pcstat != 16 || pangle == tspriteptr[j]->ang) && !spriteIsModelOrVoxel(tspriteptr[j])) { j++; @@ -3610,7 +3610,7 @@ void renderDrawMasks(void) const _equation pineq = inleft ? p1eq : p2eq; - if ((tspr->cstat & 48) == 32) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) { numpts = 4; GetFlatSpritePosition(tspr, tspr->pos.vec2, pp); @@ -3622,12 +3622,12 @@ void renderDrawMasks(void) // Consider face sprites as wall sprites with camera ang. // XXX: factor 4/5 needed? - if ((tspr->cstat & 48) != 16) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_WALL) tspriteptr[i]->ang = globalang; GetWallSpritePosition(tspr, tspr->pos.vec2, pp); - if ((tspr->cstat & 48) != 16) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_WALL) tspriteptr[i]->ang = oang; } @@ -3727,7 +3727,7 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) if ((intptr_t)m == (intptr_t)(-1)) // hackhackhack return 0; - if ((tspr->cstat & 48) == 32) + if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) return 0; if ((tspr->cstat2 & CSTAT2_SPRITE_MDLROTATE) || rotate) @@ -3742,7 +3742,7 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) k0 = m->bscale / 64.f; f = (float)tspr->xrepeat * (256.f / 320.f) * k0; - if ((tspr->ownerActor->s().cstat & 48) == 16) + if ((tspr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL) { f *= 1.25f; a0.Y -= tspr->xoffset * bcosf(tspr->ownerActor->sx().angoff, -20); @@ -3758,12 +3758,12 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) m0.Z *= f; a0.Z *= f; k0 = (float)(tspr->z + tspr->ownerActor->sx().position_offset.z); - f = ((globalorientation & 8) && (tspr->ownerActor->s().cstat & 48) != 0) ? -4.f : 4.f; + f = ((globalorientation & 8) && (tspr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; k0 -= (tspr->yoffset * tspr->yrepeat) * f * m->bscale; zoff = m->siz.z * .5f; - if (!(tspr->cstat & 128)) + if (!(tspr->cstat & CSTAT_SPRITE_YCENTER)) zoff += m->piv.Z; - else if ((tspr->cstat & 48) != 48) + else if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 48) { zoff += m->piv.Z; zoff -= m->siz.z * .5f; @@ -3807,12 +3807,12 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) if (!shadowHack) { - pc[3] = (tspr->cstat & 2) ? glblend[tspr->blend].def[!!(tspr->cstat & 512)].alpha : 1.0f; + pc[3] = (tspr->cstat & CSTAT_SPRITE_TRANSLUCENT) ? glblend[tspr->blend].def[!!(tspr->cstat & CSTAT_SPRITE_TRANS_FLIP)].alpha : 1.0f; pc[3] *= 1.0f - tspr->ownerActor->sx().alpha; - SetRenderStyleFromBlend(!!(tspr->cstat & 2), tspr->blend, !!(tspr->cstat & 512)); + SetRenderStyleFromBlend(!!(tspr->cstat & CSTAT_SPRITE_TRANSLUCENT), tspr->blend, !!(tspr->cstat & CSTAT_SPRITE_TRANS_FLIP)); - if (!(tspr->cstat & 2) || tspr->ownerActor->sx().alpha > 0.f || pc[3] < 1.0f) + if (!(tspr->cstat & CSTAT_SPRITE_TRANSLUCENT) || tspr->ownerActor->sx().alpha > 0.f || pc[3] < 1.0f) GLInterface.EnableBlend(true); // else GLInterface.EnableBlend(false); } else pc[3] = 1.f; diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 1f185cdb4..09267cc89 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -255,7 +255,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int case kViewEffectTrail: { int nAng = pTSprite->ang; - if (pTSprite->cstat & 16) + if (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { nAng = (nAng+512)&2047; } @@ -484,7 +484,7 @@ static tspritetype *viewAddEffect(tspritetype* tsprite, int& spritesortcnt, int { pNSprite->ang = (gView->pSprite->ang + 512) & 2047; // always face viewer pNSprite->cstat |= 48; - pNSprite->cstat &= ~8; + pNSprite->cstat &= ~CSTAT_SPRITE_YFLIP; pNSprite->picnum = nVoxel; if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player { @@ -645,7 +645,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in nAnim--; } - if ((pTSprite->cstat&48) != 48 && r_voxels && !(owneractor->sx().flags&SPREXT_NOTMD)) + if ((pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB && r_voxels && !(owneractor->sx().flags&SPREXT_NOTMD)) { int const nRootTile = pTSprite->picnum; int nAnimTile = pTSprite->picnum + qanimateoffs(pTSprite->picnum, 32768 + (pTSprite->ownerActor->GetIndex() & 16383)); @@ -664,7 +664,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in pTSprite->cstat2 |= CSTAT2_SPRITE_MDLROTATE; // per-sprite rotation setting. } - if ((pTSprite->cstat&48) != 48 && hw_models && !(owneractor->sx().flags&SPREXT_NOTMD)) + if ((pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB && hw_models && !(owneractor->sx().flags&SPREXT_NOTMD)) { int const nRootTile = pTSprite->picnum; int nAnimTile = pTSprite->picnum + qanimateoffs(pTSprite->picnum, 32768 + (pTSprite->ownerActor->GetIndex() & 16383)); diff --git a/source/games/blood/src/gib.cpp b/source/games/blood/src/gib.cpp index c544557f8..c58706ebc 100644 --- a/source/games/blood/src/gib.cpp +++ b/source/games/blood/src/gib.cpp @@ -281,7 +281,7 @@ void GibFX(DBloodActor* actor, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *pV GetActorExtents(actor, &top, &bottom); for (int i = 0; i < nCount; i++) { - if (!pPos && (pSprite->cstat&48) == 0) + if (!pPos && (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { int nAngle = Random(2048); gPos.x = pSprite->x+MulScale(pSprite->clipdist<<2, Cos(nAngle), 30); @@ -303,7 +303,7 @@ void GibFX(DBloodActor* actor, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *pV { pFX->xvel = Random2((pGFX->atd<<18)/120); pFX->yvel = Random2((pGFX->atd<<18)/120); - switch(pSprite->cstat&48) + switch(pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) { case 16: pFX->zvel = Random2((pGFX->at11<<18)/120); @@ -380,7 +380,7 @@ void GibThing(DBloodActor* actor, GIBTHING *pGThing, CGibPosition *pPos, CGibVel { gibactor->xvel = Random2((pGThing->atc<<18)/120); gibactor->yvel = Random2((pGThing->atc<<18)/120); - switch (pSprite->cstat&48) + switch (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) { case 16: gibactor->zvel = Random2((pGThing->at10<<18)/120); diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 76a70c3f9..cf6f2a228 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -898,7 +898,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6 int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); int floorZ = getflorzofslopeptr(pSector, pSprite->x, pSprite->y); - if (!(pSprite->cstat&48) && floorZ <= bottom) + if (!(pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && floorZ <= bottom) { if (v14) RotatePoint((int*)&pSprite->x, (int*)&pSprite->y, v14, v20, v24); @@ -936,7 +936,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4) } else if (pSprite->flags&2) pSprite->flags |= 4; - else if (oldZ <= bottom && !(pSprite->cstat&48)) + else if (oldZ <= bottom && !(pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)) { viewBackupSpriteLoc(actor); pSprite->z += pSector->floorz-oldZ; @@ -1859,7 +1859,7 @@ void ProcessMotion(void) { int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); - if (bottom >= floorZ && (pSprite->cstat&48) == 0) + if (bottom >= floorZ && (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { viewBackupSpriteLoc(actor); pSprite->z += vdi; @@ -1879,7 +1879,7 @@ void ProcessMotion(void) auto pSprite = &actor->s(); int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); - if (top <= ceilZ && (pSprite->cstat&48) == 0) + if (top <= ceilZ && (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { viewBackupSpriteLoc(actor); pSprite->z += vdi; @@ -2198,7 +2198,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor) { spritetype* pSprite = &actor->s(); if (pSprite->cstat&32) - actFireMissile(actor, 0, 0, 0, 0, (pSprite->cstat&8) ? 0x4000 : -0x4000, kMissileFireball); + 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/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index aada5b899..51d79d699 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -3372,7 +3372,7 @@ void handle_se04(DDukeActor *actor) while (auto a2 = it.Next()) { auto sj = a2->s; - if (sj->cstat & 16) + if (sj->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { if (sc->ceilingstat & CSTAT_SECTOR_SKY) sj->shade = sc->ceilingshade; @@ -3699,7 +3699,7 @@ void handle_se12(DDukeActor *actor, int planeonly) DukeSectIterator it(sc); while (auto a2 = it.Next()) { - if (a2->s->cstat & 16) + if (a2->s->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { if (sc->ceilingstat & CSTAT_SECTOR_SKY) a2->s->shade = sc->ceilingshade; @@ -3739,7 +3739,7 @@ void handle_se12(DDukeActor *actor, int planeonly) DukeSectIterator it(actor->sector()); while (auto a2 = it.Next()) { - if (a2->s->cstat & 16) + if (a2->s->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { if (sc->ceilingstat & CSTAT_SECTOR_SKY) a2->s->shade = sc->ceilingshade; @@ -4933,7 +4933,7 @@ void getglobalz(DDukeActor* actor) getzrange({ s->x, s->y, s->z - (FOURSLEIGHT) }, s->sector(), &actor->ceilingz, hz, &actor->floorz, lz, zr, CLIPMASK0); s->cstat2 = cc; - if( lz.type == kHitSprite && (lz.actor()->s->cstat&48) == 0 ) + if( lz.type == kHitSprite && (lz.actor()->s->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0 ) { if( badguy(lz.actor()) && lz.actor()->s->pal != 1) { diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 1e9608c29..c689b3cf6 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2976,7 +2976,7 @@ void moveactors_d(void) case DUCK: case TARGET: - if (s->cstat & 32) + if (s->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) { t[0]++; if (t[0] > 60) @@ -3000,8 +3000,8 @@ void moveactors_d(void) if (act2->s->lotag == s->lotag && act2->s->picnum == s->picnum) { - if ((act2->s->hitag && !(act2->s->cstat & 32)) || - (!act2->s->hitag && (act2->s->cstat & 32)) + if ((act2->s->hitag && !(act2->s->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) || + (!act2->s->hitag && (act2->s->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) ) { k = 0; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 240bd1a63..63312cae1 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -129,7 +129,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case GREENSLIME + 7: break; default: - if (((t->cstat & 16)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == 10) + if (((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER) continue; } diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 14eb2ffd8..0338099df 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -107,7 +107,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case NEON6: continue; default: - if (((t->cstat & 16)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == 10) + if (((t->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) || (badguypic(t->picnum) && t->extra > 0) || t->statnum == STAT_PLAYER) { if (s->sector()->shadedsector == 1 && s->statnum != 1) { @@ -627,7 +627,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in break; } - if (gs.actorinfo[s->picnum].scriptaddress && (t->cstat & 48) != 48) + if (gs.actorinfo[s->picnum].scriptaddress && (t->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB) { if (t4) { @@ -723,7 +723,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->shade = -127; if (s->statnum == 13 || badguy(s) || (s->picnum == APLAYER && h->GetOwner())) - if ((s->cstat & 48) == 0 && t->statnum != 99) + if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0 && t->statnum != 99) if (s->picnum != EXPLOSION2 && s->picnum != DOMELITE && s->picnum != TORNADO && s->picnum != EXPLOSION3 && (s->picnum != SBMOVE || isRRRA())) { if (h->dispicnum < 0) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index e4431da46..4c56b90e5 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 & CSTAT_SPRITE_BLOCK_ALL) != 0) switch (spr->cstat & 48) + if ((spr->cstat & CSTAT_SPRITE_BLOCK_ALL) != 0) switch (spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) { case 0: //break; diff --git a/source/games/duke/src/premap_d.cpp b/source/games/duke/src/premap_d.cpp index 7a860209d..6451077d5 100644 --- a/source/games/duke/src/premap_d.cpp +++ b/source/games/duke/src/premap_d.cpp @@ -288,7 +288,7 @@ void prelevel_d(int g, TArray& actors) auto si = ac->s; LoadActor(ac, -1, -1); - if (si->lotag == -1 && (si->cstat & 16)) + if (si->lotag == -1 && (si->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { ps[0].exitx = si->x; ps[0].exity = si->y; diff --git a/source/games/duke/src/premap_r.cpp b/source/games/duke/src/premap_r.cpp index c99c17dd7..4c9aa069d 100644 --- a/source/games/duke/src/premap_r.cpp +++ b/source/games/duke/src/premap_r.cpp @@ -536,7 +536,7 @@ void prelevel_r(int g, TArray& actors) auto si = ac->s; LoadActor(ac, -1, -1); - if (si->lotag == -1 && (si->cstat & 16)) + if (si->lotag == -1 && (si->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { ps[0].exitx = si->x; ps[0].exity = si->y; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 49f07a9c7..49ff8bcb0 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1380,7 +1380,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) s = targ->s; [[fallthrough]]; default: - if ((s->cstat & 16) && s->hitag == 0 && s->lotag == 0 && s->statnum == 0) + if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && s->hitag == 0 && s->lotag == 0 && s->statnum == 0) break; if ((pspr->picnum == FREEZEBLAST || proj->GetOwner() != targ) && s->statnum != 4) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 42b4bea76..47eaa96bd 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2359,7 +2359,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) s = targ->s; [[fallthrough]]; default: - if ((s->cstat & 16) && s->hitag == 0 && s->lotag == 0 && s->statnum == 0) + if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && s->hitag == 0 && s->lotag == 0 && s->statnum == 0) break; if ((pspr->picnum == SHRINKSPARK || pspr->picnum == FREEZEBLAST || proj->GetOwner() != targ) && s->statnum != 4) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 99cb509a9..730cad481 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -165,11 +165,11 @@ bool initspriteforspawn(DDukeActor* act, const std::initializer_list &exclu t[0] = t[1] = t[2] = t[3] = t[4] = t[5] = 0; act->temp_actor = nullptr; - if (sp->cstat & 48) - if (!isIn(sp->picnum, excludes) && (sp->cstat & 48)) + if (sp->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) + if (!isIn(sp->picnum, excludes) && (sp->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)) { if (sp->shade == 127) return false; - if (wallswitchcheck(act) && (sp->cstat & 16)) + if (wallswitchcheck(act) && (sp->cstat & CSTAT_SPRITE_ALIGNMENT_WALL)) { if (sp->picnum != TILE_ACCESSSWITCH && sp->picnum != TILE_ACCESSSWITCH2 && sp->pal) {