diff options
author | Strangerke | 2015-02-09 19:34:32 +0100 |
---|---|---|
committer | Strangerke | 2015-02-09 19:34:32 +0100 |
commit | bdf3042174d9c91106304f18358421e3ade5ee7b (patch) | |
tree | 5c0f6e83cc2aa914e1b828f96abdda8f109556d3 /engines/access | |
parent | a81fbda3da5aa6b1960c22baf95359639b3fda20 (diff) | |
download | scummvm-rg350-bdf3042174d9c91106304f18358421e3ade5ee7b.tar.gz scummvm-rg350-bdf3042174d9c91106304f18358421e3ade5ee7b.tar.bz2 scummvm-rg350-bdf3042174d9c91106304f18358421e3ade5ee7b.zip |
ACCESS: MM - Implement cmdSpecial7
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/martian/martian_game.cpp | 1 | ||||
-rw-r--r-- | engines/access/martian/martian_game.h | 2 | ||||
-rw-r--r-- | engines/access/martian/martian_resources.cpp | 10 | ||||
-rw-r--r-- | engines/access/martian/martian_resources.h | 1 | ||||
-rw-r--r-- | engines/access/martian/martian_scripts.cpp | 156 | ||||
-rw-r--r-- | engines/access/martian/martian_scripts.h | 1 | ||||
-rw-r--r-- | engines/access/scripts.h | 3 |
7 files changed, 172 insertions, 2 deletions
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp index e3784e24fa..7572d360c3 100644 --- a/engines/access/martian/martian_game.cpp +++ b/engines/access/martian/martian_game.cpp @@ -35,6 +35,7 @@ MartianEngine::MartianEngine(OSystem *syst, const AccessGameDescription *gameDes } MartianEngine::~MartianEngine() { + _introObjects = _spec7Objects = nullptr; } void MartianEngine::initObjects() { diff --git a/engines/access/martian/martian_game.h b/engines/access/martian/martian_game.h index c324ef52cc..9ef6c05c29 100644 --- a/engines/access/martian/martian_game.h +++ b/engines/access/martian/martian_game.h @@ -60,6 +60,8 @@ protected: void setNoteParams(); void displayNote(const Common::String &msg); public: + SpriteResource *_spec7Objects; + MartianEngine(OSystem *syst, const AccessGameDescription *gameDesc); virtual ~MartianEngine(); diff --git a/engines/access/martian/martian_resources.cpp b/engines/access/martian/martian_resources.cpp index 7ffb256e44..2ae61141e7 100644 --- a/engines/access/martian/martian_resources.cpp +++ b/engines/access/martian/martian_resources.cpp @@ -810,6 +810,16 @@ const char *const DEATHMESSAGE[] = { "ONCE DANGERFIELD GETS OUT OF HIS CHAMBER, HE PULLS OUT A WEAPON AND LETS YOU HAVE IT." }; +const char *const SPEC7MESSAGE = { + "THOMAS DANGERFIELD'S MAD EXPERIMENT OF ATTEMPTING TO HARNESS THE STONE'S POWER, ENDED HIS LIFE. DANGERFIELD WAS A DECENT HUMAN " \ + "BEING ONCE, BUT WAS DRIVEN INSANE BY HIS QUEST FOR THE ULTIMATE POWER. ALEXIS AND I DECIDE THAT DEACON HAWKE IS THE ONLY " \ + "LOGICAL CHOICE FOR THE STONE. WE ARRIVE AT THE TEMPLE WHERE SHE IS WAITING FOR US. SHE TURNS AND WHISPERS; 'YOU HAVE RETURNED " \ + "THE STONE TO THE MISTRESS OF THE LIGHT. YOU HAVE SURELY SAVED THE WORLD FROM ANNIHILATION BUT YOU MUST CONTINUE TO BE DILIGENT. " \ + "MANKIND MAY YET PROVE TO BE THE AUTHOR OF HIS OWN DEMISE. REVERENCE LIFE. PROTECT THE LIVING THINGS AND RECYCLE. AND NOW FOR " \ + "THE SAFETY OF MANKIND, I MUST TAKE THE STONE. PERHAPS SOMEDAY, WHEN THE HUMAN RACE IS READY, IT WILL BE RETURNED. UNTIL THEN "\ + "FAREWELL...'" +}; + const byte _byte1EEB5[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, diff --git a/engines/access/martian/martian_resources.h b/engines/access/martian/martian_resources.h index 7503ae4e0f..4ffc4de9ab 100644 --- a/engines/access/martian/martian_resources.h +++ b/engines/access/martian/martian_resources.h @@ -65,6 +65,7 @@ extern const char *const TRAVDATA[]; extern const byte DEATH_SCREENS[]; extern const char *const DEATHMESSAGE[]; +extern const char *const SPEC7MESSAGE; extern const byte _byte1EEB5[]; extern const int PICTURERANGE[][2]; diff --git a/engines/access/martian/martian_scripts.cpp b/engines/access/martian/martian_scripts.cpp index 5962cd9f64..e8eedde279 100644 --- a/engines/access/martian/martian_scripts.cpp +++ b/engines/access/martian/martian_scripts.cpp @@ -104,6 +104,160 @@ void MartianScripts::cmdSpecial6() { _vm->_midi->stopSong(); } +void MartianScripts::cmdSpecial7() { + _vm->_room->clearRoom(); + _vm->_midi->loadMusic(47, 8); + + _vm->_sound->freeSounds(); + Resource *sound = _vm->_sound->loadSound(46, 14); + _vm->_sound->_soundTable.push_back(SoundEntry(sound, 1)); + + _vm->_screen->setDisplayScan(); + _vm->_screen->forceFadeOut(); + _vm->_events->hideCursor(); + + _vm->_files->loadScreen(40, 3); + _vm->_buffer1.copyBuffer(_vm->_screen); + _vm->_buffer2.copyBuffer(_vm->_screen); + + _vm->_events->showCursor(); + _vm->_screen->setIconPalette(); + _vm->_screen->forceFadeIn(); + + // Load objects specific to this special scene + Resource *data = _vm->_files->loadFile(40, 2); + _game->_spec7Objects = new SpriteResource(_vm, data); + delete data; + + // Load animation data + _vm->_animation->freeAnimationData(); + Resource *animResource = _vm->_files->loadFile(40, 1); + _vm->_animation->loadAnimations(animResource); + delete animResource; + + // Load script + Resource *newScript = _vm->_files->loadFile(40, 0); + _vm->_scripts->setScript(newScript); + + _vm->_images.clear(); + _vm->_oldRects.clear(); + _vm->_scripts->_sequence = 0; + + _vm->_sound->playSound(0); + + do { + charLoop(); + } while (_vm->_flags[134] != 1); + + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + + _game->_numAnimTimers = 0; + _vm->_animation->freeAnimationData(); + _vm->_scripts->freeScriptData(); + _vm->_sound->freeSounds(); + + _vm->_screen->forceFadeOut(); + _vm->_midi->midiPlay(); + _vm->_midi->setLoop(true); + _vm->_events->hideCursor(); + + _vm->_files->loadScreen(40, 4); + _vm->_buffer1.copyBuffer(_vm->_screen); + _vm->_buffer2.copyBuffer(_vm->_screen); + + _vm->_events->showCursor(); + _vm->_screen->setIconPalette(); + _vm->_screen->forceFadeIn(); + + // Setup fonts + _vm->_fonts._charSet._hi = 10; + _vm->_fonts._charSet._lo = 1; + _vm->_fonts._charFor._lo = 247; + _vm->_fonts._charFor._hi = 255; + _vm->_screen->_maxChars = 50; + _vm->_screen->_printOrg = Common::Point(24, 18); + _vm->_screen->_printStart = Common::Point(24, 18); + + // Display death message + _game->showDeathText(Common::String(SPEC7MESSAGE)); + + _vm->_events->showCursor(); + _vm->_screen->copyBuffer(&_vm->_buffer1); + _vm->_events->hideCursor(); + + _vm->_video->setVideo(_vm->_screen, Common::Point(120, 16), FileIdent(40, 5), 10); + + while (!_vm->shouldQuit() && !_vm->_video->_videoEnd) { + _vm->_video->playVideo(); + _vm->_events->pollEventsAndWait(); + } + + _vm->_sound->freeSounds(); + sound = _vm->_sound->loadSound(40, 8); + _vm->_sound->_soundTable.push_back(SoundEntry(sound, 1)); + sound = _vm->_sound->loadSound(40, 9); + _vm->_sound->_soundTable.push_back(SoundEntry(sound, 1)); + sound = _vm->_sound->loadSound(40, 10); + _vm->_sound->_soundTable.push_back(SoundEntry(sound, 1)); + + _vm->_screen->forceFadeOut(); + _vm->_files->loadScreen(40, 7); + _vm->_destIn = _vm->_screen; + + _vm->_screen->plotImage(_game->_spec7Objects, 8, Common::Point(104, 176)); + _vm->_screen->plotImage(_game->_spec7Objects, 7, Common::Point(102, 160)); + _vm->_events->showCursor(); + _vm->_screen->forceFadeIn(); + + _vm->_events->_vbCount = 100; + while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) + _vm->_events->pollEventsAndWait(); + + _vm->_sound->playSound(0); + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + + _vm->_events->_vbCount = 80; + while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) + _vm->_events->pollEventsAndWait(); + + _vm->_sound->playSound(1); + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + + _vm->_events->_vbCount = 80; + while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) + _vm->_events->pollEventsAndWait(); + + _vm->_sound->playSound(2); + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + + _vm->_sound->freeSounds(); + + delete _game->_spec7Objects; + _game->_spec7Objects = nullptr; + + _vm->_events->hideCursor(); + _vm->_screen->forceFadeOut(); + _vm->_files->loadScreen(40, 6); + _vm->_events->showCursor(); + _vm->_screen->forceFadeIn(); + + _vm->_events->waitKeyMouse(); + _vm->_midi->stopSong(); + _vm->_midi->freeMusic(); + + // The original was jumping to the restart label in main + _vm->_restartFl = true; + _vm->_events->pollEvents(); +} + void MartianScripts::executeSpecial(int commandIndex, int param1, int param2) { switch (commandIndex) { case 0: @@ -128,7 +282,7 @@ void MartianScripts::executeSpecial(int commandIndex, int param1, int param2) { cmdSpecial6(); break; case 7: - warning("TODO: cmdSpecial7"); + cmdSpecial7(); break; default: warning("Unexpected Special code %d - Skipped", commandIndex); diff --git a/engines/access/martian/martian_scripts.h b/engines/access/martian/martian_scripts.h index 9a80558e51..fb553fe6b4 100644 --- a/engines/access/martian/martian_scripts.h +++ b/engines/access/martian/martian_scripts.h @@ -40,6 +40,7 @@ private: void cmdSpecial3(); void doIntro(int param1); void cmdSpecial6(); + void cmdSpecial7(); protected: virtual void executeSpecial(int commandIndex, int param1, int param2); diff --git a/engines/access/scripts.h b/engines/access/scripts.h index f157e73c3c..07fd6acfb1 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -42,7 +42,6 @@ private: Resource *_resource; int _specialFunction; - void charLoop(); void clearWatch(); void printWatch(); @@ -53,6 +52,8 @@ protected: virtual void executeSpecial(int commandIndex, int param1, int param2) = 0; virtual void executeCommand(int commandIndex); + void charLoop(); + /** * Read a null terminated string from the script */ |