aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2011-02-13 19:07:06 +0100
committerBastien Bouclet2011-02-15 21:43:37 +0100
commitc6e86c672bdd3edddad6414a70646f4d458beee2 (patch)
tree5375b9302c1516bb8accd390a3c09ed8a1e2c069
parent30f1eead192b8cf6a8c3e3526d9ab6c01670a0aa (diff)
downloadscummvm-rg350-c6e86c672bdd3edddad6414a70646f4d458beee2.tar.gz
scummvm-rg350-c6e86c672bdd3edddad6414a70646f4d458beee2.tar.bz2
scummvm-rg350-c6e86c672bdd3edddad6414a70646f4d458beee2.zip
MOHAWK: Implement Mechanical opcode 201, staircase init
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp45
-rw-r--r--engines/mohawk/myst_stacks/mechanical.h4
2 files changed, 7 insertions, 42 deletions
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index c8652d4951..b1f30933c2 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -68,7 +68,7 @@ void MystScriptParser_Mechanical::setupOpcodes() {
// "Init" Opcodes
OPCODE(200, o_throne_init);
- OPCODE(201, opcode_201);
+ OPCODE(201, o_fortressStaircase_init);
OPCODE(202, opcode_202);
OPCODE(203, o_snakeBox_init);
OPCODE(204, opcode_204);
@@ -83,7 +83,6 @@ void MystScriptParser_Mechanical::setupOpcodes() {
#undef OPCODE
void MystScriptParser_Mechanical::disablePersistentScripts() {
- opcode_201_disable();
opcode_202_disable();
opcode_204_disable();
opcode_205_disable();
@@ -92,7 +91,6 @@ void MystScriptParser_Mechanical::disablePersistentScripts() {
}
void MystScriptParser_Mechanical::runPersistentScripts() {
- opcode_201_run();
opcode_202_run();
opcode_204_run();
opcode_205_run();
@@ -369,43 +367,12 @@ void MystScriptParser_Mechanical::o_throne_init(uint16 op, uint16 var, uint16 ar
_invokingResource->setEnabled(getVar(var));
}
-static struct {
- uint16 u0;
- uint16 u1;
- uint16 u2;
-
- bool enabled;
-} g_opcode201Parameters;
-
-void MystScriptParser_Mechanical::opcode_201_run() {
- // Used for Card 6159 (Facing Corridor to Fortress Elevator)
-
- // g_opcode201Parameters.u0
- // g_opcode201Parameters.u1
- // g_opcode201Parameters.u2
-
- // TODO: Fill in Function...
-}
+void MystScriptParser_Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ debugC(kDebugScript, "Opcode %d: Staircase init", op);
-void MystScriptParser_Mechanical::opcode_201_disable() {
- g_opcode201Parameters.enabled = false;
- g_opcode201Parameters.u0 = 0;
- g_opcode201Parameters.u1 = 0;
- g_opcode201Parameters.u2 = 0;
-}
-
-void MystScriptParser_Mechanical::opcode_201(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
- varUnusedCheck(op, var);
-
- // Used for Card 6159 (Facing Corridor to Fortress Elevator)
- if (argc == 3) {
- g_opcode201Parameters.u0 = argv[0];
- g_opcode201Parameters.u1 = argv[1];
- g_opcode201Parameters.u2 = argv[2];
-
- g_opcode201Parameters.enabled = true;
- } else
- unknown(op, var, argc, argv);
+ _vm->_resources[argv[0]]->setEnabled(!_state.staircaseState);
+ _vm->_resources[argv[1]]->setEnabled(!_state.staircaseState);
+ _vm->_resources[argv[2]]->setEnabled(_state.staircaseState);
}
static struct {
diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h
index 345e838fc8..1853a56418 100644
--- a/engines/mohawk/myst_stacks/mechanical.h
+++ b/engines/mohawk/myst_stacks/mechanical.h
@@ -51,8 +51,6 @@ private:
void toggleVar(uint16 var);
bool setVarValue(uint16 var, uint16 value);
- void opcode_201_run();
- void opcode_201_disable();
void opcode_202_run();
void opcode_202_disable();
void opcode_204_run();
@@ -81,7 +79,7 @@ private:
DECLARE_OPCODE(o_crystalLeaveRed);
DECLARE_OPCODE(o_throne_init);
- DECLARE_OPCODE(opcode_201);
+ DECLARE_OPCODE(o_fortressStaircase_init);
DECLARE_OPCODE(opcode_202);
DECLARE_OPCODE(o_snakeBox_init);
DECLARE_OPCODE(opcode_204);