diff options
author | Paul Gilbert | 2018-02-13 21:33:02 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-02-13 21:33:02 -0500 |
commit | 3f7fcaec5f36b9eeeeb895f3ec078fb8e60068ca (patch) | |
tree | d27f4f4d11fb879b44ba432c6bfbb90c1fa17005 /engines/xeen/worldofxeen | |
parent | 5380e3a2ca795c6cf6b54e2bb5d3b2c9bcb55dd6 (diff) | |
download | scummvm-rg350-3f7fcaec5f36b9eeeeb895f3ec078fb8e60068ca.tar.gz scummvm-rg350-3f7fcaec5f36b9eeeeb895f3ec078fb8e60068ca.tar.bz2 scummvm-rg350-3f7fcaec5f36b9eeeeb895f3ec078fb8e60068ca.zip |
XEEN: Move reseting dream sequence cutscene into the engine class
Diffstat (limited to 'engines/xeen/worldofxeen')
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen.cpp | 36 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen.h | 5 |
2 files changed, 41 insertions, 0 deletions
diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp index dbccf460ea..9bc6394f48 100644 --- a/engines/xeen/worldofxeen/worldofxeen.cpp +++ b/engines/xeen/worldofxeen/worldofxeen.cpp @@ -170,6 +170,42 @@ void WorldOfXeenEngine::death() { w.update(); } +void WorldOfXeenEngine::dream() { + Windows &windows = *_windows; + Graphics::ManagedSurface savedBg; + + savedBg.copyFrom(*_screen); + _screen->fadeOut(); + _events->hideCursor(); + + _screen->loadBackground("scene1.raw"); + windows[0].update(); + _screen->fadeIn(); + + _events->updateGameCounter(); + while (!shouldExit() && _events->timeElapsed() < 7) + _events->pollEventsAndWait(); + + _sound->playSound("dreams2.voc", 1); + while (!shouldExit() && _sound->isPlaying()) + _events->pollEventsAndWait(); + + _sound->playSound("laff1.voc", 1); + while (!shouldExit() && _sound->isPlaying()) + _events->pollEventsAndWait(); + + _events->updateGameCounter(); + while (!shouldExit() && _events->timeElapsed() < 7) + _events->pollEventsAndWait(); + + _screen->fadeOut(); + _events->setCursor(0); + _screen->blitFrom(savedBg); + windows[0].update(); + + _screen->fadeIn(); +} + void WorldOfXeenEngine::showCutscene(const Common::String &name, int status, uint score) { _sound->stopAllAudio(); _events->clearEvents(); diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h index 1122115498..f985947af4 100644 --- a/engines/xeen/worldofxeen/worldofxeen.h +++ b/engines/xeen/worldofxeen/worldofxeen.h @@ -64,6 +64,11 @@ public: virtual void showCutscene(const Common::String &name, int status, uint score); /** + * Dream sequence + */ + virtual void dream(); + + /** * Set the next overall game action to do */ void setPendingAction(WOXGameAction action) { _pendingAction = action; } |