From d24b8d9ec89bba1fc5093dcc45e3967b5a9661ec Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Dec 2021 15:18:50 +0100 Subject: [PATCH] - most wall flags in Blood. --- source/games/blood/src/gameutil.cpp | 16 ++++----- source/games/blood/src/mirrors.cpp | 4 +-- source/games/blood/src/seq.cpp | 52 ++++++++++++++--------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 84e2d3e48..da20d84f0 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -470,15 +470,15 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in return 0; return 2; } - if (!(pWall->cstat & 0x30)) + if (!(pWall->cstat & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY))) return 0; int nOffset; - if (pWall->cstat & 4) + if (pWall->cstat & CSTAT_WALL_ALIGN_BOTTOM) nOffset = ClipHigh(pSector->floorz, pSectorNext->floorz); else nOffset = ClipLow(pSector->ceilingz, pSectorNext->ceilingz); nOffset = (gHitInfo.hitpos.z - nOffset) >> 8; - if (pWall->cstat & 256) + if (pWall->cstat & CSTAT_WALL_YFLIP) nOffset = -nOffset; int nPicnum = pWall->overpicnum; @@ -491,7 +491,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in nOffset += int((nSizY*pWall->ypan_) / 256); int nLength = approxDist(pWall->x - pWall->point2Wall()->x, pWall->y - pWall->point2Wall()->y); int nHOffset; - if (pWall->cstat & 8) + if (pWall->cstat & CSTAT_WALL_XFLIP) nHOffset = approxDist(gHitInfo.hitpos.x - pWall->point2Wall()->x, gHitInfo.hitpos.y - pWall->point2Wall()->y); else nHOffset = approxDist(gHitInfo.hitpos.x - pWall->x, gHitInfo.hitpos.y - pWall->y); @@ -505,10 +505,10 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (pData[nPixel] == TRANSPARENT_INDEX) { - int bakCstat = pWall->cstat; - pWall->cstat &= ~64; - int bakCstat2 = pWall->nextWall()->cstat; - pWall->nextWall()->cstat &= ~64; + auto bakCstat = pWall->cstat; + pWall->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; + auto bakCstat2 = pWall->nextWall()->cstat; + pWall->nextWall()->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; gHitInfo.clearObj(); pos = gHitInfo.hitpos; hitscan(pos, pWall->nextSector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); diff --git a/source/games/blood/src/mirrors.cpp b/source/games/blood/src/mirrors.cpp index be5d72ae8..cb2b1e684 100644 --- a/source/games/blood/src/mirrors.cpp +++ b/source/games/blood/src/mirrors.cpp @@ -62,7 +62,7 @@ void InitMirrors(void) mirror[mirrorcnt].wallnum = i; mirror[mirrorcnt].type = 0; - pWalli->cstat |= 32; + pWalli->cstat |= CSTAT_WALL_1WAY; int tmp = pWalli->xw().data; int j; for (j = numwalls - 1; j >= 0; j--) @@ -99,7 +99,7 @@ void InitMirrors(void) mirror[mirrorcnt].wallnum = i; pWalli->picnum = nTile; mirror[mirrorcnt].type = 0; - pWalli->cstat |= 32; + pWalli->cstat |= CSTAT_WALL_1WAY; pWalli->portalflags = PORTAL_WALL_MIRROR; mirrorcnt++; continue; diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 5e04f62ae..80509f329 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -161,21 +161,21 @@ void UpdateWall(walltype* pWall, SEQFRAME* pFrame) if (pFrame->palette) pWall->pal = pFrame->palette; if (pFrame->transparent) - pWall->cstat |= 128; + pWall->cstat |= CSTAT_WALL_TRANSLUCENT; else - pWall->cstat &= ~128; + pWall->cstat &= ~CSTAT_WALL_TRANSLUCENT; if (pFrame->transparent2) - pWall->cstat |= 512; + pWall->cstat |= CSTAT_WALL_TRANS_FLIP; else - pWall->cstat &= ~512; + pWall->cstat &= ~CSTAT_WALL_TRANS_FLIP; if (pFrame->blockable) - pWall->cstat |= 1; + pWall->cstat |= CSTAT_WALL_BLOCK; else - pWall->cstat &= ~1; + pWall->cstat &= ~CSTAT_WALL_BLOCK; if (pFrame->hittable) - pWall->cstat |= 64; + pWall->cstat |= CSTAT_WALL_BLOCK_HITSCAN; else - pWall->cstat &= ~64; + pWall->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; } //--------------------------------------------------------------------------- @@ -193,43 +193,43 @@ void UpdateMasked(walltype* pWall, SEQFRAME* pFrame) pWall->pal = pWallNext->pal = pFrame->palette; if (pFrame->transparent) { - pWall->cstat |= 128; - pWallNext->cstat |= 128; + pWall->cstat |= CSTAT_WALL_TRANSLUCENT; + pWallNext->cstat |= CSTAT_WALL_TRANSLUCENT; } else { - pWall->cstat &= ~128; - pWallNext->cstat &= ~128; + pWall->cstat &= ~CSTAT_WALL_TRANSLUCENT; + pWallNext->cstat &= ~CSTAT_WALL_TRANSLUCENT; } if (pFrame->transparent2) { - pWall->cstat |= 512; - pWallNext->cstat |= 512; + pWall->cstat |= CSTAT_WALL_TRANS_FLIP; + pWallNext->cstat |= CSTAT_WALL_TRANS_FLIP; } else { - pWall->cstat &= ~512; - pWallNext->cstat &= ~512; + pWall->cstat &= ~CSTAT_WALL_TRANS_FLIP; + pWallNext->cstat &= ~CSTAT_WALL_TRANS_FLIP; } if (pFrame->blockable) { - pWall->cstat |= 1; - pWallNext->cstat |= 1; + pWall->cstat |= CSTAT_WALL_BLOCK; + pWallNext->cstat |= CSTAT_WALL_BLOCK; } else { - pWall->cstat &= ~1; - pWallNext->cstat &= ~1; + pWall->cstat &= ~CSTAT_WALL_BLOCK; + pWallNext->cstat &= ~CSTAT_WALL_BLOCK; } if (pFrame->hittable) { - pWall->cstat |= 64; - pWallNext->cstat |= 64; + pWall->cstat |= CSTAT_WALL_BLOCK_HITSCAN; + pWallNext->cstat |= CSTAT_WALL_BLOCK_HITSCAN; } else { - pWall->cstat &= ~64; - pWallNext->cstat &= ~64; + pWall->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; + pWallNext->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; } } @@ -715,9 +715,9 @@ void seqProcess(int nTicks) { assert(target.isWall()); auto pWall = target.wall(); - pWall->cstat &= ~(8 + 16 + 32); + pWall->cstat &= ~(CSTAT_WALL_XFLIP | CSTAT_WALL_MASKED | CSTAT_WALL_1WAY); if (pWall->twoSided()) - pWall->nextWall()->cstat &= ~(8 + 16 + 32); + pWall->nextWall()->cstat &= ~(CSTAT_WALL_XFLIP | CSTAT_WALL_MASKED | CSTAT_WALL_1WAY); } }