From 2d094af90c41e2c57f451b687490e95344e7ef74 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 13 Feb 2011 16:49:32 +0100 Subject: MOHAWK: Implement Mechanical opcode 200 --- engines/mohawk/myst_stacks/mechanical.cpp | 31 ++++--------------------------- engines/mohawk/myst_stacks/mechanical.h | 4 +--- 2 files changed, 5 insertions(+), 30 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index add87694a8..0ab1b8df86 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -66,7 +66,7 @@ void MystScriptParser_Mechanical::setupOpcodes() { OPCODE(132, o_crystalLeaveRed); // "Init" Opcodes - OPCODE(200, opcode_200); + OPCODE(200, o_throne_init); OPCODE(201, opcode_201); OPCODE(202, opcode_202); OPCODE(203, opcode_203); @@ -82,7 +82,6 @@ void MystScriptParser_Mechanical::setupOpcodes() { #undef OPCODE void MystScriptParser_Mechanical::disablePersistentScripts() { - opcode_200_disable(); opcode_201_disable(); opcode_202_disable(); opcode_203_disable(); @@ -93,7 +92,6 @@ void MystScriptParser_Mechanical::disablePersistentScripts() { } void MystScriptParser_Mechanical::runPersistentScripts() { - opcode_200_run(); opcode_201_run(); opcode_202_run(); opcode_203_run(); @@ -361,32 +359,11 @@ void MystScriptParser_Mechanical::o_crystalLeaveRed(uint16 op, uint16 var, uint1 _vm->redrawArea(22); } -static struct { - bool enabled; - uint16 var; -} g_opcode200Parameters; - -void MystScriptParser_Mechanical::opcode_200_run() { +void MystScriptParser_Mechanical::o_throne_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 6238 (Sirrus' Throne) and Card 6027 (Achenar's Throne) - // g_opcode200Parameters.var == 0 for Achenar - // g_opcode200Parameters.var == 1 for Sirrus - - // TODO: Fill in Function... - // Variable indicates that this is related to Secret Panel State -} + debugC(kDebugScript, "Opcode %d: Brother throne init", op); -void MystScriptParser_Mechanical::opcode_200_disable() { - g_opcode200Parameters.enabled = false; - g_opcode200Parameters.var = 0; -} - -void MystScriptParser_Mechanical::opcode_200(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - // Used on Card 6238 (Sirrus' Throne) and Card 6027 (Achenar's Throne) - if (argc == 0) { - g_opcode200Parameters.var = var; - g_opcode200Parameters.enabled = true; - } else - unknown(op, var, argc, argv); + _invokingResource->setEnabled(getVar(var)); } static struct { diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 3c7701c12d..7015c1b9c1 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_200_run(); - void opcode_200_disable(); void opcode_201_run(); void opcode_201_disable(); void opcode_202_run(); @@ -83,7 +81,7 @@ private: DECLARE_OPCODE(o_crystalLeaveGreen); DECLARE_OPCODE(o_crystalLeaveRed); - DECLARE_OPCODE(opcode_200); + DECLARE_OPCODE(o_throne_init); DECLARE_OPCODE(opcode_201); DECLARE_OPCODE(opcode_202); DECLARE_OPCODE(opcode_203); -- cgit v1.2.3