diff options
author | Strangerke | 2012-05-30 08:19:53 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 3ea95583a2cd2e8b6f8bb501a97ce9167e514776 (patch) | |
tree | f94368c9e4499657945c90bb6bf6428b7e8ab045 | |
parent | bcfbf5df47664f8caae8a1fbfcb8ffc831a2d8e0 (diff) | |
download | scummvm-rg350-3ea95583a2cd2e8b6f8bb501a97ce9167e514776.tar.gz scummvm-rg350-3ea95583a2cd2e8b6f8bb501a97ce9167e514776.tar.bz2 scummvm-rg350-3ea95583a2cd2e8b6f8bb501a97ce9167e514776.zip |
LILLIPUT: Fix bug in sub167EF
-rw-r--r-- | engines/lilliput/lilliput.cpp | 57 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 8 | ||||
-rw-r--r-- | engines/lilliput/sound.cpp | 4 | ||||
-rw-r--r-- | engines/lilliput/sound.h | 2 |
4 files changed, 40 insertions, 31 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 55de37ec58..3af5fdde8f 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -1450,10 +1450,10 @@ byte LilliputEngine::sub16799(int index, Common::Point param1) { } void LilliputEngine::sub167EF(int index) { - debugC(2, kDebugEngineTBC, "sub167EF(%d)", index); + debugC(2, kDebugEngine, "sub167EF(%d)", index); - int word167EB = findHotspot(Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index])); - int word167ED = findHotspot(Common::Point(_array10999PosX[index], _array109C1PosY[index])); + int16 word167EB = findHotspot(Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index])); + int16 word167ED = findHotspot(Common::Point(_array10999PosX[index], _array109C1PosY[index])); if (word167EB == word167ED) { _array109E9PosX[index] = _array10999PosX[index]; @@ -1484,13 +1484,15 @@ void LilliputEngine::sub167EF(int index) { int var4l = (_rectXMinMax[word167EB] & 0xFF); if (var4h != var4l) { - if (_array109E9PosX[index] == var4h) { - --_array109E9PosX[index]; + if (_rulesBuffer12Pos4[word167EB].x == var4h) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x - 1; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y; return; } - if (_array109E9PosX[index] == var4l) { - ++_array109E9PosX[index]; + if (_rulesBuffer12Pos4[word167EB].x == var4l) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x + 1; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y; return; } @@ -1498,28 +1500,35 @@ void LilliputEngine::sub167EF(int index) { var4l = (_rectYMinMax[word167EB] & 0xFF); if (var4h != var4l) { - if (_array10A11PosY[index] == var4h) - --_array10A11PosY[index]; - else - ++_array10A11PosY[index]; + if (_rulesBuffer12Pos4[word167EB].y == var4h) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y - 1; + } else { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y + 1; + } return; } } // var4h == var4l - int mapIndex = (_array10A11PosY[index] * 64 + _array109E9PosX[index]) * 4; + int mapIndex = (_rulesBuffer12Pos4[word167EB].y * 64 + _rulesBuffer12Pos4[word167EB].x) * 4; assert(mapIndex < 16384); int tmpVal = _bufferIsoMap[mapIndex + 3]; - if ((tmpVal & 8) != 0) - ++_array109E9PosX[index]; - else if ((tmpVal & 4) != 0) - --_array10A11PosY[index]; - else if ((tmpVal & 2) != 0) - ++_array10A11PosY[index]; - else - --_array109E9PosX[index]; - + if ((tmpVal & 8) != 0) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x + 1; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y; + } else if ((tmpVal & 4) != 0) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y - 1; + } else if ((tmpVal & 2) != 0) { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y + 1; + } else { + _array109E9PosX[index] = _rulesBuffer12Pos4[word167EB].x - 1; + _array10A11PosY[index] = _rulesBuffer12Pos4[word167EB].y; + } return; } @@ -1966,7 +1975,7 @@ bool LilliputEngine::isMouseOverHotspot(Common::Point mousePos, Common::Point ho } void LilliputEngine::sub1305C(byte index, byte button) { - debugC(2, kDebugEngineTBC, "sub1305C(%d, %d)", index, button); + debugC(2, kDebugEngine, "sub1305C(%d, %d)", index, button); if (_scriptHandler->_interfaceHotspotStatus[index] < kHotspotEnabled) return; @@ -2717,9 +2726,9 @@ void LilliputEngine::handleGameScripts() { //debugC(1, kDebugEngineTBC, "before char %d, pos %d %d, var0 %d, var1 %d, var2 %d var16 %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), *getCharacterVariablesPtr(i * 32 + 1), *getCharacterVariablesPtr(i * 32 + 2), *getCharacterVariablesPtr(i * 32 + 22), _scriptHandler->_characterScriptEnabled[i]); assert(tmpVal < _gameScriptIndexSize); - debugC(1, kDebugEngineTBC, "================= Game Script %d for character %d ==================", tmpVal, index); + debugC(1, kDebugEngine, "================= Game Script %d for character %d ==================", tmpVal, index); _scriptHandler->runScript(ScriptStream(&_arrayGameScripts[_arrayGameScriptIndex[tmpVal]], _arrayGameScriptIndex[tmpVal + 1] - _arrayGameScriptIndex[tmpVal])); - debugC(1, kDebugEngineTBC, "============= End Game Script %d for character %d ==================", tmpVal, index); + debugC(1, kDebugEngine, "============= End Game Script %d for character %d ==================", tmpVal, index); //warning("dump char stat"); //debugC(1, kDebugEngineTBC, "after char %d, pos %d %d, var0 %d, var1 %d, var2 %d var16 %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), *getCharacterVariablesPtr(i * 32 + 1), *getCharacterVariablesPtr(i * 32 + 2), *getCharacterVariablesPtr(i * 32 + 22), _scriptHandler->_characterScriptEnabled[i]); diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index b34acdec84..967486e07a 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -3285,17 +3285,17 @@ void LilliputScript::OC_sub1870A_snd() { void LilliputScript::OC_sub18725_snd() { debugC(1, kDebugScript, "OC_sub18725_snd()"); - int var4 = getValue1() | 0xFF00; + Common::Point var4 = Common::Point(-1, getValue1() & 0xFF); - _vm->_soundHandler->contentFct3(); + _vm->_soundHandler->contentFct3(var4); } void LilliputScript::OC_sub18733_snd() { - debugC(1, kDebugScriptTBC, "OC_sub18733_snd()"); + debugC(1, kDebugScript, "OC_sub18733_snd()"); Common::Point var4 = getPosFromScript(); - _vm->_soundHandler->contentFct3(); + _vm->_soundHandler->contentFct3(var4); } void LilliputScript::OC_sub1873F_snd() { diff --git a/engines/lilliput/sound.cpp b/engines/lilliput/sound.cpp index c96c05f407..d94cf1eb76 100644 --- a/engines/lilliput/sound.cpp +++ b/engines/lilliput/sound.cpp @@ -46,8 +46,8 @@ void LilliputSound::contentFct2(int var1, Common::Point var2, Common::Point var3 debugC(1, kDebugSound, "contentFct2(%d, %d - %d, %d - %d, %d - %d)", var1, var2.x, var2.y, var3.x, var3.y, var4.x, var4.y); } -void LilliputSound::contentFct3() { - debugC(1, kDebugSound, "contentFct3()"); +void LilliputSound::contentFct3(Common::Point pos) { + debugC(1, kDebugSound, "contentFct3(%d - %d)", pos.x, pos.y); } void LilliputSound::contentFct4() { diff --git a/engines/lilliput/sound.h b/engines/lilliput/sound.h index 756dad1bd8..6d5bf6f556 100644 --- a/engines/lilliput/sound.h +++ b/engines/lilliput/sound.h @@ -35,7 +35,7 @@ public: void contentFct0(); void contentFct1(); void contentFct2(int var1, Common::Point var2, Common::Point var3, Common::Point var4); - void contentFct3(); + void contentFct3(Common::Point pos); void contentFct4(); void contentFct5(); void contentFct6(); |