From 10edaf6bc4d8833007dab0008440c31970b8267a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Jun 2012 01:35:57 +0200 Subject: LILLIPUT: Some renaming, start fixing the map display --- engines/lilliput/lilliput.cpp | 12 ++++++------ engines/lilliput/lilliput.h | 4 ++-- engines/lilliput/script.cpp | 16 ++++++++-------- engines/lilliput/script.h | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'engines/lilliput') diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 5047dc038e..01716a3de5 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -662,7 +662,7 @@ void LilliputEngine::restoreMapPoints() { byte *buf = (byte *)_mainSurface->getPixels(); for (byte index = 0; index < _numCharacters; index++) { - buf[_word15E5D[index]] = _byte15E35[index]; + buf[_mapSavedPixelIndex[index]] = _mapSavedPixel[index]; } displayMousePointer(); @@ -677,12 +677,12 @@ void LilliputEngine::displayCharactersOnMap() { byte *buf = (byte *)_mainSurface->getPixels(); for (int index = _numCharacters - 1; index >= 0; index--) { if (((_rulesBuffer2_11[index] & 2) == 0) && (_scriptHandler->_array1614BPosY[index] != -1)) { - int y = (3 * _scriptHandler->_array1614BPosY[index]) + 1; - int x = (_scriptHandler->_array16123PosX[index] * 4) + 1; + // FIXME: This is still wrong, but less. The values in both arrays should be verified now! + int pixIndex = 320 + ((15 * _scriptHandler->_array1614BPosY[index]) / 4) + (_scriptHandler->_array16123PosX[index] * 4) + 1; - _word15E5D[index] = y * 320 + x; - _byte15E35[index] = buf[y * 320 + x]; - buf[y * 320 + x] = _scriptHandler->_array128EF[index]; + _mapSavedPixelIndex[index] = pixIndex; + _mapSavedPixel[index] = buf[pixIndex]; + buf[pixIndex] = _scriptHandler->_characterMapPixelColor[index]; } } displayMousePointer(); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index 190d8bc979..c58c37fd3c 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -150,8 +150,8 @@ public: int _word1289D; Common::Point _word16937Pos; - short _word15E5D[40]; - byte _byte15E35[40]; + int16 _mapSavedPixelIndex[40]; + byte _mapSavedPixel[40]; int16 _array11D49[40]; int16 _array1289F[40]; int16 _array12861[30]; diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index f82e073949..a55e24a205 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -61,7 +61,7 @@ LilliputScript::LilliputScript(LilliputEngine *vm) : _vm(vm), _currScript(NULL) for (int i = 0; i < 40; i++) { _characterScriptEnabled[i] = 1; - _array128EF[i] = 15; + _characterMapPixelColor[i] = 15; _array10AB1[i] = 0; _array12811[i] = 16; _array12839[i] = -1; @@ -481,7 +481,7 @@ void LilliputScript::handleOpcodeType2(int curWord) { OC_disableInterfaceHotspot(); break; case 0x4F: - OC_loadFile_AERIAL_GFX(); + OC_loadFileAerial(); break; case 0x50: OC_startSpeechIfSoundOff(); @@ -689,7 +689,7 @@ static const OpCode opCodes2[] = { /* 0x4c */ { "OC_setByte14837", 0, kNone, kNone, kNone, kNone, kNone }, /* 0x4d */ { "OC_waitForEvent", 0, kNone, kNone, kNone, kNone, kNone }, /* 0x4e */ { "OC_disableInterfaceHotspot", 2, kImmediateValue, kImmediateValue, kNone, kNone, kNone }, // TODO -/* 0x4f */ { "OC_loadFile_AERIAL_GFX", 1, kNone, kNone, kNone, kNone, kNone }, +/* 0x4f */ { "OC_loadFileAerial", 1, kNone, kNone, kNone, kNone, kNone }, /* 0x50 */ { "OC_startSpeechIfSoundOff", 1, kImmediateValue, kNone, kNone, kNone, kNone }, /* 0x51 */ { "OC_sub1844A", 2, kGetValue1, kImmediateValue, kNone, kNone, kNone }, /* 0x52 */ { "OC_displayNumericCharacterVariable", 5, kGetValue1, kImmediateValue, kImmediateValue, kImmediateValue, kImmediateValue }, @@ -2146,7 +2146,7 @@ void LilliputScript::OC_startSpeech() { } void LilliputScript::getSpeechVariant(int speechIndex, int speechVariant) { - debugC(2, kDebugScriptTBC, "getSpeechVariant(%d, %d)", speechIndex, speechVariant); + debugC(2, kDebugScript, "getSpeechVariant(%d, %d)", speechIndex, speechVariant); // The packed strings are stored by variants, enclosed by imbricated brackets. // So the different possibilities are: @@ -2199,7 +2199,7 @@ void LilliputScript::OC_getComputedVariantSpeech() { } void LilliputScript::OC_getRotatingVariantSpeech() { - debugC(1, kDebugScriptTBC, "OC_getRotatingVariantSpeech()"); + debugC(1, kDebugScript, "OC_getRotatingVariantSpeech()"); int index = _currScript->readUint16LE(); int maxValue = getPackedStringStartRelativeIndex(index); @@ -3103,8 +3103,8 @@ void LilliputScript::OC_disableInterfaceHotspot() { _vm->displayInterfaceHotspots(); } -void LilliputScript::OC_loadFile_AERIAL_GFX() { - debugC(1, kDebugScriptTBC, "OC_loadFile_AERIAL_GFX()"); +void LilliputScript::OC_loadFileAerial() { + debugC(1, kDebugScript, "OC_loadFileAerial()"); // Unused variable, and the script position is restored afterwards // TODO: Check if this part of the code is present in Rome, else remove it @@ -3387,7 +3387,7 @@ void LilliputScript::OC_setArray128EF() { int val = _currScript->readUint16LE(); assert(index < 40); - _array128EF[index] = val & 0xFF; + _characterMapPixelColor[index] = val & 0xFF; } } // End of namespace diff --git a/engines/lilliput/script.h b/engines/lilliput/script.h index 0311632e0c..b9027872f7 100644 --- a/engines/lilliput/script.h +++ b/engines/lilliput/script.h @@ -79,7 +79,7 @@ public: int _heroismBarBottomY; Common::Point _array12311[640]; - byte _array128EF[40]; + byte _characterMapPixelColor[40]; int8 _array12839[40]; Common::Point _array1813BPos[32]; @@ -274,7 +274,7 @@ private: void OC_setByte14837(); void OC_waitForEvent(); void OC_disableInterfaceHotspot(); - void OC_loadFile_AERIAL_GFX(); + void OC_loadFileAerial(); void OC_startSpeechIfSoundOff(); void OC_sub1844A(); void OC_displayNumericCharacterVariable(); -- cgit v1.2.3