aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-05 19:10:41 +0200
committerBastien Bouclet2017-07-05 19:13:32 +0200
commit31d428fd022686e4a1918b6c7748265f209a7952 (patch)
treeb8782230136973091aa2acfb9176c04e5a7c3e86
parentafe27c6de8ea2419e38fcc2e847bbc28d629c553 (diff)
downloadscummvm-rg350-31d428fd022686e4a1918b6c7748265f209a7952.tar.gz
scummvm-rg350-31d428fd022686e4a1918b6c7748265f209a7952.tar.bz2
scummvm-rg350-31d428fd022686e4a1918b6c7748265f209a7952.zip
MOHAWK: Use movie slots instead of movie ids for stored opcodes
Fixes Trac#9873.
-rw-r--r--engines/mohawk/riven_scripts.cpp8
-rw-r--r--engines/mohawk/riven_scripts.h4
-rw-r--r--engines/mohawk/riven_video.cpp4
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();
}