aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2012-12-16 13:20:50 +0100
committerBastien Bouclet2012-12-16 13:20:50 +0100
commit80a30286a2e2707bf7a7269a8192ebe729379c2a (patch)
treeba6d084af6dd2fc1c8a9f9cc19816a80a7eb66dd
parentc5f368d115145cab2ef209c66d47a8f6a091fc2c (diff)
downloadscummvm-rg350-80a30286a2e2707bf7a7269a8192ebe729379c2a.tar.gz
scummvm-rg350-80a30286a2e2707bf7a7269a8192ebe729379c2a.tar.bz2
scummvm-rg350-80a30286a2e2707bf7a7269a8192ebe729379c2a.zip
MOHAWK: Fix opening the library in Myst Demo
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp2
-rw-r--r--engines/mohawk/myst_stacks/myst.h4
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp18
-rw-r--r--engines/mohawk/myst_stacks/preview.h3
4 files changed, 25 insertions, 2 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index f404b23f29..f17d765c99 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -610,6 +610,8 @@ uint16 Myst::getVar(uint16 var) {
return 1;
case 302: // Green Book Opened Before Flag
return _state.greenBookOpenedBefore;
+ case 303: // Library Bookcase status changed
+ return _libraryBookcaseChanged;
case 304: // Tower Rotation Map Initialized
return _towerRotationMapInitialized;
case 305: // Cabin Boiler Lit
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 8ecb3e4755..de88843d59 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -43,7 +43,7 @@ public:
virtual void disablePersistentScripts();
virtual void runPersistentScripts();
-private:
+protected:
void setupOpcodes();
uint16 getVar(uint16 var);
void toggleVar(uint16 var);
@@ -52,7 +52,7 @@ private:
virtual uint16 getMap() { return 9934; }
void towerRotationMap_run();
- void libraryBookcaseTransform_run();
+ virtual void libraryBookcaseTransform_run();
void generatorControlRoom_run();
void opcode_212_run();
void libraryCombinationBook_run();
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index 608bd0adc9..75e870281e 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -60,6 +60,7 @@ void Preview::setupOpcodes() {
OVERRIDE_OPCODE(199, o_speechStop);
// "Init" Opcodes
+ OVERRIDE_OPCODE(209, o_libraryBookcaseTransformDemo_init);
OPCODE(298, o_speech_init);
OPCODE(299, o_library_init);
}
@@ -241,5 +242,22 @@ void Preview::o_library_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
_library = static_cast<MystResourceType8 *>(_invokingResource);
}
+void Preview::o_libraryBookcaseTransformDemo_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ if (_libraryBookcaseChanged) {
+ MystResourceType7 *resource = static_cast<MystResourceType7 *>(_invokingResource);
+ _libraryBookcaseMovie = static_cast<MystResourceType6 *>(resource->getSubResource(getVar(303)));
+ _libraryBookcaseSoundId = argv[0];
+ _libraryBookcaseMoving = true;
+ }
+}
+
+void Preview::libraryBookcaseTransform_run() {
+ if (_libraryBookcaseChanged)
+ _state.libraryBookcaseDoor = !_state.libraryBookcaseDoor;
+
+ Myst::libraryBookcaseTransform_run();
+}
+
+
} // End of namespace MystStacks
} // End of namespace Mohawk
diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h
index 1e4ff3efb4..706220e8ed 100644
--- a/engines/mohawk/myst_stacks/preview.h
+++ b/engines/mohawk/myst_stacks/preview.h
@@ -51,6 +51,7 @@ private:
DECLARE_OPCODE(o_stayHere);
DECLARE_OPCODE(o_speechStop);
+ DECLARE_OPCODE(o_libraryBookcaseTransformDemo_init);
DECLARE_OPCODE(o_speech_init);
DECLARE_OPCODE(o_library_init);
@@ -65,6 +66,8 @@ private:
void speech_run();
void speechUpdateCue();
+
+ void libraryBookcaseTransform_run();
};
} // End of namespace MystStacks