aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-18 18:23:37 -0400
committerMatthew Hoops2011-05-18 18:23:37 -0400
commitd4c92983920cfe3b25a22d91e12c750e591b917e (patch)
treec0b63318b9ba0e67528337cfaa21515def1c3962 /engines/mohawk/myst_stacks
parent7e2edf16b3e2bf1d2b31999979a60802514df6cb (diff)
parentcf107e24be28c7e6db65b5c7ffed120af4a7994b (diff)
downloadscummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.gz
scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.tar.bz2
scummvm-rg350-d4c92983920cfe3b25a22d91e12c750e591b917e.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/channelwood.cpp7
-rw-r--r--engines/mohawk/myst_stacks/channelwood.h5
-rw-r--r--engines/mohawk/myst_stacks/credits.cpp3
-rw-r--r--engines/mohawk/myst_stacks/credits.h3
-rw-r--r--engines/mohawk/myst_stacks/demo.cpp3
-rw-r--r--engines/mohawk/myst_stacks/demo.h3
-rw-r--r--engines/mohawk/myst_stacks/dni.cpp3
-rw-r--r--engines/mohawk/myst_stacks/dni.h3
-rw-r--r--engines/mohawk/myst_stacks/intro.cpp3
-rw-r--r--engines/mohawk/myst_stacks/intro.h3
-rw-r--r--engines/mohawk/myst_stacks/makingof.cpp3
-rw-r--r--engines/mohawk/myst_stacks/makingof.h3
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp362
-rw-r--r--engines/mohawk/myst_stacks/mechanical.h57
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp5
-rw-r--r--engines/mohawk/myst_stacks/myst.h5
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp3
-rw-r--r--engines/mohawk/myst_stacks/preview.h3
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp3
-rw-r--r--engines/mohawk/myst_stacks/selenitic.h5
-rw-r--r--engines/mohawk/myst_stacks/slides.cpp3
-rw-r--r--engines/mohawk/myst_stacks/slides.h3
-rw-r--r--engines/mohawk/myst_stacks/stoneship.cpp3
-rw-r--r--engines/mohawk/myst_stacks/stoneship.h5
24 files changed, 308 insertions, 191 deletions
diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp
index cba2583a50..0dd69a673a 100644
--- a/engines/mohawk/myst_stacks/channelwood.cpp
+++ b/engines/mohawk/myst_stacks/channelwood.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/cursors.h"
@@ -333,7 +330,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 a
_vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333));
_vm->_system->updateScreen();
- _vm->_system->delayMillis(10);
+
_vm->changeToCard(cardId, true);
if (argc == 3) {
@@ -351,7 +348,6 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint1
for (uint16 imageId = 3601; imageId >= 3595; imageId--) {
_vm->_gfx->copyImageToScreen(imageId, rect);
_vm->_system->updateScreen();
- _vm->_system->delayMillis(5);
}
pipeChangeValve(true, 0x80);
@@ -666,7 +662,6 @@ void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint
for (uint16 imageId = 3595; imageId <= 3601; imageId++) {
_vm->_gfx->copyImageToScreen(imageId, rect);
_vm->_system->updateScreen();
- _vm->_system->delayMillis(5);
}
pipeChangeValve(false, 0x80);
diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h
index 5eeaa63e23..a3ea406003 100644
--- a/engines/mohawk/myst_stacks/channelwood.h
+++ b/engines/mohawk/myst_stacks/channelwood.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_CHANNELWOOD_H
@@ -52,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9932; }
+
DECLARE_OPCODE(o_bridgeToggle);
DECLARE_OPCODE(o_pipeExtend);
DECLARE_OPCODE(o_drawImageChangeCardAndVolume);
diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp
index bb8397fd09..ad593e3542 100644
--- a/engines/mohawk/myst_stacks/credits.cpp
+++ b/engines/mohawk/myst_stacks/credits.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/credits.h b/engines/mohawk/myst_stacks/credits.h
index 4f9eaa2944..a1f8b0a7d8 100644
--- a/engines/mohawk/myst_stacks/credits.h
+++ b/engines/mohawk/myst_stacks/credits.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_CREDITS_H
diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp
index a2dd148b22..53d946dd66 100644
--- a/engines/mohawk/myst_stacks/demo.cpp
+++ b/engines/mohawk/myst_stacks/demo.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/demo.h b/engines/mohawk/myst_stacks/demo.h
index 054dc7befe..4f8d68759b 100644
--- a/engines/mohawk/myst_stacks/demo.h
+++ b/engines/mohawk/myst_stacks/demo.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_DEMO_H
diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp
index e2a11eb94f..cf28945c71 100644
--- a/engines/mohawk/myst_stacks/dni.cpp
+++ b/engines/mohawk/myst_stacks/dni.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h
index b50f018d3e..7f04287082 100644
--- a/engines/mohawk/myst_stacks/dni.h
+++ b/engines/mohawk/myst_stacks/dni.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_DNI_H
diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp
index 0d8f67a85b..7d3179fa24 100644
--- a/engines/mohawk/myst_stacks/intro.cpp
+++ b/engines/mohawk/myst_stacks/intro.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h
index 0ecd9e6883..9fe3920e53 100644
--- a/engines/mohawk/myst_stacks/intro.h
+++ b/engines/mohawk/myst_stacks/intro.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_INTRO_H
diff --git a/engines/mohawk/myst_stacks/makingof.cpp b/engines/mohawk/myst_stacks/makingof.cpp
index e639092ed4..b5ad647381 100644
--- a/engines/mohawk/myst_stacks/makingof.cpp
+++ b/engines/mohawk/myst_stacks/makingof.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/makingof.h b/engines/mohawk/myst_stacks/makingof.h
index 3033bb851e..d4bc0fd9f2 100644
--- a/engines/mohawk/myst_stacks/makingof.h
+++ b/engines/mohawk/myst_stacks/makingof.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_MAKINGOF_H
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index c5c11026f5..d6dd1b5407 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/cursors.h"
@@ -54,11 +51,26 @@ Mechanical::~Mechanical() {
void Mechanical::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, o_throneEnablePassage);
+ OPCODE(101, o_birdCrankStart);
+ OPCODE(102, NOP);
+ OPCODE(103, o_birdCrankStop);
OPCODE(104, o_snakeBoxTrigger);
OPCODE(105, o_fortressStaircaseMovie);
OPCODE(106, o_elevatorRotationStart);
OPCODE(107, o_elevatorRotationMove);
OPCODE(108, o_elevatorRotationStop);
+ OPCODE(109, o_fortressRotationSpeedStart);
+ OPCODE(110, o_fortressRotationSpeedMove);
+ OPCODE(111, o_fortressRotationSpeedStop);
+ OPCODE(112, o_fortressRotationBrakeStart);
+ OPCODE(113, o_fortressRotationBrakeMove);
+ OPCODE(114, o_fortressRotationBrakeStop);
+ OPCODE(115, o_fortressSimulationSpeedStart);
+ OPCODE(116, o_fortressSimulationSpeedMove);
+ OPCODE(117, o_fortressSimulationSpeedStop);
+ OPCODE(118, o_fortressSimulationBrakeStart);
+ OPCODE(119, o_fortressSimulationBrakeMove);
+ OPCODE(120, o_fortressSimulationBrakeStop);
OPCODE(121, o_elevatorWindowMovie);
OPCODE(122, o_elevatorGoMiddle);
OPCODE(123, o_elevatorTopMovie);
@@ -75,12 +87,12 @@ void Mechanical::setupOpcodes() {
// "Init" Opcodes
OPCODE(200, o_throne_init);
OPCODE(201, o_fortressStaircase_init);
- OPCODE(202, opcode_202);
+ OPCODE(202, o_bird_init);
OPCODE(203, o_snakeBox_init);
OPCODE(204, o_elevatorRotation_init);
- OPCODE(205, opcode_205);
- OPCODE(206, opcode_206);
- OPCODE(209, opcode_209);
+ OPCODE(205, o_fortressRotation_init);
+ OPCODE(206, o_fortressSimulation_init);
+ OPCODE(209, o_fortressSimulationStartup_init);
// "Exit" Opcodes
OPCODE(300, NOP);
@@ -89,15 +101,15 @@ void Mechanical::setupOpcodes() {
#undef OPCODE
void Mechanical::disablePersistentScripts() {
- opcode_202_disable();
- opcode_205_disable();
- opcode_206_disable();
- opcode_209_disable();
+ _fortressSimulationRunning = false;
_elevatorGoingMiddle = false;
+ _birdSinging = false;
+ _fortressRotationRunning = false;
}
void Mechanical::runPersistentScripts() {
- opcode_202_run();
+ if (_birdSinging)
+ birdSing_run();
if (_elevatorRotationLeverMoving)
elevatorRotation_run();
@@ -105,9 +117,11 @@ void Mechanical::runPersistentScripts() {
if (_elevatorGoingMiddle)
elevatorGoMiddle_run();
- opcode_205_run();
- opcode_206_run();
- opcode_209_run();
+ if (_fortressRotationRunning)
+ fortressRotation_run();
+
+ if (_fortressSimulationRunning)
+ fortressSimulation_run();
}
uint16 Mechanical::getVar(uint16 var) {
@@ -245,6 +259,38 @@ void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint1
_vm->_resources[argv[0]]->setEnabled(getVar(var));
}
+void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op);
+
+ MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource);
+
+ uint16 crankSoundId = crank->getList2(0);
+ _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true);
+
+ _birdSingEndTime = 0;
+ _birdCrankStartTime = _vm->_system->getMillis();
+
+ MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0));
+ crankMovie->playMovie();
+}
+
+void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op);
+
+ MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource);
+
+ MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0));
+ crankMovie->pauseMovie(true);
+
+ uint16 crankSoundId = crank->getList2(1);
+ _vm->_sound->replaceSoundMyst(crankSoundId);
+
+ _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime;
+ _birdSinging = true;
+
+ _bird->playMovie();
+}
+
void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op);
@@ -346,6 +392,164 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint
_vm->checkCursorHints();
}
+void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation speed lever start", op);
+
+ _vm->_cursor->setCursor(700);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(0);
+}
+
+void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op);
+
+ const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Make the handle follow the mouse
+ int16 maxStep = lever->getNumFrames() - 1;
+ Common::Rect rect = lever->getRect();
+ int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65;
+ step = CLIP<int16>(step, 0, maxStep);
+
+ _fortressRotationSpeed = step;
+
+ // Draw current frame
+ lever->drawFrame(step);
+}
+
+void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Release lever
+ for (int i = _fortressRotationSpeed; i >= 0; i--) {
+ lever->drawFrame(i);
+ _vm->_system->delayMillis(10);
+ }
+
+ _fortressRotationSpeed = 0;
+
+ _vm->checkCursorHints();
+}
+
+void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation brake lever start", op);
+
+ _vm->_cursor->setCursor(700);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(_fortressRotationBrake);
+}
+
+void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op);
+
+ const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Make the handle follow the mouse
+ int16 maxStep = lever->getNumFrames() - 1;
+ Common::Rect rect = lever->getRect();
+ int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65;
+ step = CLIP<int16>(step, 0, maxStep);
+
+ _fortressRotationBrake = step;
+
+ // Draw current frame
+ lever->drawFrame(step);
+}
+
+void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(_fortressRotationBrake);
+
+ _vm->checkCursorHints();
+}
+
+void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever start", op);
+
+ _vm->_cursor->setCursor(700);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(0);
+}
+
+void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op);
+
+ const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Make the handle follow the mouse
+ int16 maxStep = lever->getNumFrames() - 1;
+ Common::Rect rect = lever->getRect();
+ int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height();
+ step = CLIP<int16>(step, 0, maxStep);
+
+ _fortressSimulationSpeed = step;
+
+ // Draw current frame
+ lever->drawFrame(step);
+}
+
+void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Release lever
+ for (int i = _fortressSimulationSpeed; i >= 0; i--) {
+ lever->drawFrame(i);
+ _vm->_system->delayMillis(10);
+ }
+
+ _fortressSimulationSpeed = 0;
+
+ _vm->checkCursorHints();
+}
+
+void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever start", op);
+
+ _vm->_cursor->setCursor(700);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(_fortressSimulationBrake);
+}
+
+void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op);
+
+ const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos();
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+
+ // Make the handle follow the mouse
+ int16 maxStep = lever->getNumFrames() - 1;
+ Common::Rect rect = lever->getRect();
+ int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height();
+ step = CLIP<int16>(step, 0, maxStep);
+
+ _fortressSimulationBrake = step;
+
+ // Draw current frame
+ lever->drawFrame(step);
+}
+
+void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op);
+
+ MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource);
+ lever->drawFrame(_fortressSimulationBrake);
+
+ _vm->checkCursorHints();
+}
+
void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
uint16 startTime = argv[0];
uint16 endTime = argv[1];
@@ -515,25 +719,21 @@ void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, ui
_vm->_resources[argv[2]]->setEnabled(_state.staircaseState);
}
-static struct {
- bool enabled;
-} g_opcode202Parameters;
-
-void Mechanical::opcode_202_run() {
+void Mechanical::birdSing_run() {
// Used for Card 6220 (Sirrus' Mechanical Bird)
- // TODO: Fill in Function
+ uint32 time = _vm->_system->getMillis();
+ if (_birdSingEndTime < time) {
+ _bird->pauseMovie(true);
+ _birdSinging = false;
+ }
}
-void Mechanical::opcode_202_disable() {
- g_opcode202Parameters.enabled = false;
-}
+void Mechanical::o_bird_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Mechanical bird init", op);
-void Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- // Used for Card 6220 (Sirrus' Mechanical Bird)
- if (argc == 0)
- g_opcode202Parameters.enabled = true;
- else
- unknown(op, var, argc, argv);
+ _birdSinging = false;
+ _birdSingEndTime = 0;
+ _bird = static_cast<MystResourceType6 *>(_invokingResource);
}
void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
@@ -567,101 +767,53 @@ void Mechanical::o_elevatorRotation_init(uint16 op, uint16 var, uint16 argc, uin
_elevatorRotationLeverMoving = false;
}
-static struct {
- uint16 soundIdPosition[4];
-
- bool enabled;
-} g_opcode205Parameters;
-
-void Mechanical::opcode_205_run() {
+void Mechanical::fortressRotation_run() {
// Used for Card 6156 (Fortress Rotation Controls)
// TODO: Fill in function...
- // g_opcode205Parameters.soundIdPosition[4]
-}
-
-void Mechanical::opcode_205_disable() {
- g_opcode205Parameters.enabled = false;
-}
-
-void Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
-
- // Used for Card 6156 (Fortress Rotation Controls)
-
- if (argc == 4) {
- g_opcode205Parameters.soundIdPosition[0] = argv[0];
- g_opcode205Parameters.soundIdPosition[1] = argv[1];
- g_opcode205Parameters.soundIdPosition[2] = argv[2];
- g_opcode205Parameters.soundIdPosition[3] = argv[3];
-
- g_opcode205Parameters.enabled = true;
- } else
- unknown(op, var, argc, argv);
}
-static struct {
- uint16 soundIdStart[2];
- uint16 soundIdPosition[4];
+void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Fortress rotation init", op);
- bool enabled;
-} g_opcode206Parameters;
+ _fortressRotationGears = static_cast<MystResourceType6 *>(_invokingResource);
-void Mechanical::opcode_206_run() {
- if (g_opcode206Parameters.enabled) {
- // Used for Card 6044 (Fortress Rotation Simulator)
+ _fortressRotationSounds[0] = argv[0];
+ _fortressRotationSounds[1] = argv[1];
+ _fortressRotationSounds[2] = argv[2];
+ _fortressRotationSounds[3] = argv[3];
- // g_opcode206Parameters.soundIdStart[2]
- // g_opcode206Parameters.soundIdPosition[4]
+ _fortressRotationBrake = 0;
- // TODO: Fill in function...
- }
+ _fortressRotationRunning = true;
}
-void Mechanical::opcode_206_disable() {
- g_opcode206Parameters.enabled = false;
-}
-
-void Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
-
+void Mechanical::fortressSimulation_run() {
// Used for Card 6044 (Fortress Rotation Simulator)
- if (argc == 6) {
- g_opcode206Parameters.soundIdStart[0] = argv[0];
- g_opcode206Parameters.soundIdStart[1] = argv[1];
- g_opcode206Parameters.soundIdPosition[0] = argv[2];
- g_opcode206Parameters.soundIdPosition[1] = argv[3];
- g_opcode206Parameters.soundIdPosition[2] = argv[4];
- g_opcode206Parameters.soundIdPosition[3] = argv[5];
-
- g_opcode206Parameters.enabled = true;
- } else
- unknown(op, var, argc, argv);
+ // TODO: Fill in function...
}
+void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op);
-static struct {
- bool enabled;
-} g_opcode209Parameters;
+ _fortressSimulationHolo = static_cast<MystResourceType6 *>(_invokingResource);
-void Mechanical::opcode_209_run() {
- // Used for Card 6044 (Fortress Rotation Simulator)
+ _fortressSimulationStartSound1 = argv[0];
+ _fortressSimulationStartSound2 = argv[1];
- // TODO: Implement Function For Secret Panel State as
- // per Opcode 200 function (Mechanical)
-}
+ _fortressRotationSounds[0] = argv[2];
+ _fortressRotationSounds[1] = argv[3];
+ _fortressRotationSounds[2] = argv[4];
+ _fortressRotationSounds[3] = argv[5];
+
+ _fortressSimulationBrake = 0;
-void Mechanical::opcode_209_disable() {
- g_opcode209Parameters.enabled = false;
+ _fortressSimulationRunning = true;
}
-void Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
+void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op);
- // Used for Card 6044 (Fortress Rotation Simulator)
- if (argc == 0)
- g_opcode209Parameters.enabled = true;
- else
- unknown(op, var, argc, argv);
+ _fortressSimulationStartup = static_cast<MystResourceType6 *>(_invokingResource);
}
} // End of namespace MystStacks
diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h
index 6a0aa30f5c..3bd7f2d71b 100644
--- a/engines/mohawk/myst_stacks/mechanical.h
+++ b/engines/mohawk/myst_stacks/mechanical.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_MECHANICAL_H
@@ -52,23 +49,34 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
- void opcode_202_run();
- void opcode_202_disable();
+ virtual uint16 getMap() { return 9931; }
+
+ void birdSing_run();
void elevatorRotation_run();
void elevatorGoMiddle_run();
- void opcode_205_run();
- void opcode_205_disable();
- void opcode_206_run();
- void opcode_206_disable();
- void opcode_209_run();
- void opcode_209_disable();
+ void fortressRotation_run();
+ void fortressSimulation_run();
DECLARE_OPCODE(o_throneEnablePassage);
+ DECLARE_OPCODE(o_birdCrankStart);
+ DECLARE_OPCODE(o_birdCrankStop);
DECLARE_OPCODE(o_snakeBoxTrigger);
DECLARE_OPCODE(o_fortressStaircaseMovie);
DECLARE_OPCODE(o_elevatorRotationStart);
DECLARE_OPCODE(o_elevatorRotationMove);
DECLARE_OPCODE(o_elevatorRotationStop);
+ DECLARE_OPCODE(o_fortressRotationSpeedStart);
+ DECLARE_OPCODE(o_fortressRotationSpeedMove);
+ DECLARE_OPCODE(o_fortressRotationSpeedStop);
+ DECLARE_OPCODE(o_fortressRotationBrakeStart);
+ DECLARE_OPCODE(o_fortressRotationBrakeMove);
+ DECLARE_OPCODE(o_fortressRotationBrakeStop);
+ DECLARE_OPCODE(o_fortressSimulationSpeedStart);
+ DECLARE_OPCODE(o_fortressSimulationSpeedMove);
+ DECLARE_OPCODE(o_fortressSimulationSpeedStop);
+ DECLARE_OPCODE(o_fortressSimulationBrakeStart);
+ DECLARE_OPCODE(o_fortressSimulationBrakeMove);
+ DECLARE_OPCODE(o_fortressSimulationBrakeStop);
DECLARE_OPCODE(o_elevatorWindowMovie);
DECLARE_OPCODE(o_elevatorGoMiddle);
DECLARE_OPCODE(o_elevatorTopMovie);
@@ -84,18 +92,31 @@ private:
DECLARE_OPCODE(o_throne_init);
DECLARE_OPCODE(o_fortressStaircase_init);
- DECLARE_OPCODE(opcode_202);
+ DECLARE_OPCODE(o_bird_init);
DECLARE_OPCODE(o_snakeBox_init);
DECLARE_OPCODE(o_elevatorRotation_init);
- DECLARE_OPCODE(opcode_205);
- DECLARE_OPCODE(opcode_206);
- DECLARE_OPCODE(opcode_209);
+ DECLARE_OPCODE(o_fortressRotation_init);
+ DECLARE_OPCODE(o_fortressSimulation_init);
+ DECLARE_OPCODE(o_fortressSimulationStartup_init);
MystGameState::Mechanical &_state;
bool _mystStaircaseState; // 76
+ bool _fortressRotationRunning;
+ uint16 _fortressRotationSpeed; // 78
+ uint16 _fortressRotationBrake; // 80
uint16 _fortressPosition; // 82
+ uint16 _fortressRotationSounds[4]; // 86 to 92
+ MystResourceType6 *_fortressRotationGears; // 172
+
+ bool _fortressSimulationRunning;
+ uint16 _fortressSimulationSpeed; // 96
+ uint16 _fortressSimulationBrake; // 98
+ uint16 _fortressSimulationStartSound1; // 102
+ uint16 _fortressSimulationStartSound2; // 100
+ MystResourceType6 *_fortressSimulationHolo; // 160
+ MystResourceType6 *_fortressSimulationStartup; // 164
uint16 _elevatorGoingDown; // 112
@@ -113,6 +134,12 @@ private:
uint16 _crystalLit; // 130
+ bool _birdSinging; // 144
+ uint32 _birdCrankStartTime; // 136
+ uint32 _birdSingEndTime; // 140
+ MystResourceType6 *_bird; // 152
+
+
MystResourceType6 *_snakeBox; // 156
};
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 2b8ef94442..f77ae753d9 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/cursors.h"
@@ -862,7 +859,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a
for (uint i = 4795; i >= 4779; i--) {
_vm->_gfx->copyImageToScreen(i, _invokingResource->getRect());
_vm->_system->updateScreen();
- _vm->_system->delayMillis(1);
}
_fireplaceLines[var - 17] &= ~bitmask;
} else {
@@ -870,7 +866,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a
for (uint i = 4779; i <= 4795; i++) {
_vm->_gfx->copyImageToScreen(i, _invokingResource->getRect());
_vm->_system->updateScreen();
- _vm->_system->delayMillis(1);
}
_fireplaceLines[var - 17] |= bitmask;
}
diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h
index 51dffd0abe..9510d371d7 100644
--- a/engines/mohawk/myst_stacks/myst.h
+++ b/engines/mohawk/myst_stacks/myst.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_MYST_H
@@ -52,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9934; }
+
void towerRotationMap_run();
void libraryBookcaseTransform_run();
void generatorControlRoom_run();
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index fddf6290fb..37b749f100 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h
index 870e4b9272..7e4e418eef 100644
--- a/engines/mohawk/myst_stacks/preview.h
+++ b/engines/mohawk/myst_stacks/preview.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_PREVIEW_H
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index c670cb6a48..1473742259 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/cursors.h"
diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h
index 4ec92b9869..d314c4d810 100644
--- a/engines/mohawk/myst_stacks/selenitic.h
+++ b/engines/mohawk/myst_stacks/selenitic.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_SELENITIC_H
@@ -53,6 +50,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9930; }
+
DECLARE_OPCODE(o_mazeRunnerMove);
DECLARE_OPCODE(o_mazeRunnerSoundRepeat);
DECLARE_OPCODE(o_soundReceiverSigma);
diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp
index 4057edd9c9..72b299ee6d 100644
--- a/engines/mohawk/myst_stacks/slides.cpp
+++ b/engines/mohawk/myst_stacks/slides.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/myst.h"
diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h
index 1e0504a665..8bc61d0e24 100644
--- a/engines/mohawk/myst_stacks/slides.h
+++ b/engines/mohawk/myst_stacks/slides.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_SLIDES_H
diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp
index 07701c273e..e0c374a926 100644
--- a/engines/mohawk/myst_stacks/stoneship.cpp
+++ b/engines/mohawk/myst_stacks/stoneship.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "mohawk/cursors.h"
diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h
index 091fdcd169..4125412b4d 100644
--- a/engines/mohawk/myst_stacks/stoneship.h
+++ b/engines/mohawk/myst_stacks/stoneship.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef MYST_SCRIPTS_STONESHIP_H
@@ -52,6 +49,8 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
+ virtual uint16 getMap() { return 9933; }
+
DECLARE_OPCODE(o_pumpTurnOff);
DECLARE_OPCODE(o_brotherDoorOpen);
DECLARE_OPCODE(o_cabinBookMovie);