diff options
author | Max Horn | 2005-03-25 01:59:47 +0000 |
---|---|---|
committer | Max Horn | 2005-03-25 01:59:47 +0000 |
commit | df129b198ce75247dccb78c84b89335fa7441243 (patch) | |
tree | b016c431c4200c222dc529b5dddbc2d000222bff | |
parent | 47ee0ce884bc6a2c53a970c013f0a6f1d0d30a21 (diff) | |
download | scummvm-rg350-df129b198ce75247dccb78c84b89335fa7441243.tar.gz scummvm-rg350-df129b198ce75247dccb78c84b89335fa7441243.tar.bz2 scummvm-rg350-df129b198ce75247dccb78c84b89335fa7441243.zip |
Some more cleanup
svn-id: r17227
-rw-r--r-- | scumm/gfx.cpp | 2 | ||||
-rw-r--r-- | scumm/gfx.h | 2 | ||||
-rw-r--r-- | scumm/scumm.cpp | 3 | ||||
-rw-r--r-- | scumm/usage_bits.cpp | 5 |
4 files changed, 7 insertions, 5 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 4c4bfe9989..af00a6b47c 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -805,8 +805,6 @@ void ScummEngine::redrawBGStrip(int start, int num) { int s = _screenStartStrip + start; - assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / (3 * sizeof(gfxUsageBits[0]))); - for (int i = 0; i < num; i++) setGfxUsageBit(s + i, USAGE_BIT_DIRTY); diff --git a/scumm/gfx.h b/scumm/gfx.h index cde49b1ab1..b5805cd0b3 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -277,6 +277,7 @@ protected: int getZPlanes(const byte *smap_ptr, const byte *zplane_list[9], bool bmapImage) const; + StripTable *generateStripTable(const byte *src, int width, int height, StripTable *table) const; void drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height, int stripnr, int numstrip); @@ -287,7 +288,6 @@ public: void drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height, int stripnr, int numstrip, byte flag); - StripTable *generateStripTable(const byte *src, int width, int height, StripTable *table) const; void decodeC64Gfx(const byte *src, byte *dst, int size) const; void decodeNESGfx(const byte *room); void decodeNESObject(const byte *ptr, int xpos, int ypos, int width, int height); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 308c627984..ecb50c0a82 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -806,8 +806,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _doEffect = false; memset(&_flashlight, 0, sizeof(_flashlight)); - _compositeBuf = 0; - _herculesBuf = 0; _bompActorPalettePtr = NULL; _shakeEnabled = false; _shakeFrame = 0; @@ -1128,6 +1126,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _compositeBuf = (byte *)malloc(_screenWidth * _screenHeight); + _herculesBuf = 0; if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { _herculesBuf = (byte *)malloc(Common::kHercW * Common::kHercH); } diff --git a/scumm/usage_bits.cpp b/scumm/usage_bits.cpp index 50a6289a03..36b560eba1 100644 --- a/scumm/usage_bits.cpp +++ b/scumm/usage_bits.cpp @@ -41,18 +41,21 @@ void ScummEngine::upgradeGfxUsageBits() { } void ScummEngine::setGfxUsageBit(int strip, int bit) { + assert(strip >= 0 && strip < ARRAYSIZE(gfxUsageBits) / 3); assert(1 <= bit && bit <= 96); bit--; gfxUsageBits[3 * strip + bit / 32] |= (1 << (bit % 32)); } void ScummEngine::clearGfxUsageBit(int strip, int bit) { + assert(strip >= 0 && strip < ARRAYSIZE(gfxUsageBits) / 3); assert(1 <= bit && bit <= 96); bit--; gfxUsageBits[3 * strip + bit / 32] &= ~(1 << (bit % 32)); } bool ScummEngine::testGfxUsageBit(int strip, int bit) { + assert(strip >= 0 && strip < ARRAYSIZE(gfxUsageBits) / 3); assert(1 <= bit && bit <= 96); bit--; return (gfxUsageBits[3 * strip + bit / 32] & (1 << (bit % 32))) != 0; @@ -63,6 +66,7 @@ bool ScummEngine::testGfxAnyUsageBits(int strip) { uint32 bitmask[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x3FFFFFFF }; int i; + assert(strip >= 0 && strip < ARRAYSIZE(gfxUsageBits) / 3); for (i = 0; i < 3; i++) if (gfxUsageBits[3 * strip + i] & bitmask[i]) return true; @@ -75,6 +79,7 @@ bool ScummEngine::testGfxOtherUsageBits(int strip, int bit) { uint32 bitmask[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; int i; + assert(strip >= 0 && strip < ARRAYSIZE(gfxUsageBits) / 3); assert(1 <= bit && bit <= 96); bit--; bitmask[bit / 32] &= ~(1 << (bit % 32)); |