diff options
| author | Bastien Bouclet | 2017-07-29 18:20:45 +0200 |
|---|---|---|
| committer | Bastien Bouclet | 2017-07-29 18:20:45 +0200 |
| commit | 69c1f70818aaf83f97bf7131cdf9423c0a75027f (patch) | |
| tree | 787e2293f0a2785cbb2c173a83106c5c3efb41c1 /engines/mohawk/riven_stacks | |
| parent | 8c587b54ab92a5f21fae2c1db8ebdedaf61b521e (diff) | |
| download | scummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.tar.gz scummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.tar.bz2 scummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.zip | |
MOHAWK: Riven: Let the gameloop gracefully end when quitting
Prevents the quit confirmation dialog from being displayed at the end of
the game's ending if it is enabled.
Fixes #9943.
Diffstat (limited to 'engines/mohawk/riven_stacks')
| -rw-r--r-- | engines/mohawk/riven_stacks/aspit.cpp | 6 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/bspit.cpp | 8 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/domespit.cpp | 2 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/jspit.cpp | 8 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/ospit.cpp | 12 | ||||
| -rw-r--r-- | engines/mohawk/riven_stacks/tspit.cpp | 2 |
6 files changed, 19 insertions, 19 deletions
diff --git a/engines/mohawk/riven_stacks/aspit.cpp b/engines/mohawk/riven_stacks/aspit.cpp index c8d5dec377..a31aa902ec 100644 --- a/engines/mohawk/riven_stacks/aspit.cpp +++ b/engines/mohawk/riven_stacks/aspit.cpp @@ -131,7 +131,7 @@ void ASpit::xaatrusbooknextpage(const ArgumentArray &args) { // Keep turning pages while the mouse is pressed bool firstPageTurn = true; - while ((mouseIsDown() || firstPageTurn) && !_vm->shouldQuit()) { + while ((mouseIsDown() || firstPageTurn) && !_vm->hasGameEnded()) { // Check for the last page if (((_vm->getFeatures() & GF_DEMO) && page == 6) || page == 10) return; @@ -236,7 +236,7 @@ void ASpit::xacathbooknextpage(const ArgumentArray &args) { // Keep turning pages while the mouse is pressed bool firstPageTurn = true; - while ((mouseIsDown() || firstPageTurn) && !_vm->shouldQuit()) { + while ((mouseIsDown() || firstPageTurn) && !_vm->hasGameEnded()) { // Check for the last page if (page == 49) return; @@ -346,7 +346,7 @@ void ASpit::xaenablemenuintro(const ArgumentArray &args) { void ASpit::xademoquit(const ArgumentArray &args) { // Exactly as it says on the tin. In the demo, this function quits. - _vm->quitGame(); + _vm->setGameEnded(); } void ASpit::xaexittomain(const ArgumentArray &args) { diff --git a/engines/mohawk/riven_stacks/bspit.cpp b/engines/mohawk/riven_stacks/bspit.cpp index 51d3656761..b1ba5abd7b 100644 --- a/engines/mohawk/riven_stacks/bspit.cpp +++ b/engines/mohawk/riven_stacks/bspit.cpp @@ -126,7 +126,7 @@ void BSpit::xblabbooknextpage(const ArgumentArray &args) { // Keep turning pages while the mouse is pressed bool firstPageTurn = true; - while ((mouseIsDown() || firstPageTurn) && !_vm->shouldQuit()) { + while ((mouseIsDown() || firstPageTurn) && !_vm->hasGameEnded()) { // Check for the last page if (page == 22) return; @@ -313,7 +313,7 @@ void BSpit::xbait(const ArgumentArray &args) { _vm->_cursor->setCursor(kRivenPelletCursor); // Loop until the player lets go (or quits) - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { _vm->doFrame(); } @@ -369,7 +369,7 @@ void BSpit::xbaitplate(const ArgumentArray &args) { _vm->getCard()->drawPicture(3); // Loop until the player lets go (or quits) - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { _vm->doFrame(); } @@ -485,7 +485,7 @@ void BSpit::xbchipper(const ArgumentArray &args) { Common::Point startPos = getMouseDragStartPosition(); bool pulledLever = false; - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { Common::Point pos = getMousePosition(); if (pos.y > startPos.y) { pulledLever = true; diff --git a/engines/mohawk/riven_stacks/domespit.cpp b/engines/mohawk/riven_stacks/domespit.cpp index dfbb0b40c5..592ffeb221 100644 --- a/engines/mohawk/riven_stacks/domespit.cpp +++ b/engines/mohawk/riven_stacks/domespit.cpp @@ -150,7 +150,7 @@ void DomeSpit::dragDomeSlider(uint16 startHotspot) { // We've clicked down, so show the closed hand cursor _vm->_cursor->setCursor(kRivenClosedHandCursor); - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { int16 hoveredHotspot = getSliderSlotAtPos(startHotspot, getMousePosition()); if (hoveredHotspot >= 0) { if (hoveredHotspot > draggedSliderSlot && draggedSliderSlot < 24 && !isSliderAtSlot(draggedSliderSlot + 1)) { diff --git a/engines/mohawk/riven_stacks/jspit.cpp b/engines/mohawk/riven_stacks/jspit.cpp index f99664535d..6a29145e4a 100644 --- a/engines/mohawk/riven_stacks/jspit.cpp +++ b/engines/mohawk/riven_stacks/jspit.cpp @@ -108,7 +108,7 @@ void JSpit::xcheckicons(const ArgumentArray &args) { _vm->_sound->playSound(46); // Wait until the stones have finished rising - while (_vm->_sound->isEffectPlaying() && !_vm->shouldQuit()) { + while (_vm->_sound->isEffectPlaying() && !_vm->hasGameEnded()) { _vm->doFrame(); } } @@ -358,7 +358,7 @@ int JSpit::jspitElevatorLoop() { _vm->_cursor->setCursor(kRivenClosedHandCursor); - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { _vm->doFrame(); Common::Point pos = getMousePosition(); @@ -388,7 +388,7 @@ void JSpit::xhandlecontrolup(const ArgumentArray &args) { // TODO: Maybe queue a sound using the stored movie opcode instead bool playedSound = false; - while (!secondVideo->endOfVideo() && !_vm->shouldQuit()) { + while (!secondVideo->endOfVideo() && !_vm->hasGameEnded()) { _vm->doFrame(); if (!playedSound && secondVideo->getTime() > 3333) { @@ -549,7 +549,7 @@ void JSpit::sunnersPlayVideo(RivenVideo *video, uint32 destCardGlobalId, bool su video->enable(); video->play(); - while (!video->endOfVideo() && !_vm->shouldQuit()) { + while (!video->endOfVideo() && !_vm->hasGameEnded()) { _vm->doFrame(); if (mouseIsDown()) { diff --git a/engines/mohawk/riven_stacks/ospit.cpp b/engines/mohawk/riven_stacks/ospit.cpp index c48bebc644..8da1698ad3 100644 --- a/engines/mohawk/riven_stacks/ospit.cpp +++ b/engines/mohawk/riven_stacks/ospit.cpp @@ -89,17 +89,17 @@ void OSpit::xbookclick(const ArgumentArray &args) { debug(0, "\tHotspot = %d -> %s", args[3], hotspotName.c_str()); // Just let the video play while we wait until Gehn opens the trap book for us - while (video->getTime() < startTime && !_vm->shouldQuit()) { + while (video->getTime() < startTime && !_vm->hasGameEnded()) { _vm->doFrame(); } // Break out if we're quitting - if (_vm->shouldQuit()) + if (_vm->hasGameEnded()) return; // OK, Gehn has opened the trap book and has asked us to go in. Let's watch // and see what the player will do... - while (video->getTime() < endTime && !_vm->shouldQuit()) { + while (video->getTime() < endTime && !_vm->hasGameEnded()) { if (hotspotRect.contains(getMousePosition())) _vm->_cursor->setCursor(kRivenOpenHandCursor); else @@ -135,7 +135,7 @@ void OSpit::xbookclick(const ArgumentArray &args) { } // Break out if we're quitting - if (_vm->shouldQuit()) + if (_vm->hasGameEnded()) return; // If there was no click and this is the third time Gehn asks us to @@ -218,7 +218,7 @@ void OSpit::xogehnbooknextpage(const ArgumentArray &args) { // Keep turning pages while the mouse is pressed bool firstPageTurn = true; - while ((mouseIsDown() || firstPageTurn) && !_vm->shouldQuit()) { + while ((mouseIsDown() || firstPageTurn) && !_vm->hasGameEnded()) { // Check for the last page if (page == 13) return; @@ -243,7 +243,7 @@ void OSpit::xgwatch(const ArgumentArray &args) { uint32 prisonCombo = _vm->_vars["pcorrectorder"]; byte curSound = 0; - while (curSound < 5 && !_vm->shouldQuit()) { + while (curSound < 5 && !_vm->hasGameEnded()) { // Play a sound every half second _vm->_sound->playSound(getComboDigit(prisonCombo, curSound) + 13); _vm->delay(500); diff --git a/engines/mohawk/riven_stacks/tspit.cpp b/engines/mohawk/riven_stacks/tspit.cpp index 54eae99fc9..3abd0a6b43 100644 --- a/engines/mohawk/riven_stacks/tspit.cpp +++ b/engines/mohawk/riven_stacks/tspit.cpp @@ -369,7 +369,7 @@ void TSpit::xtakeit(const ArgumentArray &args) { _vm->getCard()->drawPicture(1); // Loop until the player lets go (or quits) - while (mouseIsDown() && !_vm->shouldQuit()) { + while (mouseIsDown() && !_vm->hasGameEnded()) { _vm->doFrame(); } |
