[Scummvm-git-logs] scummvm master -> 31d428fd022686e4a1918b6c7748265f209a7952

bgK bastien.bouclet at gmail.com
Wed Jul 5 19:14:19 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
31d428fd02 MOHAWK: Use movie slots instead of movie ids for stored opcodes


Commit: 31d428fd022686e4a1918b6c7748265f209a7952
    https://github.com/scummvm/scummvm/commit/31d428fd022686e4a1918b6c7748265f209a7952
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-07-05T19:13:32+02:00

Commit Message:
MOHAWK: Use movie slots instead of movie ids for stored opcodes

Fixes Trac#9873.

Changed paths:
    engines/mohawk/riven_scripts.cpp
    engines/mohawk/riven_scripts.h
    engines/mohawk/riven_video.cpp


diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 72284c6..f9da8a1 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 63f6ea3..d5bce5b 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 56cbd44..762f807 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();
 	}
 





More information about the Scummvm-git-logs mailing list