From a54bb5e3515d4fb3630fd6ae1a9727ddc1230e19 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 10 Feb 2015 07:53:31 +0100 Subject: ACCESS: MM - Implement cmdSpecial0 --- engines/access/martian/martian_scripts.cpp | 43 +++++++++++++++++++++++++++++- engines/access/martian/martian_scripts.h | 1 + engines/access/screen.cpp | 4 +++ engines/access/screen.h | 2 ++ 4 files changed, 49 insertions(+), 1 deletion(-) (limited to 'engines/access') diff --git a/engines/access/martian/martian_scripts.cpp b/engines/access/martian/martian_scripts.cpp index e8eedde279..a9b5de5597 100644 --- a/engines/access/martian/martian_scripts.cpp +++ b/engines/access/martian/martian_scripts.cpp @@ -34,6 +34,47 @@ MartianScripts::MartianScripts(AccessEngine *vm) : Scripts(vm) { _game = (MartianEngine *)_vm; } +void MartianScripts::cmdSpecial0() { + _vm->_sound->stopSound(); + _vm->_midi->stopSong(); + + _vm->_midi->loadMusic(47, 1); + _vm->_midi->midiPlay(); + _vm->_midi->setLoop(true); + + _vm->_events->_vbCount = 300; + while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) + _vm->_events->pollEventsAndWait(); + + _vm->_screen->forceFadeOut(); + _vm->_files->loadScreen("HOUSE.SC"); + + _vm->_video->setVideo(_vm->_screen, Common::Point(46, 30), "HVID.VID", 20); + + do { + _vm->_video->playVideo(); + if (_vm->_video->_videoFrame == 4) { + _vm->_screen->flashPalette(16); + _vm->_sound->playSound(4); + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + _vm->_timers[31]._timer = _vm->_timers[31]._initTm = 40; + } + } while (!_vm->_video->_videoEnd && !_vm->shouldQuit()); + + if (_vm->_video->_videoEnd) { + _vm->_screen->flashPalette(12); + _vm->_sound->playSound(4); + do { + _vm->_events->pollEvents(); + } while (!_vm->shouldQuit() && _vm->_sound->_playingSound); + _vm->_midi->stopSong(); + _vm->_midi->freeMusic(); + warning("TODO: Pop Midi"); + } +} + void MartianScripts::cmdSpecial1(int param1) { _vm->_events->hideCursor(); @@ -261,7 +302,7 @@ void MartianScripts::cmdSpecial7() { void MartianScripts::executeSpecial(int commandIndex, int param1, int param2) { switch (commandIndex) { case 0: - warning("TODO: cmdSpecial0"); + cmdSpecial0(); break; case 1: cmdSpecial1(param1); diff --git a/engines/access/martian/martian_scripts.h b/engines/access/martian/martian_scripts.h index fb553fe6b4..9c2141276e 100644 --- a/engines/access/martian/martian_scripts.h +++ b/engines/access/martian/martian_scripts.h @@ -36,6 +36,7 @@ class MartianScripts : public Scripts { private: MartianEngine *_game; + void cmdSpecial0(); void cmdSpecial1(int param1); void cmdSpecial3(); void doIntro(int param1); diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index 2b535b64d0..5130d8ed5f 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -336,6 +336,10 @@ void Screen::cyclePaletteBackwards() { } } +void Screen::flashPalette(int count) { + warning("TODO: Implement flashPalette"); +} + void Screen::addDirtyRect(const Common::Rect &r) { _dirtyRects.push_back(r); assert(r.isValidRect() && r.width() > 0 && r.height() > 0); diff --git a/engines/access/screen.h b/engines/access/screen.h index a5431bcfcb..97ec59d1d1 100644 --- a/engines/access/screen.h +++ b/engines/access/screen.h @@ -158,6 +158,8 @@ public: void getPalette(byte *pal); + void flashPalette(int count); + /** * Copy a buffer to the screen */ -- cgit v1.2.3