diff options
| author | Bastien Bouclet | 2017-02-11 08:00:07 +0100 |
|---|---|---|
| committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
| commit | ae6f248616a144050337e9687033402c4868d558 (patch) | |
| tree | 2358c3475c267c0def0548dc457c440fb7d88523 /engines/mohawk/riven_stacks | |
| parent | f0267d542f860a2f67f519a1dc5343e020927c81 (diff) | |
| download | scummvm-rg350-ae6f248616a144050337e9687033402c4868d558.tar.gz scummvm-rg350-ae6f248616a144050337e9687033402c4868d558.tar.bz2 scummvm-rg350-ae6f248616a144050337e9687033402c4868d558.zip | |
MOHAWK: Move Riven's sunner alert handling to the jungle stack
Diffstat (limited to 'engines/mohawk/riven_stacks')
| -rw-r--r-- | engines/mohawk/riven_stacks/jspit.cpp | 36 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/jspit.h | 3 |
2 files changed, 36 insertions, 3 deletions
diff --git a/engines/mohawk/riven_stacks/jspit.cpp b/engines/mohawk/riven_stacks/jspit.cpp index 7dc5210e46..f4b0c0fc62 100644 --- a/engines/mohawk/riven_stacks/jspit.cpp +++ b/engines/mohawk/riven_stacks/jspit.cpp @@ -413,9 +413,17 @@ void JSpit::xjplaybeetle_1450(uint16 argc, uint16 *argv) { void JSpit::xjlagoon700_alert(uint16 argc, uint16 *argv) { // Handle sunner reactions (mid-staircase) + uint32 sunners = _vm->_vars["jsunners"]; - if (_vm->_vars["jsunners"] == 0) - _vm->_video->playMovieRiven(1); + // If the sunners are gone, there's nothing for us to do + if (sunners != 0) { + return; + } + + VideoEntryPtr sunnerAlertVideo = _vm->_video->playMovieRiven(1); + + // Wait for a click while the alert video is playing + sunnersPlayVideo(sunnerAlertVideo, 0x7BEB); } void JSpit::xjlagoon800_alert(uint16 argc, uint16 *argv) { @@ -425,7 +433,10 @@ void JSpit::xjlagoon800_alert(uint16 argc, uint16 *argv) { if (sunners == 0) { // Show the sunners alert video - _vm->_video->playMovieRiven(1); + VideoEntryPtr sunnerAlertVideo = _vm->_video->playMovieRiven(1); + + // Wait for a click while the alert video is playing + sunnersPlayVideo(sunnerAlertVideo, 0xB6CA); } else if (sunners == 1) { // Show the sunners leaving if you moved forward in their "alert" status _vm->_video->playMovieBlockingRiven(2); @@ -451,6 +462,25 @@ void JSpit::xjlagoon1500_alert(uint16 argc, uint16 *argv) { } } +void JSpit::sunnersPlayVideo(VideoEntryPtr &video, uint32 destCardGlobalId) { + uint32 &sunners = _vm->_vars["jsunners"]; + + mouseForceUp(); + while (!video->endOfVideo() && !_vm->shouldQuit()) { + _vm->doFrame(); + + if (mouseIsDown()) { + video->stop(); + sunners = 1; + + uint16 destCardId = getCardStackId(destCardGlobalId); + RivenScriptPtr clickScript = _vm->_scriptMan->createScriptFromData(1, 2, 1, destCardId); + _vm->_scriptMan->runScript(clickScript, false); + break; + } + } +} + void JSpit::sunnersTopStairsTimer() { // If the sunners are gone, we have no video to play if (_vm->_vars["jsunners"] != 0) { diff --git a/engines/mohawk/riven_stacks/jspit.h b/engines/mohawk/riven_stacks/jspit.h index bf9158875c..9ce32bc4fe 100644 --- a/engines/mohawk/riven_stacks/jspit.h +++ b/engines/mohawk/riven_stacks/jspit.h @@ -24,6 +24,7 @@ #define RIVEN_STACKS_JSPIT_H #include "mohawk/riven_stacks/domespit.h" +#include "mohawk/video.h" namespace Mohawk { namespace RivenStacks { @@ -92,6 +93,8 @@ public: private: int jspitElevatorLoop(); void redrawWharkNumberPuzzle(uint16 overlay, uint16 number); + + void sunnersPlayVideo(VideoEntryPtr &video, uint32 destCardGlobalId); }; } // End of namespace RivenStacks |
