diff options
author | James Brown | 2002-05-14 19:44:41 +0000 |
---|---|---|
committer | James Brown | 2002-05-14 19:44:41 +0000 |
commit | aad1bf41048e30f016cc224cf9b8b5916f438198 (patch) | |
tree | d2c3f943119f4456912348faf699bec23ff167b3 | |
parent | caf961bfcbf207763c3d69a23d0171784088f1fb (diff) | |
download | scummvm-rg350-aad1bf41048e30f016cc224cf9b8b5916f438198.tar.gz scummvm-rg350-aad1bf41048e30f016cc224cf9b8b5916f438198.tar.bz2 scummvm-rg350-aad1bf41048e30f016cc224cf9b8b5916f438198.zip |
fix some warnings, odd code, and prevent Simon segfaulting when wrong game specified.
svn-id: r4321
-rw-r--r-- | actor.cpp | 2 | ||||
-rw-r--r-- | script_v1.cpp | 5 | ||||
-rw-r--r-- | simon/simon.cpp | 3 |
3 files changed, 8 insertions, 2 deletions
@@ -1306,7 +1306,7 @@ void Scumm::setupShadowPalette(int slot, int rfact, int gfact, int bfact, curpal = _currentPalette + from * 3; num = to - from + 1; do { - *table++ = remapPaletteColor(curpal[0] * rfact >> 8, + *table++ = remapPaletteColor((curpal[0] * rfact) >> 8, curpal[1] * gfact >> 8, curpal[2] * bfact >> 8, (uint) - 1); curpal += 3; diff --git a/script_v1.cpp b/script_v1.cpp index 70a594b6c8..ceb35f3e6a 100644 --- a/script_v1.cpp +++ b/script_v1.cpp @@ -1445,7 +1445,7 @@ void Scumm::o5_getVerbEntrypoint() void Scumm::o5_ifClassOfIs() { - int act, cls, b; + int act, cls, b = 0; bool cond = true; act = getVarOrDirectWord(0x80); @@ -1454,6 +1454,8 @@ void Scumm::o5_ifClassOfIs() cls = getVarOrDirectWord(0x80); if (cls) b = getClass(act, cls); + else + error("FIXME! Ender forgot why he added this."); if (cls & 0x80 && !b || !(cls & 0x80) && b) cond = false; @@ -1984,6 +1986,7 @@ void Scumm::o5_roomOps() _opcode = fetchScriptByte(); e = getVarOrDirectByte(0x40); setScaleItem(e - 1, b, a, d, c); + break; case 8: /* room scale? */ if (_features & GF_SMALL_HEADER) { if (!(_features & GF_OLD256)) { diff --git a/simon/simon.cpp b/simon/simon.cpp index add8f42bb5..ce05f73b66 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -427,6 +427,9 @@ byte *SimonState::readSingleOpcode(FILE *in, byte *ptr) { i = 0; string_ptr = table[*ptr++]; + if (!string_ptr) + error("Unable to locate opcode table. Perhaps you are using the wrong game target?"); + for(;;) { if (string_ptr[i] == ' ') return ptr; |