diff options
author | Strangerke | 2012-05-28 23:51:53 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 2e9867086cf5f40742c0447fcee970c66e4f854a (patch) | |
tree | 400f4bde281181a07d8364da4b798c5bf50a36d3 | |
parent | c5e4fe1e22492892e8212502bf49c9d6d129ff2f (diff) | |
download | scummvm-rg350-2e9867086cf5f40742c0447fcee970c66e4f854a.tar.gz scummvm-rg350-2e9867086cf5f40742c0447fcee970c66e4f854a.tar.bz2 scummvm-rg350-2e9867086cf5f40742c0447fcee970c66e4f854a.zip |
LILLIPUT: Fix one more double variable, some renaming
-rw-r--r-- | engines/lilliput/lilliput.cpp | 8 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 2 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 36 | ||||
-rw-r--r-- | engines/lilliput/script.h | 3 |
4 files changed, 24 insertions, 25 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 4de8e7376e..e34dfd6d80 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -133,7 +133,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _byte1714E = 0; _byte12FCE = 0; - _byte129A0 = 0xFF; + _byte129A0 = -1; _numCharactersToDisplay = 0; _nextDisplayCharacterPos = Common::Point(0, 0); _animationTick = 0; @@ -974,7 +974,7 @@ int16 LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) { void LilliputEngine::sub15F75() { debugC(2, kDebugEngineTBC, "sub15F75()"); - _byte129A0 = 0xFF; + _byte129A0 = -1; _savedMousePosDivided = Common::Point(-1, -1); byte newX = _mousePos.x >> 2; byte newY = _mousePos.y / 3; @@ -1927,7 +1927,7 @@ void LilliputEngine::sub131B2(Common::Point pos, bool &forceReturnFl) { forceReturnFl = false; - for (byte i = 0; i < _numCharacters; i++) { + for (int8 i = 0; i < _numCharacters; i++) { if ((pos.x >= _characterDisplayX[i]) && (pos.x <= _characterDisplayX[i] + 17) && (pos.y >= _characterDisplayY[i]) && (pos.y <= _characterDisplayY[i] + 17) && (i != _word10804)) { _byte129A0 = i; _byte16F07_menuId = 4; @@ -2653,7 +2653,7 @@ void LilliputEngine::handleMenu() { _scriptHandler->runMenuScript(ScriptStream(_menuScript, _menuScriptSize)); debugC(1, kDebugScriptTBC, "========================== End of Menu Script=============================="); _savedMousePosDivided = Common::Point(-1, -1); - _byte129A0 = 0xFF; + _byte129A0 = -1; if (_byte16F07_menuId == 3) unselectInterfaceButton(); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index 7ee1a26334..49892d88c3 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -342,7 +342,7 @@ public: byte _byte16F07_menuId; byte _byte12FCE; - byte _byte129A0; + int8 _byte129A0; byte _numCharactersToDisplay; byte _byte16C9F; int16 _word10804; diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 747ab44cfd..b9286da383 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -29,7 +29,6 @@ namespace Lilliput { LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) { - _byte129A0 = 0xFF; _byte10806 = 0; _lastRandomValue = 0; _byte16F04 = 0; @@ -388,7 +387,7 @@ void LilliputScript::handleOpcodeType2(int curWord) { OC_skipNextVal(); break; case 0x30: - OC_sub17FD2(); + OC_setCurrentCharacterVar6(); break; case 0x31: OC_sub17FDD(); @@ -658,7 +657,7 @@ static const OpCode opCodes2[] = { /* 0x2d */ { "OC_sub17F4F", 1, kGetValue1, kNone, kNone, kNone, kNone }, /* 0x2e */ { "OC_scrollAwayFromCharacter", 0, kNone, kNone, kNone, kNone, kNone }, /* 0x2f */ { "OC_skipNextVal", 1, kImmediateValue, kNone, kNone, kNone, kNone }, -/* 0x30 */ { "OC_sub17FD2", 1, kGetValue1, kNone, kNone, kNone, kNone }, +/* 0x30 */ { "OC_setCurrentCharacterVar6", 1, kGetValue1, kNone, kNone, kNone, kNone }, /* 0x31 */ { "OC_sub17FDD", 1, kImmediateValue, kNone, kNone, kNone, kNone }, /* 0x32 */ { "OC_setByte10B29", 1, kGetValue1, kNone, kNone, kNone, kNone }, /* 0x33 */ { "OC_setCurrentCharacterVar2", 1, kImmediateValue, kNone, kNone, kNone, kNone }, @@ -1283,13 +1282,13 @@ int16 LilliputScript::getValue1() { switch (curWord) { case 1000: - return (int)_byte129A0; + return _vm->_byte129A0; case 1001: return _vm->_currentScriptCharacter; case 1002: return _word16F00; case 1003: - return (int)_vm->_currentCharacterVariables[6]; + return (int16)_vm->_currentCharacterVariables[6]; case 1004: return _vm->_word10804; default: @@ -1891,10 +1890,10 @@ byte LilliputScript::OC_IsPositionInViewport() { } byte LilliputScript::OC_CompareGameVariables() { - debugC(1, kDebugScriptTBC, "OC_CompareGameVariables()"); + debugC(1, kDebugScript, "OC_CompareGameVariables()"); - int var1 = getValue1(); - int var2 = getValue1(); + int16 var1 = getValue1(); + int16 var2 = getValue1(); if (var1 == var2) return 1; return 0; @@ -2028,16 +2027,16 @@ byte LilliputScript::OC_checkLastInterfaceHotspotIndex() { byte LilliputScript::OC_checkSavedMousePos() { debugC(1, kDebugScriptTBC, "OC_checkSavedMousePos()"); - if ((_byte129A0 != 0xFF) || (_vm->_savedMousePosDivided == Common::Point(-1, -1))) + if ((_vm->_byte129A0 != -1) || (_vm->_savedMousePosDivided == Common::Point(-1, -1))) return 0; return 1; } byte LilliputScript::OC_sub179AE() { - debugC(1, kDebugScriptTBC, "OC_sub179AE()"); + debugC(1, kDebugScript, "OC_sub179AE()"); - if ((_vm->_byte12FCE == 1) || (_byte129A0 == 0xFF)) + if ((_vm->_byte12FCE == 1) || (_vm->_byte129A0 == -1)) return 0; return 1; @@ -2430,12 +2429,12 @@ void LilliputScript::OC_sub17C0E() { } void LilliputScript::OC_sub17C55() { - debugC(1, kDebugScriptTBC, "OC_sub17C55()"); + debugC(1, kDebugScript, "OC_sub17C55()"); - byte var1 = ((uint16)getValue1()) & 0xFF; + int8 var1 = (getValue1() & 0xFF); int16 index = getValue1(); - int8 var3 = (_currScript->readUint16LE() & 0xFF); + int8 var3 = (_currScript->readSint16LE() & 0xFF); byte var4 = (_currScript->readUint16LE() & 0xFF); assert((index >= 0) && (index < 40)); @@ -2450,7 +2449,7 @@ void LilliputScript::OC_sub17C76() { debugC(1, kDebugScriptTBC, "OC_sub17C76()"); int var1 = getValue1(); - _vm->_rulesBuffer2_5[var1] = 0xFF; + _vm->_rulesBuffer2_5[var1] = -1; _vm->_characterPositionAltitude[var1] = 0; _characterScriptEnabled[var1] = 1; @@ -2697,10 +2696,11 @@ void LilliputScript::OC_skipNextVal() { _currScript->readUint16LE(); } -void LilliputScript::OC_sub17FD2() { - debugC(1, kDebugScriptTBC, "OC_sub17FD2()"); +void LilliputScript::OC_setCurrentCharacterVar6() { + debugC(1, kDebugScript, "OC_setCurrentCharacterVar6()"); - int var1 = getValue1(); + uint16 var1 = (uint16)getValue1(); + warning("debug - OC_setCurrentCharacterVar6 %d", var1); _vm->_currentCharacterVariables[6] = var1 & 0xFF; } diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h index b5a9916dea..ca2087682e 100644 --- a/engines/lilliput/script.h +++ b/engines/lilliput/script.h @@ -98,7 +98,6 @@ private: Common::Stack<ScriptStream *> _scriptStack; byte _byte16F05_ScriptHandler; - byte _byte129A0; byte _byte10806; byte _lastRandomValue; byte _byte16F04; @@ -242,7 +241,7 @@ private: void OC_sub17F4F(); void OC_scrollAwayFromCharacter(); void OC_skipNextVal(); - void OC_sub17FD2(); + void OC_setCurrentCharacterVar6(); void OC_sub17FDD(); void OC_setByte10B29(); void OC_setCurrentCharacterVar2(); |