diff options
author | Max Horn | 2005-05-15 10:40:28 +0000 |
---|---|---|
committer | Max Horn | 2005-05-15 10:40:28 +0000 |
commit | fb11e793876b25e47fd4f35ed0f30d3febcc84b0 (patch) | |
tree | 5a6777fe1b50b11e3f0d0f5f94b116dfb9bc845f /scumm | |
parent | e5bbfe8df9e3fb291d840a3cbcdc947185bfd3fa (diff) | |
download | scummvm-rg350-fb11e793876b25e47fd4f35ed0f30d3febcc84b0.tar.gz scummvm-rg350-fb11e793876b25e47fd4f35ed0f30d3febcc84b0.tar.bz2 scummvm-rg350-fb11e793876b25e47fd4f35ed0f30d3febcc84b0.zip |
Replaced global revBitMask array with a macro
svn-id: r18104
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 6 | ||||
-rw-r--r-- | scumm/bomp.cpp | 4 | ||||
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/costume.cpp | 15 | ||||
-rw-r--r-- | scumm/nut_renderer.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_font.cpp | 2 | ||||
-rw-r--r-- | scumm/util.h | 5 |
7 files changed, 16 insertions, 20 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 617f875041..022dc36a90 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -522,7 +522,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { height = _height; scaleytab = &v1.scaletable[v1.scaleYindex]; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf); if (len) @@ -577,7 +577,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { v1.x += v1.scaleXstep; if (v1.x < 0 || v1.x >= _out.w) return; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); v1.destptr += v1.scaleXstep; skip_column = false; } else @@ -1061,7 +1061,7 @@ void AkosRenderer::akos16Decompress(byte *dest, int32 pitch, const byte *src, in byte *tmp_buf = akos16.buffer; int maskpitch; byte *maskptr; - const byte maskbit = revBitMask[maskLeft & 7]; + const byte maskbit = revBitMask(maskLeft & 7); if (dir < 0) { dest -= (t_width - 1); diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp index 2843f9aa36..0a70d75da0 100644 --- a/scumm/bomp.cpp +++ b/scumm/bomp.cpp @@ -236,7 +236,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { src = bd.dataptr; dst = (byte *)bd.dst.pixels + bd.y * bd.dst.pitch + (bd.x + clip.left); - const byte maskbit = revBitMask[(bd.x + clip.left) & 7]; + const byte maskbit = revBitMask((bd.x + clip.left) & 7); // Mask against any additionally imposed mask if (bd.maskPtr) { @@ -377,7 +377,7 @@ int32 setupBompScale(byte *scaling, int32 size, byte scale) { *tmp_scaling++ = a; } if ((size & 7) != 0) { - *(tmp_scaling - 1) |= revBitMask[size & 7]; + *(tmp_scaling - 1) |= revBitMask(size & 7); } count = (size + 7) / 8; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 6e94ef83b7..bb96cadc7c 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1557,7 +1557,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con for (x = 0; x < width; x++) { if ((x % 8) == 0) bits = *src++; - if ((bits & revBitMask[x % 8]) && y + drawTop >= 0) { + if ((bits & revBitMask(x % 8)) && y + drawTop >= 0) { if (_dropShadow) { *(dst + 1) = _shadowColor; *(dst + s.pitch) = _shadowColor; diff --git a/scumm/costume.cpp b/scumm/costume.cpp index 03d87455a8..bb09d7e7d7 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -34,8 +34,6 @@ namespace Scumm { -const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; - #ifdef __PALM_OS__ const byte *smallCostumeScaleTable; #else @@ -330,7 +328,7 @@ static const int v1MMActorPalatte2[25] = { }; #define MASK_AT(xoff) \ - (mask && (mask[((v1.x + xoff) / 8)] & revBitMask[(v1.x + xoff) & 7])) + (mask && (mask[((v1.x + xoff) / 8)] & revBitMask((v1.x + xoff) & 7))) #define LINE(c,p) \ pcolor = (color >> c) & 3; \ if (pcolor) { \ @@ -420,7 +418,6 @@ void ClassicCostumeRenderer::proc3(Codec1 &v1) { ARM_START(CostumeProc3Type) ARM_INIT(SCUMM_PROC3) ARM_ADDP(v1) - ARM_ADDM(revBitMask) ARM_ADDM(_srcptr) ARM_ADDM(_height) ARM_ADDM(_scaleIndexX) @@ -454,7 +451,7 @@ void ClassicCostumeRenderer::proc3(Codec1 &v1) { height = _height; scaleytab = &v1.scaletable[_scaleIndexY]; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); mask = v1.mask_ptr + v1.x / 8; if (len) @@ -499,7 +496,7 @@ void ClassicCostumeRenderer::proc3(Codec1 &v1) { v1.x += v1.scaleXstep; if (v1.x < 0 || v1.x >= _out.w) return; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); v1.destptr += v1.scaleXstep; } _scaleIndexX += v1.scaleXstep; @@ -525,7 +522,7 @@ void ClassicCostumeRenderer::proc3_ami(Codec1 &v1) { height = _height; width = _width; src = _srcptr; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); y = v1.y; oldXpos = v1.x; oldScaleIndexX = _scaleIndexX; @@ -547,7 +544,7 @@ void ClassicCostumeRenderer::proc3_ami(Codec1 &v1) { if (_scaleX == 255 || v1.scaletable[_scaleIndexX] < _scaleX) { v1.x += v1.scaleXstep; dst += v1.scaleXstep; - maskbit = revBitMask[v1.x & 7]; + maskbit = revBitMask(v1.x & 7); } _scaleIndexX += v1.scaleXstep; mask = v1.mask_ptr + v1.x / 8; @@ -707,7 +704,7 @@ byte NESCostumeRenderer::drawLimb(const Actor *a, int limb) { continue; int my = _actorY + y + ty; int mx = _actorX + x + tx; - if (!doMask || !(bgTransBuf[my * _numStrips + mx / 8] & (0x80 >> (mx & 7)))) + if (!doMask || !(bgTransBuf[my * _numStrips + mx / 8] & revBitMask(mx & 7))) *((byte *)_out.pixels + my * _out.pitch + mx) = palette[c]; } } diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index 0a3e718cd2..9cbce81c4b 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -378,7 +378,7 @@ void NutRenderer::draw2byte(const Graphics::Surface &s, int c, int x, int y, byt bits = *src++; if (x + tx < 0 || x + tx >= s.w || y + ty < 0) continue; - if (bits & revBitMask[tx & 7]) { + if (bits & revBitMask(tx % 8)) { dst[tx] = color; } } diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp index 683547f212..20e809e5aa 100644 --- a/scumm/smush/smush_font.cpp +++ b/scumm/smush/smush_font.cpp @@ -138,7 +138,7 @@ int SmushFont::draw2byte(byte *buffer, int dst_width, int x, int y, int idx) { for (int i = 0; i < w; i++) { if ((i % 8) == 0) bits = *src++; - if (bits & revBitMask[i % 8]) { + if (bits & revBitMask(i % 8)) { dst[i + 1] = 0; dst[dst_width + i] = 0; dst[dst_width + i + 1] = 0; diff --git a/scumm/util.h b/scumm/util.h index 53e5187182..a687a83b41 100644 --- a/scumm/util.h +++ b/scumm/util.h @@ -27,6 +27,8 @@ namespace Scumm { +#define revBitMask(x) (0x80 >> (x)) + class BaseScummFile : public Common::File { public: virtual void setEnc(byte value) = 0; @@ -109,9 +111,6 @@ public: }; -// This is a constant lookup table of reverse bit masks -extern const byte revBitMask[8]; - /* Direction conversion functions (between old dir and new dir format) */ int newDirToOldDir(int dir); int oldDirToNewDir(int dir); |