diff options
author | Strangerke | 2015-02-01 07:31:34 +0100 |
---|---|---|
committer | Strangerke | 2015-02-01 07:31:34 +0100 |
commit | 631277e486f1903a6f233cb8bfaacad84d8362bb (patch) | |
tree | edc0287db92136606b96f3681a75361c88f43fae /engines | |
parent | e0a9c92ccd1d9fb531f9c1c5ad8281aa1339f2fd (diff) | |
download | scummvm-rg350-631277e486f1903a6f233cb8bfaacad84d8362bb.tar.gz scummvm-rg350-631277e486f1903a6f233cb8bfaacad84d8362bb.tar.bz2 scummvm-rg350-631277e486f1903a6f233cb8bfaacad84d8362bb.zip |
ACCESS: MM - Implement cmdSpecial6
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/martian/martian_scripts.cpp | 65 | ||||
-rw-r--r-- | engines/access/martian/martian_scripts.h | 3 |
2 files changed, 68 insertions, 0 deletions
diff --git a/engines/access/martian/martian_scripts.cpp b/engines/access/martian/martian_scripts.cpp index 3907e5cd55..2d1a4837cc 100644 --- a/engines/access/martian/martian_scripts.cpp +++ b/engines/access/martian/martian_scripts.cpp @@ -62,6 +62,71 @@ void MartianScripts::doIntro(int param1) { _game->doSpecial5(param1); } +void MartianScripts::sub13D10(Common::String msg) { + warning("TODO: Rename sub13d10"); + Common::String line = ""; + int width = 0; + bool lastLine; + do { + lastLine = _vm->_fonts._font2.getLine(msg, _vm->_screen->_maxChars * 6, line, width); + warning("TODO: use printString"); + // Draw the text + _vm->_fonts._font2.drawString(_vm->_screen, line, _vm->_screen->_printOrg); + + _vm->_screen->_printOrg.y += 6; + _vm->_screen->_printOrg.x = _vm->_screen->_printStart.x; + + if (_vm->_screen->_printOrg.y == 180) { + _vm->_events->waitKeyMouse(); + _vm->_screen->copyBuffer(&_vm->_buffer2); + _vm->_screen->_printOrg.y = _vm->_screen->_printStart.y; + } + } while (!lastLine); + _vm->_events->waitKeyMouse(); +} + +void MartianScripts::cmdSpecial6() { + _vm->_midi->stopSong(); + _vm->_screen->setDisplayScan(); + _vm->_events->clearEvents(); + _vm->_screen->forceFadeOut(); + _vm->_events->hideCursor(); + _vm->_files->loadScreen(49, 9); + _vm->_events->showCursor(); + _vm->_screen->setIconPalette(); + _vm->_screen->forceFadeIn(); + + Resource *cellsRes = _vm->_files->loadFile("CELLS00.LZ"); + _vm->_objectsTable[0] = new SpriteResource(_vm, cellsRes); + delete cellsRes; + + _vm->_timers[20]._timer = _vm->_timers[20]._initTm = 30; + _vm->_fonts._charSet._lo = 1; + _vm->_fonts._charSet._hi = 10; + _vm->_fonts._charFor._lo = 1; + _vm->_fonts._charFor._hi = 255; + + _vm->_screen->_maxChars = 50; + _vm->_screen->_printOrg = _vm->_screen->_printStart = Common::Point(24, 18); + + Resource *notesRes = _vm->_files->loadFile("ETEXT.DAT"); + notesRes->_stream->seek(72); + + // Read the message + Common::String msg = ""; + byte c; + while ((c = (char)notesRes->_stream->readByte()) != '\0') + msg += c; + + //display the message + sub13D10(msg); + + delete notesRes; + delete _vm->_objectsTable[0]; + _vm->_objectsTable[0] = nullptr; + _vm->_midi->stopSong(); +} + void MartianScripts::executeSpecial(int commandIndex, int param1, int param2) { switch (commandIndex) { case 0: diff --git a/engines/access/martian/martian_scripts.h b/engines/access/martian/martian_scripts.h index 64b888f090..365c0ec09f 100644 --- a/engines/access/martian/martian_scripts.h +++ b/engines/access/martian/martian_scripts.h @@ -36,9 +36,12 @@ class MartianScripts : public Scripts { private: MartianEngine *_game; + void sub13D10(Common::String msg); + void cmdSpecial1(int param1); void cmdSpecial3(); void doIntro(int param1); + void cmdSpecial6(); protected: virtual void executeSpecial(int commandIndex, int param1, int param2); |