diff options
author | Strangerke | 2012-04-16 23:16:01 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 847098c705f3cc9f7a9155e0ffc70d4868400fda (patch) | |
tree | 0e6e4b673d32492b0eaf679c249035f6d7c06a31 | |
parent | d924342d2dca0c14efd7d0607d16c6aeacad84fb (diff) | |
download | scummvm-rg350-847098c705f3cc9f7a9155e0ffc70d4868400fda.tar.gz scummvm-rg350-847098c705f3cc9f7a9155e0ffc70d4868400fda.tar.bz2 scummvm-rg350-847098c705f3cc9f7a9155e0ffc70d4868400fda.zip |
LILLIPUT: Implement display function 6, start implementing display function 12.
Background is now displayed properly
-rw-r--r-- | engines/lilliput/lilliput.cpp | 42 | ||||
-rw-r--r-- | engines/lilliput/lilliput.h | 6 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 13 |
3 files changed, 56 insertions, 5 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index 10e55cd4d6..b645c513df 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -152,6 +152,12 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd) _array15AC8[i] = 0; _ptr_rulesBuffer2_15 = NULL; + _bufferIdeogram = NULL; + _bufferMen = NULL; + _bufferMen2 = NULL; + _bufferIsoChars = NULL; + _bufferIsoMap = NULL; + _bufferCubegfx = NULL; } LilliputEngine::~LilliputEngine() { @@ -281,6 +287,42 @@ void LilliputEngine::displayFunction5() { } } +void LilliputEngine::displayFunction6() { + debugC(2, kDebugEngine, "displayFunction6()"); + + displayFunction5(); + + int index = (16 * 320) + 64; + for (int i = 0; i < 176; i++) { + for (int j = 0; j < 256; j++) + _buffer3_45k[(i * 256) + j] = ((byte *)_mainSurface->getPixels())[index + j]; + index += 320; + } + + displayFunction4(); +} + +void LilliputEngine::displayFunction12() { + debugC(1, kDebugEngine, "displayFunction12()"); + + displayFunction5(); + + byte *tmpBuf = loadVGA("SCREEN.GFX", true); + memcpy(_mainSurface->getPixels(), tmpBuf, 320*200); + _system->copyRectToScreen((byte *)_mainSurface->getPixels(), 320, 0, 0, 320, 200); + _system->updateScreen(); + + displayFunction6(); + warning("Display function 7"); + warning("Display function 8"); + warning("Display function 9"); + warning("sub_1649F()"); + warning("sub_154C5()"); + + displayFunction4(); + free(tmpBuf); +} + void LilliputEngine::pollEvent() { debugC(2, kDebugEngine, "pollEvent()"); diff --git a/engines/lilliput/lilliput.h b/engines/lilliput/lilliput.h index a59b244ad7..a677c1b311 100644 --- a/engines/lilliput/lilliput.h +++ b/engines/lilliput/lilliput.h @@ -93,7 +93,7 @@ public: byte _buffer2[45056]; byte _buffer3[45056]; byte *_bufferIsoMap; - byte _bufferCubegfx[61440]; + byte *_bufferCubegfx; byte *_bufferMen; byte *_bufferMen2; byte *_bufferIsoChars; @@ -162,6 +162,8 @@ public: byte _byte109C1[40]; byte _array15AC8[256]; + byte _buffer3_45k[45056]; + const LilliputGameDescription *_gameDescription; uint32 getFeatures() const; const char *getGameId() const; @@ -171,6 +173,8 @@ public: void displayFunction2(byte *buf, int var2, int var4); void displayFunction4(); void displayFunction5(); + void displayFunction6(); + void displayFunction12(); void initGame(const LilliputGameDescription *gd); byte *loadVGA(Common::String filename, bool loadPal); diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index f979008093..396bd41c07 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -1445,14 +1445,14 @@ void LilliputScript::OC_sub17BB7() { int scriptIndex = _vm->_arrayGameScriptIndex[index]; _scriptStack.push(_currScript); - warning("===> push"); + if (_byte16F05_ScriptHandler == 0) { _vm->_byte1714E = 0; runMenuScript(Common::MemoryReadStream(&_vm->_arrayGameScripts[scriptIndex], _vm->_arrayGameScriptIndex[index + 1] - _vm->_arrayGameScriptIndex[index])); } else { runScript(Common::MemoryReadStream(&_vm->_arrayGameScripts[scriptIndex], _vm->_arrayGameScriptIndex[index + 1] - _vm->_arrayGameScriptIndex[index])); } - warning("===> pop"); + _currScript = _scriptStack.pop(); _vm->sub170EE(tmpIndex); @@ -1663,7 +1663,10 @@ void LilliputScript::OC_loadAndDisplayCUBESx_GFX() { assert((curWord >= 0) && (curWord <= 9)); Common::String fileName = Common::String::format("CUBES%d.GFX", curWord); _byte10806 = curWord + 0x30; - warning("TODO: load %s then display things", fileName.c_str()); + + _vm->_bufferCubegfx = _vm->loadVGA(fileName, false); + warning("Display function 9"); + warning("sub_1649F()"); } void LilliputScript::OC_sub1834C() { @@ -1784,7 +1787,9 @@ void LilliputScript::OC_sub1853B() { _byte16F08 = 0; _byte15FFA = 0; sub130B6(); - warning("TODO: Display function sub15CBC();"); + + _vm->displayFunction12(); + warning("TODO: unkPaletteFunction_2"); _byte12A09 = 0; warning("TODO: call sound function #5"); |