aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/riven_stack.cpp')
-rw-r--r--engines/mohawk/riven_stack.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp
index c90642adf1..7d3d1057a3 100644
--- a/engines/mohawk/riven_stack.cpp
+++ b/engines/mohawk/riven_stack.cpp
@@ -321,7 +321,6 @@ void RivenStack::onKeyPressed(const Common::KeyState &keyState) {
if (!script->empty()) {
_vm->_scriptMan->runScript(script, true);
- keyResetAction();
}
}
}
@@ -414,16 +413,7 @@ void RivenStack::removeTimer() {
_timerTime = 0;
}
-bool RivenStack::pageTurn(RivenTransition transition) {
- // Wait until the previous page turn sound completes
- while (_vm->_sound->isEffectPlaying() && !_vm->hasGameEnded()) {
- if (!mouseIsDown()) {
- return false;
- }
-
- _vm->doFrame();
- }
-
+void RivenStack::pageTurn(RivenTransition transition) {
// Play the page turning sound
const char *soundName = nullptr;
if (_vm->_rnd->getRandomBit())
@@ -435,8 +425,16 @@ bool RivenStack::pageTurn(RivenTransition transition) {
// Now update the screen :)
_vm->_gfx->scheduleTransition(transition);
+}
+
+bool RivenStack::keepTurningPages() {
+ return (mouseIsDown() || keyGetAction() != kKeyActionNone) && !_vm->shouldQuit();
+}
- return true;
+void RivenStack::waitForPageTurnSound() {
+ while (_vm->_sound->isEffectPlaying() && keepTurningPages()) {
+ _vm->doFrame();
+ }
}
RivenNameList::RivenNameList() {