[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.227,1.228 bomp.cpp,2.31,2.32 charset.cpp,2.142,2.143 costume.cpp,1.181,1.182 nut_renderer.cpp,1.56,1.57 util.h,2.11,2.12
Max Horn
fingolfin at users.sourceforge.net
Sun May 15 03:41:06 CEST 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13830/scumm
Modified Files:
akos.cpp bomp.cpp charset.cpp costume.cpp nut_renderer.cpp
util.h
Log Message:
Replaced global revBitMask array with a macro
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -d -r1.227 -r1.228
--- akos.cpp 15 May 2005 10:02:13 -0000 1.227
+++ akos.cpp 15 May 2005 10:40:27 -0000 1.228
@@ -522,7 +522,7 @@
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 @@
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 @@
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);
Index: bomp.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bomp.cpp,v
retrieving revision 2.31
retrieving revision 2.32
diff -u -d -r2.31 -r2.32
--- bomp.cpp 15 May 2005 10:02:13 -0000 2.31
+++ bomp.cpp 15 May 2005 10:40:27 -0000 2.32
@@ -236,7 +236,7 @@
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 @@
*tmp_scaling++ = a;
}
if ((size & 7) != 0) {
- *(tmp_scaling - 1) |= revBitMask[size & 7];
+ *(tmp_scaling - 1) |= revBitMask(size & 7);
}
count = (size + 7) / 8;
Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.142
retrieving revision 2.143
diff -u -d -r2.142 -r2.143
--- charset.cpp 14 May 2005 14:06:35 -0000 2.142
+++ charset.cpp 15 May 2005 10:40:27 -0000 2.143
@@ -1557,7 +1557,7 @@
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;
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- costume.cpp 15 May 2005 10:02:13 -0000 1.181
+++ costume.cpp 15 May 2005 10:40:27 -0000 1.182
@@ -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 @@
};
#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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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];
}
}
Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- nut_renderer.cpp 10 Apr 2005 12:58:56 -0000 1.56
+++ nut_renderer.cpp 15 May 2005 10:40:27 -0000 1.57
@@ -378,7 +378,7 @@
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;
}
}
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/util.h,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -d -r2.11 -r2.12
--- util.h 10 May 2005 22:56:14 -0000 2.11
+++ util.h 15 May 2005 10:40:28 -0000 2.12
@@ -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 @@
};
-// 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);
More information about the Scummvm-git-logs
mailing list