diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/martian/martian_game.cpp | 60 | ||||
-rw-r--r-- | engines/access/martian/martian_game.h | 3 | ||||
-rw-r--r-- | engines/access/martian/martian_scripts.cpp | 25 | ||||
-rw-r--r-- | engines/access/martian/martian_scripts.h | 2 |
4 files changed, 63 insertions, 27 deletions
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp index c386c54b9f..5ec1ede25a 100644 --- a/engines/access/martian/martian_game.cpp +++ b/engines/access/martian/martian_game.cpp @@ -278,6 +278,12 @@ void MartianEngine::doCredits() { } void MartianEngine::setupGame() { + // Load death list + _deaths.resize(20); + for (int i = 0; i < 20; ++i) { + _deaths[i]._screenId = Martian::DEATH_SCREENS[i]; + _deaths[i]._msg = Martian::DEATHMESSAGE[i]; + } // Setup timers const int TIMER_DEFAULTS[] = { 4, 10, 8, 1, 1, 1, 1, 2 }; @@ -304,6 +310,60 @@ void MartianEngine::drawHelp() { error("TODO: drawHelp"); } +void MartianEngine::sub13D10(Common::String msg) { + warning("TODO: Rename sub13d10"); + Common::String line = ""; + int width = 0; + bool lastLine; + do { + lastLine = _fonts._font2.getLine(msg, _screen->_maxChars * 6, line, width); + warning("TODO: use printString"); + // Draw the text + _fonts._font2.drawString(_screen, line, _screen->_printOrg); + + _screen->_printOrg.y += 6; + _screen->_printOrg.x = _screen->_printStart.x; + + if (_screen->_printOrg.y == 180) { + _events->waitKeyMouse(); + _screen->copyBuffer(&_buffer2); + _screen->_printOrg.y = _screen->_printStart.y; + } + } while (!lastLine); + _events->waitKeyMouse(); +} + +void MartianEngine::dead(int deathId) { + // Load and display death screen + _events->hideCursor(); + _screen->forceFadeOut(); + _files->loadScreen(48, _deaths[deathId]._screenId); + _screen->setIconPalette(); + _buffer2.copyBuffer(_screen); + _screen->forceFadeIn(); + _events->showCursor(); + + // Setup fonts + _fonts._charSet._hi = 10; + _fonts._charSet._lo = 1; + _fonts._charFor._lo = 247; + _fonts._charFor._hi = 255; + _screen->_maxChars = 50; + _screen->_printOrg = Common::Point(24, 18); + _screen->_printStart = Common::Point(24, 18); + + // Display death message + sub13D10(_deaths[deathId]._msg); + + _screen->forceFadeOut(); + _room->clearRoom(); + freeChar(); + + // The original was jumping to the restart label in main + _restartFl = true; + _events->pollEvents(); +} + } // End of namespace Martian } // End of namespace Access diff --git a/engines/access/martian/martian_game.h b/engines/access/martian/martian_game.h index 155642a4e4..7954948d30 100644 --- a/engines/access/martian/martian_game.h +++ b/engines/access/martian/martian_game.h @@ -55,7 +55,7 @@ protected: */ virtual void playGame(); - virtual void dead(int deathId) {} + virtual void dead(int deathId); void setNoteParams(); void displayNote(const Common::String &msg); @@ -65,6 +65,7 @@ public: void doSpecial5(int param1); void drawHelp(); + void sub13D10(Common::String msg); virtual void establish(int esatabIndex, int sub) {}; }; diff --git a/engines/access/martian/martian_scripts.cpp b/engines/access/martian/martian_scripts.cpp index 2d1a4837cc..01016b539e 100644 --- a/engines/access/martian/martian_scripts.cpp +++ b/engines/access/martian/martian_scripts.cpp @@ -62,29 +62,6 @@ 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(); @@ -119,7 +96,7 @@ void MartianScripts::cmdSpecial6() { msg += c; //display the message - sub13D10(msg); + _game->sub13D10(msg); delete notesRes; delete _vm->_objectsTable[0]; diff --git a/engines/access/martian/martian_scripts.h b/engines/access/martian/martian_scripts.h index 365c0ec09f..9a80558e51 100644 --- a/engines/access/martian/martian_scripts.h +++ b/engines/access/martian/martian_scripts.h @@ -36,8 +36,6 @@ class MartianScripts : public Scripts { private: MartianEngine *_game; - void sub13D10(Common::String msg); - void cmdSpecial1(int param1); void cmdSpecial3(); void doIntro(int param1); |