diff options
author | Strangerke | 2012-05-09 23:13:15 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | e1f6fe2226d4825e70025872c00054efbafee0c2 (patch) | |
tree | 4b97517e6a00ee53d9d01b7b46516d2ed68dab70 | |
parent | 59f6e304a2feb44b416308a4dd71354893687e7d (diff) | |
download | scummvm-rg350-e1f6fe2226d4825e70025872c00054efbafee0c2.tar.gz scummvm-rg350-e1f6fe2226d4825e70025872c00054efbafee0c2.tar.bz2 scummvm-rg350-e1f6fe2226d4825e70025872c00054efbafee0c2.zip |
LILLIPUT: Some more renaming
-rw-r--r-- | engines/lilliput/lilliput.cpp | 39 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 12 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 49 | ||||
-rw-r--r-- | engines/lilliput/sound.cpp | 4 | ||||
-rw-r--r-- | engines/lilliput/sound.h | 2 |
5 files changed, 50 insertions, 56 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 0649289ca2..ec45493521 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -340,11 +340,10 @@ void LilliputEngine::displayCharacter(int index, Common::Point pos, int flags) { } } -// display mouse cursor, if any -void LilliputEngine::displayFunction1(byte *buf, int var1, Common::Point pos) { - debugC(2, kDebugEngineTBC, "displayFunction1(buf, %d, %d, %d)", var1, pos.x, pos.y); +void LilliputEngine::display16x16IndexedBuf(byte *buf, int index, Common::Point pos) { + debugC(2, kDebugEngine, "display16x16IndexedBuf(buf, %d, %d, %d)", index, pos.x, pos.y); - int index1 = ((var1 & 0xFF) << 8) + (var1 >> 8); + int index1 = ((index & 0xFF) << 8) + (index >> 8); byte *newBuf = &buf[index1]; int tmpVal = ((pos.y & 0xFF) << 8) + (pos.y >> 8); @@ -362,10 +361,10 @@ void LilliputEngine::displayFunction1(byte *buf, int var1, Common::Point pos) { _system->updateScreen(); } -void LilliputEngine::displayFunction1a(byte *buf, Common::Point pos) { - debugC(2, kDebugEngineTBC, "displayFunction1a(buf, %d, %d)", pos.x, pos.y); +void LilliputEngine::display16x16Buf(byte *buf, Common::Point pos) { + debugC(2, kDebugEngine, "display16x16Buf(buf, %d, %d)", pos.x, pos.y); - displayFunction1(buf, 0, pos); + display16x16IndexedBuf(buf, 0, pos); } void LilliputEngine::SaveSurfaceUnderMouseCursor(byte *buf, Common::Point pos) { @@ -405,7 +404,7 @@ void LilliputEngine::displayMousePointer() { _savedSurfaceUnderMousePos = _mouseDisplayPos; SaveSurfaceUnderMouseCursor(_savedSurfaceUnderMouse, _mouseDisplayPos); - displayFunction1(_bufferIdeogram, _word15AC2 + 80, _mouseDisplayPos); + display16x16IndexedBuf(_bufferIdeogram, _word15AC2 + 80, _mouseDisplayPos); _skipDisplayFlag1 = 1; _skipDisplayFlag2 = 0; @@ -417,7 +416,7 @@ void LilliputEngine::restoreSurfaceUnderMousePointer() { if ((_skipDisplayFlag1 != 0) && (_skipDisplayFlag2 != 1)) { _skipDisplayFlag2 = 1; - displayFunction1a(_savedSurfaceUnderMouse, _savedSurfaceUnderMousePos); + display16x16Buf(_savedSurfaceUnderMouse, _savedSurfaceUnderMousePos); _skipDisplayFlag1 = 0; _skipDisplayFlag2 = 0; } @@ -467,7 +466,7 @@ void LilliputEngine::displayInterfaceHotspots() { int tmpVal; for (index = 0; index < _word12F68_ERULES; index++) { tmpVal = ((_scriptHandler->_array122E9[index] << 2) + (_scriptHandler->_array122E9[index] << 4)) & 0xFF; - displayFunction1(_bufferIdeogram, tmpVal + index, Common::Point(_interfaceHotspotsX[index], _interfaceHotspotsY[index])); + display16x16IndexedBuf(_bufferIdeogram, tmpVal + index, Common::Point(_interfaceHotspotsX[index], _interfaceHotspotsY[index])); } displayMousePointer(); @@ -841,7 +840,7 @@ void LilliputEngine::paletteFadeOut() { } void LilliputEngine::paletteFadeIn() { - debugC(2, kDebugEngineTBC, "paletteFadeIn()"); + debugC(2, kDebugEngine, "paletteFadeIn()"); byte palette[768]; for (int fade = 8; fade <= 256; fade += 8) { @@ -1683,7 +1682,7 @@ void LilliputEngine::sub16626() { result = sub1675D(index, var1); break; case 11: - result = sub16729(index); + result = sub16729(index, var1); break; case 12: result = sub16799(index, var1); @@ -1754,13 +1753,12 @@ byte LilliputEngine::sub16722(int index, Common::Point var1) { return 2; } -byte LilliputEngine::sub16729(int index) { - debugC(2, kDebugEngineTBC, "sub16729(%d)", index); +byte LilliputEngine::sub16729(int index, Common::Point var1) { + debugC(2, kDebugEngineTBC, "sub16729(%d, %d - %d)", index, var1.x, var1.y); - int arg1 = index | 0xFF00; - Common::Point pos1 = Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index]); - Common::Point pos2 = _scriptHandler->_viewportPos; - _soundHandler->contentFct2(); // TODO: add arg pos1 and pos2 + int param4x = ((index | 0xFF00) >> 8); + int param1 = var1.y; + _soundHandler->contentFct2(param1, _scriptHandler->_viewportPos, Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index]), Common::Point(param4x, 0)); return 2; } @@ -2267,7 +2265,7 @@ void LilliputEngine::displayHeroismIndicator() { } void LilliputEngine::pollEvent() { - debugC(2, kDebugEngineTBC, "pollEvent()"); + debugC(2, kDebugEngine, "pollEvent()"); Common::Event event; while (_system->getEventManager()->pollEvent(event)) { @@ -2722,8 +2720,7 @@ void LilliputEngine::initialize() { for (int i = 0; i < 4; i++) { _arr18560[i]._field0 = 0; - _arr18560[i]._field1 = 0; - _arr18560[i]._field3 = 0; + _arr18560[i]._field1 = Common::Point(0, 0); for (int j = 0; j < 8; j ++) _arr18560[i]._field5[j] = 0; } diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index a1d683c198..b521c087dd 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -70,8 +70,7 @@ struct LilliputGameDescription; struct struct18560 { byte _field0; - int16 _field1; - int16 _field3; + Common::Point _field1; int16 _field5[8]; }; @@ -220,8 +219,8 @@ public: void newInt8(); void update(); - void displayFunction1(byte *buf, int var1, Common::Point pos); - void displayFunction1a(byte *buf, Common::Point pos); + void display16x16IndexedBuf(byte *buf, int var1, Common::Point pos); + void display16x16Buf(byte *buf, Common::Point pos); void SaveSurfaceUnderMouseCursor(byte *buf, Common::Point pos); void displayFunction3(int var1, int var2, int var4); void displayMousePointer(); @@ -305,7 +304,7 @@ public: void sub16B31(int index, int val); void sub16B8F(int index, int x, int y, int flag); byte sub1675D(int index, Common::Point var1); - byte sub16729(int index); + byte sub16729(int index, Common::Point var1); byte sub166F7(int index, Common::Point var1, int tmpVal); void sub1693A(int index); @@ -341,6 +340,8 @@ public: byte _numCharactersToDisplay; byte _byte16C9F; int _word10804; + bool _shouldQuit; + void pollEvent(); void sub170EE(int index); @@ -357,7 +358,6 @@ public: protected: Common::EventManager *_eventMan; - bool _shouldQuit; int _lastTime; // Engine APIs diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index 17f6f6a574..2dfdf061e9 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -957,12 +957,12 @@ void LilliputScript::runMenuScript(ScriptStream script) { } void LilliputScript::sub185ED(byte index, byte subIndex) { - debugC(2, kDebugScriptTBC, "sub185ED"); + debugC(2, kDebugScript, "sub185ED(%d, %d)", index, subIndex); if (_vm->_arr18560[index]._field0 != 1) return; - _vm->displayFunction1(_vm->_bufferIdeogram, _vm->_arr18560[index]._field5[subIndex], Common::Point(_vm->_arr18560[index]._field1, _vm->_arr18560[index]._field3)); + _vm->display16x16IndexedBuf(_vm->_bufferIdeogram, _vm->_arr18560[index]._field5[subIndex], _vm->_arr18560[index]._field1); } byte LilliputScript::compareValues(byte var1, int oper, int var2) { @@ -3086,7 +3086,7 @@ void LilliputScript::OC_sub184D7() { } void LilliputScript::OC_displayTitleScreen() { - debugC(1, kDebugScriptTBC, "OC_displayTitleScreen()"); + debugC(1, kDebugScript, "OC_displayTitleScreen()"); _vm->_byte184F4 = (_currScript->readUint16LE() & 0xFF); _vm->_sound_byte16F06 = _vm->_byte184F4; @@ -3098,7 +3098,7 @@ void LilliputScript::OC_displayTitleScreen() { _vm->_mouseButton = 0; _vm->_byte16F09 = 0; - for (;;) { + while(!_vm->_shouldQuit) { sub185B4_display(); _vm->update(); if (_vm->_keyboard_nextIndex != _vm->_keyboard_oldIndex) { @@ -3146,16 +3146,16 @@ void LilliputScript::OC_sub1864D() { } void LilliputScript::OC_initArr18560() { - debugC(1, kDebugScriptTBC, "OC_initArr18560()"); + debugC(1, kDebugScript, "OC_initArr18560()"); - int curWord = _currScript->readUint16LE(); - assert (curWord < 4); - _vm->_arr18560[curWord]._field0 = 1; - _vm->_arr18560[curWord]._field1 = _currScript->readUint16LE(); - _vm->_arr18560[curWord]._field3 = _currScript->readUint16LE(); + int index = _currScript->readUint16LE(); + assert (index < 4); + _vm->_arr18560[index]._field0 = 1; + _vm->_arr18560[index]._field1.x = _currScript->readSint16LE(); + _vm->_arr18560[index]._field1.y = _currScript->readSint16LE(); for (int i = 0; i < 8; i++) - _vm->_arr18560[curWord]._field5[i] = _currScript->readUint16LE(); + _vm->_arr18560[index]._field5[i] = _currScript->readSint16LE(); } void LilliputScript::OC_sub18678() { @@ -3184,15 +3184,10 @@ void LilliputScript::OC_sub186E5_snd() { int index = getValue1(); assert(index < 40); - byte var4h = 0xFF; - byte var4l = (index & 0xFF); - byte var3h = _array16123PosX[index]; - byte var3l = _array1614BPosY[index]; - byte var2h = (_viewportPos.x & 0xFF); - byte var2l = (_viewportPos.y & 0xFF); - int var1 = _currScript->readUint16LE(); - - _vm->_soundHandler->contentFct2(); + Common::Point var4 = Common::Point(0xFF, index & 0xFF); + int var1 = (_currScript->readUint16LE() & 0xFF); + + _vm->_soundHandler->contentFct2(var1, _viewportPos, Common::Point(_array16123PosX[index], _array1614BPosY[index]), var4); } void LilliputScript::OC_sub1870A_snd() { @@ -3203,7 +3198,7 @@ void LilliputScript::OC_sub1870A_snd() { Common::Point var2 = _viewportPos; int var1 = (_currScript->readUint16LE() & 0xFF); - _vm->_soundHandler->contentFct2(); + _vm->_soundHandler->contentFct2(var1, var2, var3, var4); } void LilliputScript::OC_sub18725_snd() { @@ -3229,13 +3224,15 @@ void LilliputScript::OC_sub1873F_snd() { } void LilliputScript::OC_sub18746_snd() { - debugC(1, kDebugScriptTBC, "OC_sub18746_snd()"); + debugC(1, kDebugScript, "OC_sub18746_snd()"); - int var4 = -1; - int var2 = (_viewportPos.x << 8) + _viewportPos.y; - int var1 = _currScript->readUint16LE() & 0xFF; + Common::Point var4 = Common::Point(-1, -1); + Common::Point var2 = _viewportPos; + int var1 = _currScript->readSint16LE() & 0xFF; + warning("OC_sub18746_snd: unknown value for var3"); + Common::Point var3 = Common::Point(-1, -1); - _vm->_soundHandler->contentFct2(); + _vm->_soundHandler->contentFct2(var1, var2, var3, var4); } void LilliputScript::OC_sub1875D_snd() { diff --git a/engines/lilliput/sound.cpp b/engines/lilliput/sound.cpp index 571191f060..c96c05f407 100644 --- a/engines/lilliput/sound.cpp +++ b/engines/lilliput/sound.cpp @@ -42,8 +42,8 @@ void LilliputSound::contentFct1() { debugC(1, kDebugSound, "contentFct1()"); } -void LilliputSound::contentFct2() { - debugC(1, kDebugSound, "contentFct2()"); +void LilliputSound::contentFct2(int var1, Common::Point var2, Common::Point var3, Common::Point var4) { + 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() { diff --git a/engines/lilliput/sound.h b/engines/lilliput/sound.h index c4f2126cbb..756dad1bd8 100644 --- a/engines/lilliput/sound.h +++ b/engines/lilliput/sound.h @@ -34,7 +34,7 @@ public: void contentFct0(); void contentFct1(); - void contentFct2(); + void contentFct2(int var1, Common::Point var2, Common::Point var3, Common::Point var4); void contentFct3(); void contentFct4(); void contentFct5(); |