diff options
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; } |