diff options
author | Max Horn | 2003-03-04 02:43:43 +0000 |
---|---|---|
committer | Max Horn | 2003-03-04 02:43:43 +0000 |
commit | 89f6ebb77cfdb8a758bbd89a51dc0a5580e694e6 (patch) | |
tree | b7cee026ec0913fd22774b1f5ff71593f680c2c6 | |
parent | 3f8bab726e52dc7571d8522a9db3276e34175d74 (diff) | |
download | scummvm-rg350-89f6ebb77cfdb8a758bbd89a51dc0a5580e694e6.tar.gz scummvm-rg350-89f6ebb77cfdb8a758bbd89a51dc0a5580e694e6.tar.bz2 scummvm-rg350-89f6ebb77cfdb8a758bbd89a51dc0a5580e694e6.zip |
added some asserts; added a hack that helps the COMI demo
svn-id: r6684
-rw-r--r-- | scumm/charset.cpp | 3 | ||||
-rw-r--r-- | scumm/gfx.cpp | 8 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index dcf09be9e3..89e09f6f74 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -394,7 +394,7 @@ CharsetRendererNut::CharsetRendererNut(Scumm *vm) : CharsetRenderer(vm) { _current = 0; - + for (int i = 0; i < 5; i++) { char fontname[256]; sprintf(fontname, "font%d.nut", i); @@ -417,6 +417,7 @@ void CharsetRendererNut::setCurID(byte id) assert(id < 5); _curId = id; _current = _fr[id]; + assert(_current); } int CharsetRendererNut::getCharWidth(byte chr) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 8f5a5949c6..b51a714298 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -844,6 +844,7 @@ byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem) void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h, int stripnr, int numstrip, byte flag) { + assert(ptr); assert(h > 0); byte *backbuff_ptr, *bgbak_ptr, *smap_ptr; int i; @@ -2849,6 +2850,9 @@ void Scumm::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 gre void Scumm::darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { + if (_roomResource == 0) // FIXME - HACK to get COMI demo working + return; + if (startColor <= endColor) { byte *cptr, *cur; int j; @@ -2986,8 +2990,6 @@ void Scumm::setPalette(int palindex) _curPalIndex = palindex; pals = getPalettePtr(); - if (pals == NULL) - error("invalid palette %d", palindex); setPaletteFromPtr(pals); } @@ -3017,11 +3019,13 @@ byte *Scumm::getPalettePtr() byte *cptr; cptr = getResourceAddress(rtRoom, _roomResource); + assert(cptr); if (_CLUT_offs) { cptr += _CLUT_offs; } else { cptr = findPalInPals(cptr + _PALS_offs, _curPalIndex); } + assert(cptr); return cptr; } diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index a1e07c8dcc..bebc5ac8f3 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -851,6 +851,8 @@ void Scumm::initRoomSubBlocks() roomResPtr = roomptr = getResourceAddress(rtRoom, _roomResource); if (_features & GF_AFTER_V8) roomResPtr = getResourceAddress(rtRoomScripts, _roomResource); + if (!roomptr || !roomResPtr) + error("Room %d: data not found (" __FILE__ ":%d)", _roomResource, __LINE__); rmhd = (RoomHeader *)findResourceData(MKID('RMHD'), roomptr); |