From 31d428fd022686e4a1918b6c7748265f209a7952 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 5 Jul 2017 19:10:41 +0200 Subject: MOHAWK: Use movie slots instead of movie ids for stored opcodes Fixes Trac#9873. --- engines/mohawk/riven_scripts.cpp | 8 ++++---- engines/mohawk/riven_scripts.h | 4 ++-- engines/mohawk/riven_video.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 72284c643b..f9da8a11f9 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -47,7 +47,7 @@ RivenScriptManager::RivenScriptManager(MohawkEngine_Riven *vm) : _stoppingAllScripts(false) { _storedMovieOpcode.time = 0; - _storedMovieOpcode.id = 0; + _storedMovieOpcode.slot = 0; } RivenScriptManager::~RivenScriptManager() { @@ -101,7 +101,7 @@ void RivenScriptManager::stopAllScripts() { void RivenScriptManager::setStoredMovieOpcode(const StoredMovieOpcode &op) { clearStoredMovieOpcode(); _storedMovieOpcode.script = op.script; - _storedMovieOpcode.id = op.id; + _storedMovieOpcode.slot = op.slot; _storedMovieOpcode.time = op.time; } @@ -115,7 +115,7 @@ void RivenScriptManager::runStoredMovieOpcode() { void RivenScriptManager::clearStoredMovieOpcode() { _storedMovieOpcode.script = RivenScriptPtr(); _storedMovieOpcode.time = 0; - _storedMovieOpcode.id = 0; + _storedMovieOpcode.slot = 0; } void RivenScriptManager::runScript(const RivenScriptPtr &script, bool queue) { @@ -573,7 +573,7 @@ void RivenSimpleCommand::storeMovieOpcode(uint16 op, const ArgumentArray &args) RivenScriptManager::StoredMovieOpcode storedOp; storedOp.script = _vm->_scriptMan->createScriptFromData(1, args[3], 1, args[4]); storedOp.time = delayTime; - storedOp.id = args[0]; + storedOp.slot = args[0]; // Store the opcode for later _vm->_scriptMan->setStoredMovieOpcode(storedOp); diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 63f6ea31a6..d5bce5bf44 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -212,10 +212,10 @@ public: struct StoredMovieOpcode { RivenScriptPtr script; uint32 time; - uint16 id; + uint16 slot; }; - uint16 getStoredMovieOpcodeID() { return _storedMovieOpcode.id; } + uint16 getStoredMovieOpcodeSlot() { return _storedMovieOpcode.slot; } uint32 getStoredMovieOpcodeTime() { return _storedMovieOpcode.time; } void setStoredMovieOpcode(const StoredMovieOpcode &op); void runStoredMovieOpcode(); diff --git a/engines/mohawk/riven_video.cpp b/engines/mohawk/riven_video.cpp index 56cbd443bd..762f80719f 100644 --- a/engines/mohawk/riven_video.cpp +++ b/engines/mohawk/riven_video.cpp @@ -257,9 +257,9 @@ void RivenVideo::playBlocking(int32 endTime) { } // Execute the stored opcode - uint16 storedOpcodeId = _vm->_scriptMan->getStoredMovieOpcodeID(); + uint16 storedOpcodeMovieSlot = _vm->_scriptMan->getStoredMovieOpcodeSlot(); uint32 storedOpcodeTime = _vm->_scriptMan->getStoredMovieOpcodeTime(); - if (_id == storedOpcodeId && getTime() >= storedOpcodeTime) { // CHECKME: Suspicious use of time units + if (_slot == storedOpcodeMovieSlot && getTime() >= storedOpcodeTime) { // CHECKME: Suspicious use of time units _vm->_scriptMan->runStoredMovieOpcode(); } -- cgit v1.2.3