From 8d7d61f1f67a50f70e14e85b8c05a2aa4a4a6cb9 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 21 Apr 2007 20:13:15 +0000 Subject: Some more small fixes. Gob3 is completable now :) svn-id: r26556 --- engines/gob/inter_v1.cpp | 48 ++---------------------------------------------- engines/gob/inter_v2.cpp | 2 +- engines/gob/mult_v2.cpp | 11 +++++++++++ engines/gob/parse.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 51 deletions(-) diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 5ac605e301..822c96d749 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1663,52 +1663,8 @@ bool Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { break; case 2: - key = 0; - - if (_vm->_global->_pressedKeys[0x48]) - key |= 1; - - if (_vm->_global->_pressedKeys[0x50]) - key |= 2; - - if (_vm->_global->_pressedKeys[0x4D]) - key |= 4; - - if (_vm->_global->_pressedKeys[0x4B]) - key |= 8; - - if (_vm->_global->_pressedKeys[0x1C]) - key |= 0x10; - - if (_vm->_global->_pressedKeys[0x39]) - key |= 0x20; - - if (_vm->_global->_pressedKeys[1]) - key |= 0x40; - - if (_vm->_global->_pressedKeys[0x1D]) - key |= 0x80; - - if (_vm->_global->_pressedKeys[0x2A]) - key |= 0x100; - - if (_vm->_global->_pressedKeys[0x36]) - key |= 0x200; - - if (_vm->_global->_pressedKeys[0x38]) - key |= 0x400; - - if (_vm->_global->_pressedKeys[0x3B]) - key |= 0x800; - - if (_vm->_global->_pressedKeys[0x3C]) - key |= 0x1000; - - if (_vm->_global->_pressedKeys[0x3D]) - key |= 0x2000; - - if (_vm->_global->_pressedKeys[0x3E]) - key |= 0x4000; + _vm->_util->processInput(true); + key = _vm->_util->checkKey(); WRITE_VAR(0, key); _vm->_util->clearKeyBuf(); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 5a66300848..78ea9cab7a 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -975,7 +975,7 @@ void Inter_v2::o2_loadMultObject() { _vm->_global->_inter_execPtr++; } - if (_vm->_goblin->_gobsCount < 0) + if (_vm->_goblin->_gobsCount <= objIndex) return; Mult::Mult_Object &obj = _vm->_mult->_objects[objIndex]; diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp index d973ea4c22..8b158ab314 100644 --- a/engines/gob/mult_v2.cpp +++ b/engines/gob/mult_v2.cpp @@ -227,6 +227,13 @@ void Mult_v2::loadMult(int16 resId) { case 3: _vm->_global->_inter_execPtr += 4; break; + + case -1: + break; + + default: + warning("Mult_v2::loadMult(): Unknown sound key command (%d)", + _multData->sndKeys[i].cmd); } } @@ -1185,6 +1192,8 @@ void Mult_v2::advanceObjects(int16 index) { } void Mult_v2::advanceAllObjects() { + Mult_Data *multData = _multData; + for (int i = 0; i < 8; i++) { if (_multDatas[i]) { _multData = _multDatas[i]; @@ -1192,6 +1201,8 @@ void Mult_v2::advanceAllObjects() { advanceObjects(j); } } + + _multData = multData; } } // End of namespace Gob diff --git a/engines/gob/parse.cpp b/engines/gob/parse.cpp index 93af23c82b..a603fd164e 100644 --- a/engines/gob/parse.cpp +++ b/engines/gob/parse.cpp @@ -196,17 +196,17 @@ void Parse::printExpr_internal(char stopToken) { debugN(5, "var8_%d", _vm->_inter->load16()); break; - case 19: // uint32 immediate + case 19: // int32/uint32 immediate debugN(5, "%d", READ_LE_UINT32(_vm->_global->_inter_execPtr)); _vm->_global->_inter_execPtr += 4; break; - case 20: // uint16 immediate + case 20: // int16 immediate debugN(5, "%d", _vm->_inter->load16()); break; - case 21: // uint8 immediate - debugN(5, "%d", *_vm->_global->_inter_execPtr++); + case 21: // int8 immediate + debugN(5, "%d", (int8) *_vm->_global->_inter_execPtr++); break; case 22: // string immediate -- cgit v1.2.3