aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_card.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-01-30 08:43:49 +0100
committerBastien Bouclet2019-01-30 08:46:01 +0100
commit8f350905e99d27a9e4a5428e8300511b156bf03f (patch)
tree95a5871d488557904d92e9d29bd28bd7c4fb4434 /engines/mohawk/riven_card.cpp
parent662791a9616fe5bd9eb81e7e231785b8e508cc70 (diff)
downloadscummvm-rg350-8f350905e99d27a9e4a5428e8300511b156bf03f.tar.gz
scummvm-rg350-8f350905e99d27a9e4a5428e8300511b156bf03f.tar.bz2
scummvm-rg350-8f350905e99d27a9e4a5428e8300511b156bf03f.zip
MOHAWK: RIVEN: Patch Jungle island book closing animation script
Fixes #10880.
Diffstat (limited to 'engines/mohawk/riven_card.cpp')
-rw-r--r--engines/mohawk/riven_card.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp
index 3612232b23..555688ce7e 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) {