[Scummvm-git-logs] scummvm master -> 8f350905e99d27a9e4a5428e8300511b156bf03f

bgK bastien.bouclet at gmail.com
Wed Jan 30 08:51:45 CET 2019


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:
8f350905e9 MOHAWK: RIVEN: Patch Jungle island book closing animation script


Commit: 8f350905e99d27a9e4a5428e8300511b156bf03f
    https://github.com/scummvm/scummvm/commit/8f350905e99d27a9e4a5428e8300511b156bf03f
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2019-01-30T08:46:01+01:00

Commit Message:
MOHAWK: RIVEN: Patch Jungle island book closing animation script

Fixes #10880.

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


diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp
index 3612232..555688c 100644
--- a/engines/mohawk/riven_card.cpp
+++ b/engines/mohawk/riven_card.cpp
@@ -83,6 +83,7 @@ void RivenCard::applyPatches(uint16 id) {
 
 	applyPropertiesPatch22118(globalId);
 	applyPropertiesPatchE2E(globalId);
+	applyPropertiesPatch1518D(globalId);
 }
 
 void RivenCard::applyPropertiesPatch8EB7(uint32 globalId) {
@@ -410,6 +411,62 @@ void RivenCard::applyPropertiesPatchE2E(uint32 globalId) {
 	}
 }
 
+void RivenCard::applyPropertiesPatch1518D(uint32 globalId) {
+	// Inside Jungle Island's dome, when looking at the open book,
+	// stepping back from the stand and then looking at the book
+	// again, the book closing animation would play again.
+	//
+	// Comparing the scripts for the Jungle dome and the other domes
+	// shows a small portion of script is missing.
+	// The following patch adds it back so the jungle dome script
+	// matches the other domes.
+	//
+	// Added script part:
+	//   == Script 2 ==
+	//   [...]
+	//   type: CardEnter
+	//   switch (jbook) {
+	//   case 2:
+	//     playMovieBlocking(1);
+	//     jbook = 0;
+	//     refreshCard();
+	//     break;
+	//   }
+	if (globalId == 0x1518D) {
+		uint16 jBookVariable = _vm->getStack()->getIdFromName(kVariableNames, "jbook");
+		uint16 patchData[] = {
+		        1, // Command count in script
+		        kRivenCommandSwitch,
+		        2, // Unused
+		        jBookVariable,
+		        1, // Branches count
+
+		        2, // jbook == 2 branch
+		        3, // Command count in sub-script
+
+		        kRivenCommandPlayMovieBlocking,
+		        1, // Argument count
+		        1, // Video id
+
+		        kRivenCommandSetVariable,
+		        2, // Argument count
+		        jBookVariable,
+		        0, // Variable value
+
+		        kRivenCommandRefreshCard,
+		        0 // Argument count
+		};
+
+		RivenScriptPtr patchScript = _vm->_scriptMan->readScriptFromData(patchData, ARRAYSIZE(patchData));
+
+		// Append the patch to the existing script
+		RivenScriptPtr loadScript = getScript(kCardEnterScript);
+		loadScript += patchScript;
+
+		debugC(kRivenDebugPatches, "Applied jungle book close loop to card %x", globalId);
+	}
+}
+
 void RivenCard::moveHotspot(uint16 blstId, const Common::Rect &position) {
 	RivenHotspot *hotspot = getHotspotByBlstId(blstId);
 	if (!hotspot) {
diff --git a/engines/mohawk/riven_card.h b/engines/mohawk/riven_card.h
index 5eae4c0..e12b127 100644
--- a/engines/mohawk/riven_card.h
+++ b/engines/mohawk/riven_card.h
@@ -153,6 +153,7 @@ private:
 	void loadCardWaterEffectList(uint16 id);
 	void applyPatches(uint16 id);
 	void applyPropertiesPatchE2E(uint32 globalId);
+	void applyPropertiesPatch1518D(uint32 globalId);
 	void applyPropertiesPatch8EB7(uint32 globalId);
 	void applyPropertiesPatch2E76(uint32 globalId);
 	void applyPropertiesPatch22118(uint32 globalId);
diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h
index c7c4980..149fb47 100644
--- a/engines/mohawk/riven_scripts.h
+++ b/engines/mohawk/riven_scripts.h
@@ -75,7 +75,7 @@ enum RivenCommandType {
 	kRivenCommandDisableMovie        = 28,
 	kRivenCommandDisableAllMovies    = 29,
 	kRivenCommandEnableMovie         = 31,
-	kRivenCommandlayMovieBlocking    = 32,
+	kRivenCommandPlayMovieBlocking   = 32,
 	kRivenCommandPlayMovie           = 33,
 	kRivenCommandStopMovie           = 34,
 	kRivenCommandUnk36               = 36,





More information about the Scummvm-git-logs mailing list