diff options
author | Bastien Bouclet | 2017-11-19 16:40:49 +0100 |
---|---|---|
committer | Bastien Bouclet | 2017-11-26 15:11:12 +0100 |
commit | 83b27d263e1433a134b53b66919566c3192ca116 (patch) | |
tree | 6ed3a0b242e519d7e6ad950cbf64fa4afbb89fbd /engines/mohawk/riven_stack.cpp | |
parent | 81defa74966c59a1463ba791bf8c6f7e87c80f0c (diff) | |
download | scummvm-rg350-83b27d263e1433a134b53b66919566c3192ca116.tar.gz scummvm-rg350-83b27d263e1433a134b53b66919566c3192ca116.tar.bz2 scummvm-rg350-83b27d263e1433a134b53b66919566c3192ca116.zip |
MOHAWK: RIVEN: Allow turning book pages more quickly
Fixes #10075
Diffstat (limited to 'engines/mohawk/riven_stack.cpp')
-rw-r--r-- | engines/mohawk/riven_stack.cpp | 22 |
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() { |