diff --git a/source/blood/src/tile.cpp b/source/blood/src/tile.cpp index bb1f2c8085..3dfd6573e3 100644 --- a/source/blood/src/tile.cpp +++ b/source/blood/src/tile.cpp @@ -122,7 +122,7 @@ int tileInit(char a1, const char *a2) for (int i = 0; i < kMaxTiles; i++) { if (voxelIndex[i] >= 0 && voxelIndex[i] < kMaxVoxels) - SetBitString((char*)voxreserve, voxelIndex[i]); + bitmap_set(voxreserve, voxelIndex[i]); } artLoaded = 1; diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 7dc9c1f107..cceec90ce6 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -2677,7 +2677,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t int const nVoxel = tiletovox[pTSprite->picnum]; - if (nVoxel != -1 && ((voxrotate[nVoxel>>3]&pow2char[nVoxel&7]) != 0 || (picanm[nRootTile].extra&7) == 7)) + if (nVoxel != -1 && (bitmap_test(voxrotate, nVoxel) || (picanm[nRootTile].extra&7) == 7)) pTSprite->ang = (pTSprite->ang+((int)totalclock<<3))&2047; } diff --git a/source/build/include/build.h b/source/build/include/build.h index 16919dbb10..f531748159 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -1628,8 +1628,8 @@ extern GrowArray g_clipMapFiles; EXTERN int32_t nextvoxid; EXTERN intptr_t voxoff[MAXVOXELS][MAXVOXMIPS]; // used in KenBuild -EXTERN int8_t voxreserve[(MAXVOXELS+7)>>3]; -EXTERN int8_t voxrotate[(MAXVOXELS+7)>>3]; +EXTERN int8_t voxreserve[bitmap_size(MAXVOXELS)]; +EXTERN int8_t voxrotate[bitmap_size(MAXVOXELS)]; #ifdef USE_OPENGL // TODO: dynamically allocate this diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 08f543e469..80ecf7a47e 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -1417,7 +1417,7 @@ static int32_t defsparser(scriptfile *script) break; //voxel filename // begin downstream - while (nextvoxid < MAXVOXELS && (voxreserve[nextvoxid>>3]&(1<<(nextvoxid&7)))) + while (nextvoxid < MAXVOXELS && bitmap_test(voxreserve, nextvoxid)) nextvoxid++; // end downstream @@ -1961,7 +1961,7 @@ static int32_t defsparser(scriptfile *script) if (scriptfile_getbraces(script,&voxelend)) break; // begin downstream - while (nextvoxid < MAXVOXELS && (voxreserve[nextvoxid>>3]&(1<<(nextvoxid&7)))) + while (nextvoxid < MAXVOXELS && bitmap_test(voxreserve, nextvoxid)) nextvoxid++; // end downstream diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 8a5617539b..f58e8c08ad 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -12252,7 +12252,7 @@ void vox_undefine(int32_t const tile) voxlock[voxindex][j] = CACHE1D_FREE; voxoff[voxindex][j] = 0; } - voxrotate[voxindex>>3] &= ~pow2char[voxindex&7]; + bitmap_clear(voxrotate, voxindex); voxscale[voxindex] = 65536; voxflags[voxindex] = 0; tiletovox[tile] = -1; diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index 2e2e4dbfb5..24fa384ecc 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -243,7 +243,7 @@ static void analyzesprites() int const nRootTile = pTSprite->picnum; int const nVoxel = tiletovox[pTSprite->picnum]; - if (nVoxel != -1 && ((voxrotate[nVoxel >> 3] & pow2char[nVoxel & 7]) != 0 || (picanm[nRootTile].extra & 7) == 7)) + if (nVoxel != -1 && (bitmap_test(voxrotate, nVoxel) || (picanm[nRootTile].extra & 7) == 7)) pTSprite->ang = (pTSprite->ang + ((int)totalclock << 3)) & kAngleMask; if (pTSprite->picnum == 736) // invincibility sprite needs to always face player