From 8e0b9f7ce66ac5efd3a42514b210b585bd9ef3e4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Dec 2021 17:00:22 +0100 Subject: [PATCH] - some automatic, some manual sprite flag replacements --- source/core/maptypes.h | 4 +- source/games/blood/src/_polymost.cpp | 2 +- source/games/blood/src/animatesprite.cpp | 8 ++-- source/games/blood/src/seq.cpp | 2 +- source/games/duke/src/actors.cpp | 2 +- source/games/duke/src/actors_d.cpp | 4 +- source/games/duke/src/animatesprites_d.cpp | 48 +++++++++++----------- source/games/duke/src/animatesprites_r.cpp | 44 ++++++++++---------- source/games/duke/src/spawn_d.cpp | 8 ++-- source/games/duke/src/spawn_r.cpp | 10 ++--- source/games/sw/src/draw.cpp | 2 +- source/games/sw/src/sprite.cpp | 2 +- 12 files changed, 69 insertions(+), 67 deletions(-) diff --git a/source/core/maptypes.h b/source/core/maptypes.h index bc53bc4a4..1e0ff31c8 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -132,7 +132,6 @@ enum ESpriteBits // names mostly from SW. CSTAT_SPRITE_ALIGNMENT_SLAB = 48, // 11 = either voxel or slope sprite, depending on the situation CSTAT_SPRITE_ALIGNMENT_SLOPE = 48, CSTAT_SPRITE_ALIGNMENT_MASK = 48, - CSTAT_SPRITE_ALIGNMENT = 48, CSTAT_SPRITE_ONE_SIDE = 64, // bit 6: 1 = 1-sided sprite, 0 = normal "1" CSTAT_SPRITE_YCENTER = 128, // bit 7: 1 = Real centered centering, 0 = foot center "C" @@ -148,6 +147,9 @@ enum ESpriteBits // names mostly from SW. CSTAT_SPRITE_INVISIBLE = 32768, // bit 15: 1 = Invisible sprite, 0 = not invisible }; +typedef TFlags ESpriteFlags; +DEFINE_TFLAGS_OPERATORS(ESpriteFlags) + enum ESpriteBits2 { CSTAT2_SPRITE_MDLROTATE = 1, // Only for tsprites: rotate if this is a model or voxel. diff --git a/source/games/blood/src/_polymost.cpp b/source/games/blood/src/_polymost.cpp index ca3f09563..6a6d5c18c 100644 --- a/source/games/blood/src/_polymost.cpp +++ b/source/games/blood/src/_polymost.cpp @@ -67,7 +67,7 @@ void collectTSpritesForPortal(int x, int y, int i, int interpolation) nAnim = GetOctant(dX, dY); if (nAnim <= 4) { - pTSprite->cstat &= ~4; + pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; } else { diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 09267cc89..a9a9dfc4d 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -568,7 +568,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in { if (tilehasmodelorvoxel(pTSprite->picnum, pTSprite->pal) && !(owneractor->sx().flags&SPREXT_NOTMD)) { - pTSprite->cstat &= ~4; + pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; break; } int dX = cX - pTSprite->x; @@ -577,7 +577,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in nAnim = GetOctant(dX, dY); if (nAnim <= 4) { - pTSprite->cstat &= ~4; + pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; } else { @@ -590,7 +590,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in { if (tilehasmodelorvoxel(pTSprite->picnum, pTSprite->pal) && !(owneractor->sx().flags&SPREXT_NOTMD)) { - pTSprite->cstat &= ~4; + pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; break; } int dX = cX - pTSprite->x; @@ -944,7 +944,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in nAnim = GetOctant(dX, dY); if (nAnim <= 4) { - pTSprite->cstat &= ~4; + pTSprite->cstat &= ~CSTAT_SPRITE_XFLIP; } else { diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index e30b33eb3..50f2cca6f 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -270,7 +270,7 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame) else pSprite->cstat &= ~2; if (pFrame->transparent2) - pSprite->cstat |= 512; + pSprite->cstat |= CSTAT_SPRITE_TRANS_FLIP; else pSprite->cstat &= ~512; if (pFrame->blockable) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 51d79d699..941e614ba 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2148,7 +2148,7 @@ void frameeffect1(DDukeActor *actor) deletesprite(actor); return; } - else if (t[0] > 4) actor->s->cstat |= 512 + 2; + else if (t[0] > 4) actor->s->cstat |= CSTAT_SPRITE_TRANS_FLIP + 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 c689b3cf6..e8f46fee3 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2982,7 +2982,7 @@ void moveactors_d(void) if (t[0] > 60) { t[0] = 0; - s->cstat = CSTAT_SPRITE_YCENTER + 257 + 16; + s->cstat = CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_BLOCK_ALL | CSTAT_SPRITE_ALIGNMENT_WALL; s->extra = 1; } } @@ -2991,7 +2991,7 @@ void moveactors_d(void) int j = fi.ifhitbyweapon(act); if (j >= 0) { - s->cstat = 32 + 128; + s->cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_YCENTER; k = 1; DukeStatIterator it(STAT_ACTOR); diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 63312cae1..2978accab 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -82,7 +82,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case CHAIR3: if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0) { - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; } @@ -92,7 +92,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = s->picnum + k; break; case BLOODSPLAT1: @@ -153,7 +153,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (t->lotag == 27 && ud.recstat == 1) { t->picnum = 11 + ((PlayClock >> 3) & 1); - t->cstat |= 128; + t->cstat |= CSTAT_SPRITE_YCENTER; } else t->xrepeat = t->yrepeat = 0; @@ -270,7 +270,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case RPG: if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; } @@ -281,14 +281,14 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RPG + k; break; case RECON: if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; } @@ -302,7 +302,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; if (abs(t3) > 64) k += 7; t->picnum = RECON + k; @@ -383,7 +383,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { k = 0; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; } else { @@ -393,7 +393,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; } if (t->sector()->lotag == 2) k += 1795 - 1405; @@ -505,7 +505,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { k = 0; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; } else switch (l) { @@ -521,7 +521,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->cstat |= CSTAT_SPRITE_XFLIP; k = 7 - k; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 5: @@ -532,7 +532,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 7: k = getangle(s->x - x, s->y - y); @@ -542,11 +542,11 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 8: k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; default: k = 0; @@ -608,7 +608,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in // 512:trans reverse //1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues shadowspr->clipdist |= TSPR_FLAGS_MDHACK; - shadowspr->cstat |= 512; + shadowspr->cstat |= CSTAT_SPRITE_TRANS_FLIP; } else { @@ -657,7 +657,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in break; case FIRE: case FIRE2: - t->cstat |= 128; + t->cstat |= CSTAT_SPRITE_YCENTER; [[fallthrough]]; case BURNING: case BURNING2: @@ -674,7 +674,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { k = 0; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; } else { @@ -684,7 +684,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; } t->picnum = s->picnum + k + ((h->temp_data[0] < 4) * 5); @@ -702,9 +702,9 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->picnum = s->picnum + (h->temp_data[0] & 1); [[fallthrough]]; case SHOTGUNSHELL: - t->cstat |= 12; - if (h->temp_data[0] > 1) t->cstat &= ~4; - if (h->temp_data[0] > 2) t->cstat &= ~12; + t->cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP); + if (h->temp_data[0] > 1) t->cstat &= ~CSTAT_SPRITE_XFLIP; + if (h->temp_data[0] > 2) t->cstat &= ~(CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP); break; case FRAMEEFFECT1: if (Owner && Owner->statnum < MAXSTATUS) @@ -722,7 +722,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->pal = Owner->pal; t->shade = Owner->shade; t->ang = Owner->ang; - t->cstat = 2 | Owner->cstat; + t->cstat = CSTAT_SPRITE_TRANSLUCENT | Owner->cstat; } } break; @@ -731,7 +731,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in case RAT: if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; } @@ -741,7 +741,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = s->picnum + k; break; } diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 0338099df..52b1c3c11 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -70,7 +70,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = s->picnum + k; break; case BLOODSPLAT1: @@ -138,7 +138,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (t->lotag == 27 && ud.recstat == 1) { t->picnum = 11 + ((PlayClock >> 3) & 1); - t->cstat |= 128; + t->cstat |= CSTAT_SPRITE_YCENTER; } else t->xrepeat = t->yrepeat = 0; @@ -274,7 +274,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RRTILE7274 + k; } else @@ -292,7 +292,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = EMPTYBIKE + k; break; case EMPTYBOAT: @@ -304,7 +304,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = EMPTYBOAT + k; break; case RPG: @@ -315,7 +315,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RPG + k; break; case RPG2: @@ -327,7 +327,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RPG2 + k; break; @@ -343,7 +343,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; if (abs(t3) > 64) k += 7; t->picnum = RECON + k; @@ -427,7 +427,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { k = 0; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; } else { k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7; @@ -436,7 +436,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; } if (t->sector()->lotag == 2) k += 1795 - 1405; @@ -499,7 +499,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RRTILE7213 + k; t->xrepeat = 18; @@ -525,7 +525,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = RRTILE7184 + k; t->xrepeat = 32; @@ -636,7 +636,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in if (hw_models && md_tilehasmodel(s->picnum, s->pal) >= 0) { k = 0; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; } else switch (l) { @@ -652,7 +652,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->cstat |= CSTAT_SPRITE_XFLIP; k = 7 - k; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 5: @@ -663,7 +663,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 7: k = getangle(s->x - x, s->y - y); @@ -673,11 +673,11 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 12 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; case 8: k = (((s->ang + 3072 + 128 - a) & 2047) >> 8) & 7; - t->cstat &= ~4; + t->cstat &= ~CSTAT_SPRITE_XFLIP; break; default: bg = badguy(s); @@ -690,7 +690,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; break; } k = 0; @@ -763,7 +763,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in // 512:trans reverse //1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues shadowspr->clipdist |= TSPR_FLAGS_MDHACK; - shadowspr->cstat |= 512; + shadowspr->cstat |= CSTAT_SPRITE_TRANS_FLIP; } else { @@ -913,7 +913,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = s->picnum + k + ((h->temp_data[0] < 4) * 5); if (Owner) t->shade = Owner->shade; @@ -932,7 +932,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in [[fallthrough]]; case SHOTGUNSHELL: t->cstat |= 12; - if (h->temp_data[0] > 1) t->cstat &= ~4; + if (h->temp_data[0] > 1) t->cstat &= ~CSTAT_SPRITE_XFLIP; if (h->temp_data[0] > 2) t->cstat &= ~12; break; case FRAMEEFFECT1: @@ -967,7 +967,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in k = 8 - k; t->cstat |= CSTAT_SPRITE_XFLIP; } - else t->cstat &= ~4; + else t->cstat &= ~CSTAT_SPRITE_XFLIP; t->picnum = s->picnum + k; break; } diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index fe8a1a519..fbf13826c 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -158,7 +158,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* else sp->xrepeat = sp->yrepeat = 16 + (krand() & 15); sp->shade = -16; - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; if (spj) { if (spj->sector()->lotag == 2) @@ -623,7 +623,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* sp->xrepeat = 48; sp->yrepeat = 48; sp->shade = -127; - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; } else if (sp->picnum == SHRINKEREXPLOSION) { @@ -896,7 +896,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* ps[myconnectindex].max_actors_killed++; } - if (sp->picnum == ORGANTIC) sp->cstat |= 128; + if (sp->picnum == ORGANTIC) sp->cstat |= CSTAT_SPRITE_YCENTER; if (spj) { @@ -1032,7 +1032,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case ACCESSCARD: if (sp->picnum == ATOMICHEALTH) - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; if (ud.multimode > 1 && ud.coop != 1 && sp->picnum == ACCESSCARD) { diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 955e6e9f0..487733908 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -210,7 +210,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* else sp->xrepeat = sp->yrepeat = 16 + (krand() & 15); sp->shade = -16; - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; if (spj) { if (spj->sector()->lotag == 2) @@ -630,14 +630,14 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->xrepeat = 48; sp->yrepeat = 48; sp->shade = -127; - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; } else if (sp->picnum == EXPLOSION3) { sp->xrepeat = 128; sp->yrepeat = 128; sp->shade = -127; - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; } else if (sp->picnum == SMALLSMOKE) { @@ -907,7 +907,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sp->xrepeat = 64; sp->yrepeat = 64; sp->cstat = 2; - sp->cstat |= 512; + sp->cstat |= CSTAT_SPRITE_TRANS_FLIP; sp->x += (krand() & 2047) - 1024; sp->y += (krand() & 2047) - 1024; sp->z += (krand() & 2047) - 1024; @@ -1189,7 +1189,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case ACCESSCARD: if (sp->picnum == ATOMICHEALTH) - sp->cstat |= 128; + sp->cstat |= CSTAT_SPRITE_YCENTER; if (ud.multimode > 1 && ud.coop != 1 && sp->picnum == ACCESSCARD) { diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index b852c600d..3e5fea42f 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -338,7 +338,7 @@ void DoShadows(tspritetype* tsprite, int& spritesortcnt, tspriteptr_t tsp, int v // cstat: trans reverse // clipdist: tell mdsprite.cpp to use Z-buffer hacks to hide overdraw issues tSpr->clipdist |= TSPR_FLAGS_MDHACK; - tSpr->cstat |= 512; + tSpr->cstat |= CSTAT_SPRITE_TRANS_FLIP; } else if (!testnewrenderer) { diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index b3938a616..9052a88ef 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -4475,7 +4475,7 @@ void getzrangepoint(int x, int y, int z, sectortype* sect, { spr = &itActor->s(); cstat = spr->cstat; - if ((cstat & 49) != 33) + if ((cstat & CSTAT_SPRITE_ALIGNMENT_MASK | CSTAT_SPRITE_BLOCK) != (CSTAT_SPRITE_ALIGNMENT_FLOOR|CSTAT_SPRITE_BLOCK)) continue; // Only check blocking floor sprites daz = spr->z;