diff options
author | Bastien Bouclet | 2017-02-04 14:34:45 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
commit | f0267d542f860a2f67f519a1dc5343e020927c81 (patch) | |
tree | bd4dac2d31f30dbe1512baf3738c315d16469240 /engines/mohawk/riven_scripts.cpp | |
parent | 7609ec0de81d7be4ed6d0e3e6e0303f42d54ad52 (diff) | |
download | scummvm-rg350-f0267d542f860a2f67f519a1dc5343e020927c81.tar.gz scummvm-rg350-f0267d542f860a2f67f519a1dc5343e020927c81.tar.bz2 scummvm-rg350-f0267d542f860a2f67f519a1dc5343e020927c81.zip |
MOHAWK: Keep turning pages while the mouse is pressed in Atrus' book
Diffstat (limited to 'engines/mohawk/riven_scripts.cpp')
-rw-r--r-- | engines/mohawk/riven_scripts.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 27f0022446..7b95abb077 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -41,8 +41,10 @@ static void printTabs(byte tabs) { debugN("\t"); } -RivenScriptManager::RivenScriptManager(MohawkEngine_Riven *vm) { - _vm = vm; +RivenScriptManager::RivenScriptManager(MohawkEngine_Riven *vm) : + _vm(vm), + _runningQueuedScripts(false) { + _storedMovieOpcode.time = 0; _storedMovieOpcode.id = 0; } @@ -129,6 +131,18 @@ bool RivenScriptManager::hasQueuedScripts() const { return !_queue.empty(); } +void RivenScriptManager::runQueuedScripts() { + _runningQueuedScripts = true; + + for (uint i = 0; i < _queue.size(); i++) { + _queue[i]->run(); + } + + _queue.clear(); + + _runningQueuedScripts = false; +} + RivenScriptPtr RivenScriptManager::createScriptFromData(uint16 commandCount, ...) { va_list args; va_start(args, commandCount); @@ -169,6 +183,10 @@ RivenScriptPtr RivenScriptManager::createScriptWithCommand(RivenCommand *command return script; } +bool RivenScriptManager::runningQueuedScripts() const { + return _runningQueuedScripts; +} + RivenScript::RivenScript() { _continueRunning = true; } |