diff options
author | Johannes Schickel | 2011-02-15 23:40:06 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-15 23:42:50 +0100 |
commit | a02454644af514c4f50b861cc718e2951d4c46dd (patch) | |
tree | e6385482a68f330f412e87aa33b049b4f5912911 /engines/mohawk/myst_stacks | |
parent | 01d511bf1b6df74254a2f6bd3007e884cd0c0dde (diff) | |
parent | 369db4fdfd5dac16858505f91cb37f4ae386fe80 (diff) | |
download | scummvm-rg350-a02454644af514c4f50b861cc718e2951d4c46dd.tar.gz scummvm-rg350-a02454644af514c4f50b861cc718e2951d4c46dd.tar.bz2 scummvm-rg350-a02454644af514c4f50b861cc718e2951d4c46dd.zip |
Merge branch 'master' into osystem-palette
Conflicts:
backends/platform/wii/osystem_gfx.cpp
Diffstat (limited to 'engines/mohawk/myst_stacks')
24 files changed, 577 insertions, 608 deletions
diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 6e367d0167..26267cfbda 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -35,18 +35,19 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Channelwood::MystScriptParser_Channelwood(MohawkEngine_Myst *vm) : +Channelwood::Channelwood(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(vm->_gameState->_channelwood) { setupOpcodes(); } -MystScriptParser_Channelwood::~MystScriptParser_Channelwood() { +Channelwood::~Channelwood() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Channelwood::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Channelwood::x, #x)) -void MystScriptParser_Channelwood::setupOpcodes() { +void Channelwood::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_bridgeToggle); OPCODE(101, o_pipeExtend); @@ -89,15 +90,15 @@ void MystScriptParser_Channelwood::setupOpcodes() { #undef OPCODE -void MystScriptParser_Channelwood::disablePersistentScripts() { +void Channelwood::disablePersistentScripts() { } -void MystScriptParser_Channelwood::runPersistentScripts() { +void Channelwood::runPersistentScripts() { } -uint16 MystScriptParser_Channelwood::getVar(uint16 var) { +uint16 Channelwood::getVar(uint16 var) { switch(var) { case 1: // Water Pump Bridge Raised return _state.waterPumpBridgeState; @@ -186,7 +187,7 @@ uint16 MystScriptParser_Channelwood::getVar(uint16 var) { } } -void MystScriptParser_Channelwood::toggleVar(uint16 var) { +void Channelwood::toggleVar(uint16 var) { switch(var) { case 1: // Water Pump Bridge Raised _state.waterPumpBridgeState ^= 1; @@ -219,7 +220,7 @@ void MystScriptParser_Channelwood::toggleVar(uint16 var) { } } -bool MystScriptParser_Channelwood::setVarValue(uint16 var, uint16 value) { +bool Channelwood::setVarValue(uint16 var, uint16 value) { bool refresh = false; switch (var) { @@ -270,7 +271,7 @@ bool MystScriptParser_Channelwood::setVarValue(uint16 var, uint16 value) { return refresh; } -bool MystScriptParser_Channelwood::pipeChangeValve(bool open, uint16 mask) { +bool Channelwood::pipeChangeValve(bool open, uint16 mask) { if (open) { if (!(_state.waterValveStates & mask)) { _state.waterValveStates |= mask; @@ -286,7 +287,7 @@ bool MystScriptParser_Channelwood::pipeChangeValve(bool open, uint16 mask) { return false; } -void MystScriptParser_Channelwood::o_bridgeToggle(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_bridgeToggle(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Bridge rise / skink video", op); VideoHandle bridge = _vm->_video->playMovie(_vm->wrapMovieFilename("bridge", kChannelwoodStack), 292, 203); @@ -300,7 +301,7 @@ void MystScriptParser_Channelwood::o_bridgeToggle(uint16 op, uint16 var, uint16 _vm->_video->waitUntilMovieEnds(bridge); } -void MystScriptParser_Channelwood::o_pipeExtend(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_pipeExtend(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play Pipe Movie and Sound", op); uint16 soundId = argv[0]; @@ -319,7 +320,7 @@ void MystScriptParser_Channelwood::o_pipeExtend(uint16 op, uint16 var, uint16 ar _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Draw Full Screen Image, Change Card, and change volume", op); uint16 imageId = argv[0]; @@ -340,7 +341,7 @@ void MystScriptParser_Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uin } -void MystScriptParser_Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Do Water Tank Valve Open Animation", op); Common::Rect rect = _invokingResource->getRect(); @@ -354,7 +355,7 @@ void MystScriptParser_Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, u pipeChangeValve(true, 0x80); } -void MystScriptParser_Channelwood::o_leverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever start move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -363,7 +364,7 @@ void MystScriptParser_Channelwood::o_leverStartMove(uint16 op, uint16 var, uint1 _leverPulled = false; } -void MystScriptParser_Channelwood::o_leverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -378,7 +379,7 @@ void MystScriptParser_Channelwood::o_leverMove(uint16 op, uint16 var, uint16 arg } } -void MystScriptParser_Channelwood::o_leverMoveFail(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverMoveFail(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -395,7 +396,7 @@ void MystScriptParser_Channelwood::o_leverMoveFail(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Channelwood::o_leverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever end move", op); // Get current lever frame @@ -411,12 +412,12 @@ void MystScriptParser_Channelwood::o_leverEndMove(uint16 op, uint16 var, uint16 _vm->checkCursorHints(); } -void MystScriptParser_Channelwood::o_leverEndMoveResumeBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverEndMoveResumeBackground(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _vm->_sound->resumeBackgroundMyst(); o_leverEndMove(op, var, argc, argv); } -void MystScriptParser_Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { o_leverEndMove(op, var, argc, argv); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -425,20 +426,20 @@ void MystScriptParser_Channelwood::o_leverEndMoveWithSound(uint16 op, uint16 var _vm->_sound->replaceSoundMyst(soundId); } -void MystScriptParser_Channelwood::o_leverElev3StartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverElev3StartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _vm->_gfx->copyImageToScreen(3970, Common::Rect(544, 333)); _vm->_system->updateScreen(); o_leverStartMove(op, var, argc, argv); } -void MystScriptParser_Channelwood::o_leverElev3EndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_leverElev3EndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { o_leverEndMove(op, var, argc, argv); _vm->_gfx->copyImageToScreen(3265, Common::Rect(544, 333)); _vm->_system->updateScreen(); _vm->_sound->replaceSoundMyst(5265); } -void MystScriptParser_Channelwood::o_pumpLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_pumpLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Pump lever move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -452,7 +453,7 @@ void MystScriptParser_Channelwood::o_pumpLeverMove(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { o_leverEndMove(op, var, argc, argv); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -461,7 +462,7 @@ void MystScriptParser_Channelwood::o_pumpLeverEndMove(uint16 op, uint16 var, uin _vm->_sound->replaceBackgroundMyst(soundId, 36864); } -void MystScriptParser_Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play stairs door video", op); MystResourceType6 *movie = static_cast<MystResourceType6 *>(_invokingResource); @@ -474,7 +475,7 @@ void MystScriptParser_Channelwood::o_stairsDoorToggle(uint16 op, uint16 var, uin } } -void MystScriptParser_Channelwood::o_valveHandleMove1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMove1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -490,7 +491,7 @@ void MystScriptParser_Channelwood::o_valveHandleMove1(uint16 op, uint16 var, uin } } -void MystScriptParser_Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -502,7 +503,7 @@ void MystScriptParser_Channelwood::o_valveHandleMoveStart1(uint16 op, uint16 var o_valveHandleMove1(op, var, argc, argv); } -void MystScriptParser_Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move stop", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -525,7 +526,7 @@ void MystScriptParser_Channelwood::o_valveHandleMoveStop(uint16 op, uint16 var, _vm->checkCursorHints(); } -void MystScriptParser_Channelwood::o_valveHandleMove2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMove2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -541,7 +542,7 @@ void MystScriptParser_Channelwood::o_valveHandleMove2(uint16 op, uint16 var, uin } } -void MystScriptParser_Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -553,7 +554,7 @@ void MystScriptParser_Channelwood::o_valveHandleMoveStart2(uint16 op, uint16 var o_valveHandleMove2(op, var, argc, argv); } -void MystScriptParser_Channelwood::o_valveHandleMove3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMove3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -569,7 +570,7 @@ void MystScriptParser_Channelwood::o_valveHandleMove3(uint16 op, uint16 var, uin } } -void MystScriptParser_Channelwood::o_valveHandleMoveStart3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_valveHandleMoveStart3(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Valve handle move start", op); MystResourceType12 *handle = static_cast<MystResourceType12 *>(_invokingResource); @@ -581,7 +582,7 @@ void MystScriptParser_Channelwood::o_valveHandleMoveStart3(uint16 op, uint16 var o_valveHandleMove3(op, var, argc, argv); } -void MystScriptParser_Channelwood::o_hologramMonitor(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_hologramMonitor(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram monitor", op); // Used on Card 3012 (Temple Hologram Monitor) @@ -613,7 +614,7 @@ void MystScriptParser_Channelwood::o_hologramMonitor(uint16 op, uint16 var, uint } } -void MystScriptParser_Channelwood::o_drawerOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_drawerOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open Sirius drawer", op); _siriusDrawerState = 1; @@ -621,7 +622,7 @@ void MystScriptParser_Channelwood::o_drawerOpen(uint16 op, uint16 var, uint16 ar _vm->redrawArea(102, false); } -void MystScriptParser_Channelwood::o_hologramTemple(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_hologramTemple(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Temple hologram", op); _vm->_sound->pauseBackgroundMyst(); @@ -648,14 +649,14 @@ void MystScriptParser_Channelwood::o_hologramTemple(uint16 op, uint16 var, uint1 _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Channelwood::o_executeMouseUp(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_executeMouseUp(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Execute mouse up", op); MystResourceType5 *resource = static_cast<MystResourceType5 *>(_vm->_resources[argv[0]]); resource->handleMouseUp(); } -void MystScriptParser_Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Do Water Tank Valve Close Animation", op); Common::Rect rect = _invokingResource->getRect(); @@ -669,7 +670,7 @@ void MystScriptParser_Channelwood::o_waterTankValveClose(uint16 op, uint16 var, pipeChangeValve(false, 0x80); } -void MystScriptParser_Channelwood::o_elevatorMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_elevatorMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used by Card 3262 (Elevator) debugC(kDebugScript, "Opcode %d: Elevator movie", op); @@ -714,7 +715,7 @@ void MystScriptParser_Channelwood::o_elevatorMovies(uint16 op, uint16 var, uint1 _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Channelwood::o_soundReplace(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_soundReplace(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play sound if not already playing", op); uint16 soundId = argv[0]; @@ -723,19 +724,20 @@ void MystScriptParser_Channelwood::o_soundReplace(uint16 op, uint16 var, uint16 _vm->_sound->replaceSoundMyst(soundId); } -void MystScriptParser_Channelwood::o_lever_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_lever_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generic lever init", op); _leverAction = static_cast<MystResourceType5 *>(_invokingResource); } -void MystScriptParser_Channelwood::o_pipeValve_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_pipeValve_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Water valve init", op); _valveVar = var; } -void MystScriptParser_Channelwood::o_drawer_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Channelwood::o_drawer_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sirius's drawer init", op); _siriusDrawerState = 0; } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 8c52f864cd..5eeaa63e23 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Channelwood : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Channelwood : public MystScriptParser { public: - MystScriptParser_Channelwood(MohawkEngine_Myst *vm); - ~MystScriptParser_Channelwood(); + Channelwood(MohawkEngine_Myst *vm); + ~Channelwood(); void disablePersistentScripts(); void runPersistentScripts(); @@ -99,6 +100,7 @@ private: bool pipeChangeValve(bool open, uint16 mask); }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp index 6c0b2c2951..61772eda4d 100644 --- a/engines/mohawk/myst_stacks/credits.cpp +++ b/engines/mohawk/myst_stacks/credits.cpp @@ -33,19 +33,20 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { // NOTE: Credits Start Card is 10000 -MystScriptParser_Credits::MystScriptParser_Credits(MohawkEngine_Myst *vm) : MystScriptParser(vm) { +Credits::Credits(MohawkEngine_Myst *vm) : MystScriptParser(vm) { setupOpcodes(); } -MystScriptParser_Credits::~MystScriptParser_Credits() { +Credits::~Credits() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Credits::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Credits::x, #x)) -void MystScriptParser_Credits::setupOpcodes() { +void Credits::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_quit); @@ -55,11 +56,11 @@ void MystScriptParser_Credits::setupOpcodes() { #undef OPCODE -void MystScriptParser_Credits::disablePersistentScripts() { +void Credits::disablePersistentScripts() { _creditsRunning = false; } -void MystScriptParser_Credits::runPersistentScripts() { +void Credits::runPersistentScripts() { if (!_creditsRunning) return; @@ -79,7 +80,7 @@ void MystScriptParser_Credits::runPersistentScripts() { } } -uint16 MystScriptParser_Credits::getVar(uint16 var) { +uint16 Credits::getVar(uint16 var) { switch(var) { case 0: // Credits Image Control return _curImage; @@ -90,11 +91,12 @@ uint16 MystScriptParser_Credits::getVar(uint16 var) { } } -void MystScriptParser_Credits::o_runCredits(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Credits::o_runCredits(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Activate the credits _creditsRunning = true; _curImage = 0; _startTime = _vm->_system->getMillis(); } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/credits.h b/engines/mohawk/myst_stacks/credits.h index 46d23c67ca..4f9eaa2944 100644 --- a/engines/mohawk/myst_stacks/credits.h +++ b/engines/mohawk/myst_stacks/credits.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Credits : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Credits : public MystScriptParser { public: - MystScriptParser_Credits(MohawkEngine_Myst *vm); - ~MystScriptParser_Credits(); + Credits(MohawkEngine_Myst *vm); + ~Credits(); void disablePersistentScripts(); void runPersistentScripts(); @@ -55,6 +56,7 @@ private: uint16 _curImage; // 56 }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp index 548a2d5390..a2dd148b22 100644 --- a/engines/mohawk/myst_stacks/demo.cpp +++ b/engines/mohawk/myst_stacks/demo.cpp @@ -29,25 +29,26 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Demo::MystScriptParser_Demo(MohawkEngine_Myst *vm) : MystScriptParser_Intro(vm) { +Demo::Demo(MohawkEngine_Myst *vm) : Intro(vm) { setupOpcodes(); } -MystScriptParser_Demo::~MystScriptParser_Demo() { +Demo::~Demo() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Demo::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Demo::x, #x)) #define OVERRIDE_OPCODE(opcode, x) \ for (uint32 i = 0; i < _opcodes.size(); i++) \ if (_opcodes[i]->op == opcode) { \ - _opcodes[i]->proc = (OpcodeProcMyst) &MystScriptParser_Demo::x; \ + _opcodes[i]->proc = (OpcodeProcMyst) &Demo::x; \ _opcodes[i]->desc = #x; \ break; \ } -void MystScriptParser_Demo::setupOpcodes() { +void Demo::setupOpcodes() { // "Stack-Specific" Opcodes OVERRIDE_OPCODE(100, opcode_100); OPCODE(101, opcode_101); @@ -63,14 +64,14 @@ void MystScriptParser_Demo::setupOpcodes() { #undef OPCODE #undef OVERRIDE_OPCODE -void MystScriptParser_Demo::disablePersistentScripts() { - MystScriptParser_Intro::disablePersistentScripts(); +void Demo::disablePersistentScripts() { + Intro::disablePersistentScripts(); _enabled201 = false; } -void MystScriptParser_Demo::runPersistentScripts() { - MystScriptParser_Intro::runPersistentScripts(); +void Demo::runPersistentScripts() { + Intro::runPersistentScripts(); if (_enabled201) { // Used on Card 2001, 2002 and 2003 @@ -79,11 +80,11 @@ void MystScriptParser_Demo::runPersistentScripts() { } } -void MystScriptParser_Demo::opcode_100(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Demo::opcode_100(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // TODO: Fill in Function... } -void MystScriptParser_Demo::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Demo::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card 2000, 2002 and 2003 @@ -94,7 +95,7 @@ void MystScriptParser_Demo::opcode_101(uint16 op, uint16 var, uint16 argc, uint1 unknown(op, var, argc, argv); } -void MystScriptParser_Demo::opcode_102(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Demo::opcode_102(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card 2002 and 2003 @@ -105,7 +106,7 @@ void MystScriptParser_Demo::opcode_102(uint16 op, uint16 var, uint16 argc, uint1 unknown(op, var, argc, argv); } -void MystScriptParser_Demo::opcode_201(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Demo::opcode_201(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card 2001, 2002 and 2003 @@ -116,11 +117,12 @@ void MystScriptParser_Demo::opcode_201(uint16 op, uint16 var, uint16 argc, uint1 } -void MystScriptParser_Demo::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Demo::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 2000 varUnusedCheck(op, var); // TODO: Fill in Function... } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/demo.h b/engines/mohawk/myst_stacks/demo.h index f693ea4c35..054dc7befe 100644 --- a/engines/mohawk/myst_stacks/demo.h +++ b/engines/mohawk/myst_stacks/demo.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Demo : public MystScriptParser_Intro { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Demo : public Intro { public: - MystScriptParser_Demo(MohawkEngine_Myst *vm); - ~MystScriptParser_Demo(); + Demo(MohawkEngine_Myst *vm); + ~Demo(); void disablePersistentScripts(); void runPersistentScripts(); @@ -59,6 +60,7 @@ private: bool _enabled201; }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp index 47382b7b81..ffbf9c991f 100644 --- a/engines/mohawk/myst_stacks/dni.cpp +++ b/engines/mohawk/myst_stacks/dni.cpp @@ -32,19 +32,20 @@ #include "mohawk/myst_stacks/dni.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Dni::MystScriptParser_Dni(MohawkEngine_Myst *vm) : +Dni::Dni(MohawkEngine_Myst *vm) : MystScriptParser(vm) { setupOpcodes(); _notSeenAtrus = true; } -MystScriptParser_Dni::~MystScriptParser_Dni() { +Dni::~Dni() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Dni::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Dni::x, #x)) -void MystScriptParser_Dni::setupOpcodes() { +void Dni::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, NOP); OPCODE(101, o_handPage); @@ -58,13 +59,13 @@ void MystScriptParser_Dni::setupOpcodes() { #undef OPCODE -void MystScriptParser_Dni::disablePersistentScripts() { +void Dni::disablePersistentScripts() { _atrusRunning = false; _waitForLoop = false; _atrusLeft = false; } -void MystScriptParser_Dni::runPersistentScripts() { +void Dni::runPersistentScripts() { if (_atrusRunning) atrus_run(); @@ -75,7 +76,7 @@ void MystScriptParser_Dni::runPersistentScripts() { atrusLeft_run(); } -uint16 MystScriptParser_Dni::getVar(uint16 var) { +uint16 Dni::getVar(uint16 var) { switch(var) { case 0: // Atrus Gone (from across room) return _globals.ending == 2; @@ -95,7 +96,7 @@ uint16 MystScriptParser_Dni::getVar(uint16 var) { } } -void MystScriptParser_Dni::o_handPage(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Dni::o_handPage(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hand page to Atrus", op); // Used in Card 5014 (Atrus) @@ -118,7 +119,7 @@ void MystScriptParser_Dni::o_handPage(uint16 op, uint16 var, uint16 argc, uint16 } } -void MystScriptParser_Dni::atrusLeft_run() { +void Dni::atrusLeft_run() { if (_vm->_system->getMillis() > _atrusLeftTime + 63333) { _video = _vm->wrapMovieFilename("atrus2", kDniStack); VideoHandle atrus = _vm->_video->playMovie(_video, 215, 77); @@ -137,7 +138,7 @@ void MystScriptParser_Dni::atrusLeft_run() { } } -void MystScriptParser_Dni::loopVideo_run() { +void Dni::loopVideo_run() { if (!_vm->_video->isVideoPlaying()) { VideoHandle atrus = _vm->_video->playMovie(_video, 215, 77); _vm->_video->setVideoBounds(atrus, Audio::Timestamp(0, _loopStart, 600), Audio::Timestamp(0, _loopEnd, 600)); @@ -147,7 +148,7 @@ void MystScriptParser_Dni::loopVideo_run() { } } -void MystScriptParser_Dni::atrus_run() { +void Dni::atrus_run() { if (_globals.ending == 2) { // Wait for atrus to come back _atrusLeft = true; @@ -188,10 +189,11 @@ void MystScriptParser_Dni::atrus_run() { } } -void MystScriptParser_Dni::o_atrus_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Dni::o_atrus_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Atrus init", op); _atrusRunning = true; } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h index 85900ad562..b50f018d3e 100644 --- a/engines/mohawk/myst_stacks/dni.h +++ b/engines/mohawk/myst_stacks/dni.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Dni : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Dni : public MystScriptParser { public: - MystScriptParser_Dni(MohawkEngine_Myst *vm); - ~MystScriptParser_Dni(); + Dni(MohawkEngine_Myst *vm); + ~Dni(); void disablePersistentScripts(); void runPersistentScripts(); @@ -67,6 +68,7 @@ private: bool _atrusLeft; // 80 }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index a4a8cf2a89..0d8f67a85b 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -34,17 +34,18 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Intro::MystScriptParser_Intro(MohawkEngine_Myst *vm) : MystScriptParser(vm) { +Intro::Intro(MohawkEngine_Myst *vm) : MystScriptParser(vm) { setupOpcodes(); } -MystScriptParser_Intro::~MystScriptParser_Intro() { +Intro::~Intro() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Intro::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Intro::x, #x)) -void MystScriptParser_Intro::setupOpcodes() { +void Intro::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_useLinkBook); @@ -58,12 +59,12 @@ void MystScriptParser_Intro::setupOpcodes() { #undef OPCODE -void MystScriptParser_Intro::disablePersistentScripts() { +void Intro::disablePersistentScripts() { _introMoviesRunning = false; _linkBookRunning = false; } -void MystScriptParser_Intro::runPersistentScripts() { +void Intro::runPersistentScripts() { if (_introMoviesRunning) introMovies_run(); @@ -71,7 +72,7 @@ void MystScriptParser_Intro::runPersistentScripts() { mystLinkBook_run(); } -uint16 MystScriptParser_Intro::getVar(uint16 var) { +uint16 Intro::getVar(uint16 var) { switch(var) { case 0: if (_globals.currentAge == 9 || _globals.currentAge == 10) @@ -83,7 +84,7 @@ uint16 MystScriptParser_Intro::getVar(uint16 var) { } } -void MystScriptParser_Intro::o_useLinkBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Intro::o_useLinkBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Hard coded SoundId valid only for Intro Stack. // Other stacks use Opcode 40, which takes SoundId values as arguments. const uint16 soundIdLinkSrc = 5; @@ -96,7 +97,7 @@ void MystScriptParser_Intro::o_useLinkBook(uint16 op, uint16 var, uint16 argc, u _vm->changeToStack(_stackMap[_globals.currentAge], _startCard[_globals.currentAge], soundIdLinkSrc, soundIdLinkDst[_globals.currentAge]); } -void MystScriptParser_Intro::introMovies_run() { +void Intro::introMovies_run() { // Play Intro Movies // This is all quite messy... @@ -156,12 +157,12 @@ void MystScriptParser_Intro::introMovies_run() { } } -void MystScriptParser_Intro::o_playIntroMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Intro::o_playIntroMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _introMoviesRunning = true; _introStep = 0; } -void MystScriptParser_Intro::mystLinkBook_run() { +void Intro::mystLinkBook_run() { if (_startTime == 1) { _startTime = 0; @@ -175,7 +176,7 @@ void MystScriptParser_Intro::mystLinkBook_run() { } } -void MystScriptParser_Intro::o_mystLinkBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Intro::o_mystLinkBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Myst link book init", op); _linkBookMovie = static_cast<MystResourceType6 *>(_invokingResource); @@ -183,4 +184,5 @@ void MystScriptParser_Intro::o_mystLinkBook_init(uint16 op, uint16 var, uint16 a _linkBookRunning = true; } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h index a40d268d7d..0ecd9e6883 100644 --- a/engines/mohawk/myst_stacks/intro.h +++ b/engines/mohawk/myst_stacks/intro.h @@ -32,16 +32,17 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; class MystResourceType6; struct MystScriptEntry; -class MystScriptParser_Intro : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Intro : public MystScriptParser { public: - MystScriptParser_Intro(MohawkEngine_Myst *vm); - ~MystScriptParser_Intro(); + Intro(MohawkEngine_Myst *vm); + ~Intro(); void disablePersistentScripts(); void runPersistentScripts(); @@ -65,6 +66,7 @@ private: MystResourceType6 *_linkBookMovie; }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/makingof.cpp b/engines/mohawk/myst_stacks/makingof.cpp index 28b8665f52..e639092ed4 100644 --- a/engines/mohawk/myst_stacks/makingof.cpp +++ b/engines/mohawk/myst_stacks/makingof.cpp @@ -33,27 +33,29 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_MakingOf::MystScriptParser_MakingOf(MohawkEngine_Myst *vm) : MystScriptParser(vm) { +MakingOf::MakingOf(MohawkEngine_Myst *vm) : MystScriptParser(vm) { setupOpcodes(); } -MystScriptParser_MakingOf::~MystScriptParser_MakingOf() { +MakingOf::~MakingOf() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_MakingOf::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MakingOf::x, #x)) -void MystScriptParser_MakingOf::setupOpcodes() { +void MakingOf::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_quit); } #undef OPCODE -void MystScriptParser_MakingOf::disablePersistentScripts() { +void MakingOf::disablePersistentScripts() { } -void MystScriptParser_MakingOf::runPersistentScripts() { +void MakingOf::runPersistentScripts() { } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/makingof.h b/engines/mohawk/myst_stacks/makingof.h index ab919fd174..3033bb851e 100644 --- a/engines/mohawk/myst_stacks/makingof.h +++ b/engines/mohawk/myst_stacks/makingof.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_MakingOf : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class MakingOf : public MystScriptParser { public: - MystScriptParser_MakingOf(MohawkEngine_Myst *vm); - ~MystScriptParser_MakingOf(); + MakingOf(MohawkEngine_Myst *vm); + ~MakingOf(); void disablePersistentScripts(); void runPersistentScripts(); @@ -49,6 +50,7 @@ private: void setupOpcodes(); }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index add87694a8..0ae9078974 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -34,8 +34,9 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Mechanical::MystScriptParser_Mechanical(MohawkEngine_Myst *vm) : +Mechanical::Mechanical(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(vm->_gameState->_mechanical) { setupOpcodes(); @@ -43,14 +44,15 @@ MystScriptParser_Mechanical::MystScriptParser_Mechanical(MohawkEngine_Myst *vm) _fortressPosition = 0; } -MystScriptParser_Mechanical::~MystScriptParser_Mechanical() { +Mechanical::~Mechanical() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Mechanical::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Mechanical::x, #x)) -void MystScriptParser_Mechanical::setupOpcodes() { +void Mechanical::setupOpcodes() { // "Stack-Specific" Opcodes - OPCODE(104, opcode_104); + OPCODE(100, o_throneEnablePassage); + OPCODE(104, o_snakeBoxTrigger); OPCODE(105, o_fortressStaircaseMovie); OPCODE(121, opcode_121); OPCODE(122, opcode_122); @@ -66,10 +68,10 @@ void MystScriptParser_Mechanical::setupOpcodes() { OPCODE(132, o_crystalLeaveRed); // "Init" Opcodes - OPCODE(200, opcode_200); - OPCODE(201, opcode_201); + OPCODE(200, o_throne_init); + OPCODE(201, o_fortressStaircase_init); OPCODE(202, opcode_202); - OPCODE(203, opcode_203); + OPCODE(203, o_snakeBox_init); OPCODE(204, opcode_204); OPCODE(205, opcode_205); OPCODE(206, opcode_206); @@ -81,29 +83,23 @@ void MystScriptParser_Mechanical::setupOpcodes() { #undef OPCODE -void MystScriptParser_Mechanical::disablePersistentScripts() { - opcode_200_disable(); - opcode_201_disable(); +void Mechanical::disablePersistentScripts() { opcode_202_disable(); - opcode_203_disable(); opcode_204_disable(); opcode_205_disable(); opcode_206_disable(); opcode_209_disable(); } -void MystScriptParser_Mechanical::runPersistentScripts() { - opcode_200_run(); - opcode_201_run(); +void Mechanical::runPersistentScripts() { opcode_202_run(); - opcode_203_run(); opcode_204_run(); opcode_205_run(); opcode_206_run(); opcode_209_run(); } -uint16 MystScriptParser_Mechanical::getVar(uint16 var) { +uint16 Mechanical::getVar(uint16 var) { switch(var) { case 0: // Sirrus's Secret Panel State return _state.sirrusPanelState; @@ -170,8 +166,12 @@ uint16 MystScriptParser_Mechanical::getVar(uint16 var) { } } -void MystScriptParser_Mechanical::toggleVar(uint16 var) { +void Mechanical::toggleVar(uint16 var) { switch(var) { + case 0: // Sirrus's Secret Panel State + _state.sirrusPanelState ^= 1; + case 1: // Achenar's Secret Panel State + _state.achenarPanelState ^= 1; case 3: // Achenar's Secret Room Crate State _state.achenarCrateOpened ^= 1; case 4: // Myst Book Room Staircase State @@ -206,7 +206,7 @@ void MystScriptParser_Mechanical::toggleVar(uint16 var) { } } -bool MystScriptParser_Mechanical::setVarValue(uint16 var, uint16 value) { +bool Mechanical::setVarValue(uint16 var, uint16 value) { bool refresh = false; switch (var) { @@ -218,20 +218,20 @@ bool MystScriptParser_Mechanical::setVarValue(uint16 var, uint16 value) { return refresh; } -void MystScriptParser_Mechanical::opcode_104(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); +void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Enable throne passage", op); - // Used on Mechanical Card 6043 (Weapons Rack with Snake Box) - if (argc == 0) { - debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op); + _vm->_resources[argv[0]]->setEnabled(getVar(var)); +} - // TODO: Trigger Type 6 To Play Snake Movie.. Resource #3 on card. - } else - unknown(op, var, argc, argv); +void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op); + // Used on Mechanical Card 6043 (Weapons Rack with Snake Box) + _snakeBox->playMovie(); } -void MystScriptParser_Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play Stairs Movement Movie", op); VideoHandle staircase = _vm->_video->playMovie(_vm->wrapMovieFilename("hhstairs", kMechanicalStack), 174, 222); @@ -246,7 +246,7 @@ void MystScriptParser_Mechanical::o_fortressStaircaseMovie(uint16 op, uint16 var } -void MystScriptParser_Mechanical::opcode_121(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_121(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); if (argc == 2) { @@ -261,7 +261,7 @@ void MystScriptParser_Mechanical::opcode_121(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::opcode_122(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_122(uint16 op, uint16 var, uint16 argc, uint16 *argv) { if (argc == 0) { // Used on Card 6120 (Elevator) // Called when Exit Midde Button Pressed @@ -271,7 +271,7 @@ void MystScriptParser_Mechanical::opcode_122(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::opcode_123(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_123(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); if (argc == 2) { @@ -288,7 +288,7 @@ void MystScriptParser_Mechanical::opcode_123(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::opcode_124(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_124(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); if (argc == 0) { @@ -300,13 +300,13 @@ void MystScriptParser_Mechanical::opcode_124(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::o_mystStaircaseMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_mystStaircaseMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Myst book staircase video", op); _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("sstairs", kMechanicalStack), 199, 108); } -void MystScriptParser_Mechanical::opcode_126(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_126(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); if (argc == 0) { @@ -319,129 +319,77 @@ void MystScriptParser_Mechanical::opcode_126(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::o_crystalEnterYellow(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalEnterYellow(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal enter", op); _crystalLit = 3; _vm->redrawArea(20); } -void MystScriptParser_Mechanical::o_crystalEnterGreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalEnterGreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal enter", op); _crystalLit = 1; _vm->redrawArea(21); } -void MystScriptParser_Mechanical::o_crystalEnterRed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalEnterRed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal enter", op); _crystalLit = 2; _vm->redrawArea(22); } -void MystScriptParser_Mechanical::o_crystalLeaveYellow(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalLeaveYellow(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal leave", op); _crystalLit = 0; _vm->redrawArea(20); } -void MystScriptParser_Mechanical::o_crystalLeaveGreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalLeaveGreen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal leave", op); _crystalLit = 0; _vm->redrawArea(21); } -void MystScriptParser_Mechanical::o_crystalLeaveRed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::o_crystalLeaveRed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Crystal leave", op); _crystalLit = 0; _vm->redrawArea(22); } -static struct { - bool enabled; - uint16 var; -} g_opcode200Parameters; - -void MystScriptParser_Mechanical::opcode_200_run() { +void 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 -} - -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); -} - -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... -} + debugC(kDebugScript, "Opcode %d: Brother throne init", op); -void MystScriptParser_Mechanical::opcode_201_disable() { - g_opcode201Parameters.enabled = false; - g_opcode201Parameters.u0 = 0; - g_opcode201Parameters.u1 = 0; - g_opcode201Parameters.u2 = 0; + _invokingResource->setEnabled(getVar(var)); } -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]; +void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Staircase init", op); - 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 { bool enabled; } g_opcode202Parameters; -void MystScriptParser_Mechanical::opcode_202_run() { +void Mechanical::opcode_202_run() { // Used for Card 6220 (Sirrus' Mechanical Bird) // TODO: Fill in Function } -void MystScriptParser_Mechanical::opcode_202_disable() { +void Mechanical::opcode_202_disable() { g_opcode202Parameters.enabled = false; } -void MystScriptParser_Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +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; @@ -449,29 +397,10 @@ void MystScriptParser_Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -static struct { - bool enabled; -} g_opcode203Parameters; - -void MystScriptParser_Mechanical::opcode_203_run() { - if (g_opcode203Parameters.enabled) { - // Used for Card 6043 (Weapons Rack with Snake Box) - // TODO: Fill in Logic for Snake Box... - } -} - -void MystScriptParser_Mechanical::opcode_203_disable() { - g_opcode203Parameters.enabled = false; -} +void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Snake box init", op); -void MystScriptParser_Mechanical::opcode_203(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - - // Used for Card 6043 (Weapons Rack with Snake Box) - if (argc == 0) - g_opcode203Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _snakeBox = static_cast<MystResourceType6 *>(_invokingResource); } static struct { @@ -479,7 +408,7 @@ static struct { uint16 soundId; } g_opcode204Parameters; -void MystScriptParser_Mechanical::opcode_204_run() { +void Mechanical::opcode_204_run() { if (g_opcode204Parameters.enabled) { // TODO: Fill in Logic. // Var 12 holds Large Cog Position in range 0 to 5 @@ -491,11 +420,11 @@ void MystScriptParser_Mechanical::opcode_204_run() { } } -void MystScriptParser_Mechanical::opcode_204_disable() { +void Mechanical::opcode_204_disable() { g_opcode204Parameters.enabled = false; } -void MystScriptParser_Mechanical::opcode_204(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_204(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 6180 (Lower Elevator Puzzle) @@ -512,17 +441,17 @@ static struct { bool enabled; } g_opcode205Parameters; -void MystScriptParser_Mechanical::opcode_205_run() { +void Mechanical::opcode_205_run() { // Used for Card 6156 (Fortress Rotation Controls) // TODO: Fill in function... // g_opcode205Parameters.soundIdPosition[4] } -void MystScriptParser_Mechanical::opcode_205_disable() { +void Mechanical::opcode_205_disable() { g_opcode205Parameters.enabled = false; } -void MystScriptParser_Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 6156 (Fortress Rotation Controls) @@ -545,7 +474,7 @@ static struct { bool enabled; } g_opcode206Parameters; -void MystScriptParser_Mechanical::opcode_206_run() { +void Mechanical::opcode_206_run() { if (g_opcode206Parameters.enabled) { // Used for Card 6044 (Fortress Rotation Simulator) @@ -556,11 +485,11 @@ void MystScriptParser_Mechanical::opcode_206_run() { } } -void MystScriptParser_Mechanical::opcode_206_disable() { +void Mechanical::opcode_206_disable() { g_opcode206Parameters.enabled = false; } -void MystScriptParser_Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 6044 (Fortress Rotation Simulator) @@ -582,18 +511,18 @@ static struct { bool enabled; } g_opcode209Parameters; -void MystScriptParser_Mechanical::opcode_209_run() { +void Mechanical::opcode_209_run() { // Used for Card 6044 (Fortress Rotation Simulator) // TODO: Implement Function For Secret Panel State as // per Opcode 200 function (Mechanical) } -void MystScriptParser_Mechanical::opcode_209_disable() { +void Mechanical::opcode_209_disable() { g_opcode209Parameters.enabled = false; } -void MystScriptParser_Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 6044 (Fortress Rotation Simulator) @@ -603,10 +532,11 @@ void MystScriptParser_Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } -void MystScriptParser_Mechanical::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Mechanical::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used in Card 6156 (Fortress Elevator View) varUnusedCheck(op, var); // TODO: Fill in Logic. Clearing Variable for View? } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 3c7701c12d..7142425eb4 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Mechanical : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Mechanical : public MystScriptParser { public: - MystScriptParser_Mechanical(MohawkEngine_Myst *vm); - ~MystScriptParser_Mechanical(); + Mechanical(MohawkEngine_Myst *vm); + ~Mechanical(); void disablePersistentScripts(); void runPersistentScripts(); @@ -51,14 +52,8 @@ 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(); void opcode_202_disable(); - void opcode_203_run(); - void opcode_203_disable(); void opcode_204_run(); void opcode_204_disable(); void opcode_205_run(); @@ -68,7 +63,8 @@ private: void opcode_209_run(); void opcode_209_disable(); - DECLARE_OPCODE(opcode_104); + DECLARE_OPCODE(o_throneEnablePassage); + DECLARE_OPCODE(o_snakeBoxTrigger); DECLARE_OPCODE(o_fortressStaircaseMovie); DECLARE_OPCODE(opcode_121); DECLARE_OPCODE(opcode_122); @@ -83,10 +79,10 @@ private: DECLARE_OPCODE(o_crystalLeaveGreen); DECLARE_OPCODE(o_crystalLeaveRed); - DECLARE_OPCODE(opcode_200); - DECLARE_OPCODE(opcode_201); + DECLARE_OPCODE(o_throne_init); + DECLARE_OPCODE(o_fortressStaircase_init); DECLARE_OPCODE(opcode_202); - DECLARE_OPCODE(opcode_203); + DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(opcode_204); DECLARE_OPCODE(opcode_205); DECLARE_OPCODE(opcode_206); @@ -101,8 +97,11 @@ private: uint16 _fortressPosition; // 82 uint16 _crystalLit; // 130 + + MystResourceType6 *_snakeBox; // 156 }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 3bcc83527b..5f05a8dded 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -37,10 +37,9 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -// NOTE: Credits Start Card is 10000 - -MystScriptParser_Myst::MystScriptParser_Myst(MohawkEngine_Myst *vm) : +Myst::Myst(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(_vm->_gameState->_myst) { setupOpcodes(); @@ -62,12 +61,12 @@ MystScriptParser_Myst::MystScriptParser_Myst(MohawkEngine_Myst *vm) : _state.treeLastMoveTime = _vm->_system->getMillis(); } -MystScriptParser_Myst::~MystScriptParser_Myst() { +Myst::~Myst() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Myst::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Myst::x, #x)) -void MystScriptParser_Myst::setupOpcodes() { +void Myst::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, NOP); OPCODE(101, o_libraryBookPageTurnLeft); @@ -211,7 +210,7 @@ void MystScriptParser_Myst::setupOpcodes() { #undef OPCODE -void MystScriptParser_Myst::disablePersistentScripts() { +void Myst::disablePersistentScripts() { _libraryBookcaseMoving = false; _generatorControlRoomRunning = false; _libraryCombinationBookPagesTurning = false; @@ -235,7 +234,7 @@ void MystScriptParser_Myst::disablePersistentScripts() { _gullsFlying3 = false; } -void MystScriptParser_Myst::runPersistentScripts() { +void Myst::runPersistentScripts() { if (_towerRotationMapRunning) towerRotationMap_run(); @@ -306,7 +305,7 @@ void MystScriptParser_Myst::runPersistentScripts() { gullsFly3_run(); } -uint16 MystScriptParser_Myst::getVar(uint16 var) { +uint16 Myst::getVar(uint16 var) { switch(var) { case 0: // Myst Library Bookcase Closed return _state.libraryBookcaseDoor; @@ -630,7 +629,7 @@ uint16 MystScriptParser_Myst::getVar(uint16 var) { } } -void MystScriptParser_Myst::toggleVar(uint16 var) { +void Myst::toggleVar(uint16 var) { switch(var) { case 2: // Marker Switch Near Cabin _state.cabinMarkerSwitch = (_state.cabinMarkerSwitch + 1) % 2; @@ -720,7 +719,7 @@ void MystScriptParser_Myst::toggleVar(uint16 var) { } } -bool MystScriptParser_Myst::setVarValue(uint16 var, uint16 value) { +bool Myst::setVarValue(uint16 var, uint16 value) { bool refresh = false; switch (var) { @@ -775,7 +774,7 @@ bool MystScriptParser_Myst::setVarValue(uint16 var, uint16 value) { return refresh; } -uint16 MystScriptParser_Myst::bookCountPages(uint16 var) { +uint16 Myst::bookCountPages(uint16 var) { uint16 pages = 0; uint16 cnt = 0; @@ -808,7 +807,7 @@ uint16 MystScriptParser_Myst::bookCountPages(uint16 var) { return cnt; } -void MystScriptParser_Myst::o_libraryBookPageTurnLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryBookPageTurnLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Turn book page left", op); if (_libraryBookPage - 1 >= 0) { @@ -826,7 +825,7 @@ void MystScriptParser_Myst::o_libraryBookPageTurnLeft(uint16 op, uint16 var, uin } } -void MystScriptParser_Myst::o_libraryBookPageTurnRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryBookPageTurnRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Turn book page right", op); if (_libraryBookPage + 1 < _libraryBookNumPages) { @@ -844,7 +843,7 @@ void MystScriptParser_Myst::o_libraryBookPageTurnRight(uint16 op, uint16 var, ui } } -void MystScriptParser_Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Myst Card 4162 (Fireplace Grid) debugC(kDebugScript, "Opcode %d: Fireplace grid toggle button", op); @@ -873,7 +872,7 @@ void MystScriptParser_Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint1 } } -void MystScriptParser_Myst::o_fireplaceRotation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_fireplaceRotation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Myst Card 4162 and 4166 (Fireplace Puzzle Rotation Movies) uint16 movieNum = argv[0]; debugC(kDebugScript, "Opcode %d: Play Fireplace Puzzle Rotation Movies", op); @@ -885,7 +884,7 @@ void MystScriptParser_Myst::o_fireplaceRotation(uint16 op, uint16 var, uint16 ar _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("fpin", kMystStack), 167, 4); } -void MystScriptParser_Myst::o_courtyardBoxesCheckSolution(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_courtyardBoxesCheckSolution(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 soundId = argv[0]; debugC(kDebugScript, "Opcode %d: Ship Puzzle Logic", op); @@ -905,7 +904,7 @@ void MystScriptParser_Myst::o_courtyardBoxesCheckSolution(uint16 op, uint16 var, } } -void MystScriptParser_Myst::o_towerRotationStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_towerRotationStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _towerRotationBlinkLabel = false; _towerRotationMapClicked = true; _towerRotationSpeed = 0; @@ -920,7 +919,7 @@ void MystScriptParser_Myst::o_towerRotationStart(uint16 op, uint16 var, uint16 a _vm->_sound->replaceSoundMyst(5378, Audio::Mixer::kMaxChannelVolume, true); } -void MystScriptParser_Myst::o_towerRotationEnd(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_towerRotationEnd(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _towerRotationMapClicked = false; // Set angle value to expected value @@ -948,7 +947,7 @@ void MystScriptParser_Myst::o_towerRotationEnd(uint16 op, uint16 var, uint16 arg _towerRotationBlinkLabelCount = 0; } -void MystScriptParser_Myst::o_imagerChangeSelection(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_imagerChangeSelection(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Dock imager change selection", op); if (_imagerValidationStep != 10) { @@ -974,7 +973,7 @@ void MystScriptParser_Myst::o_imagerChangeSelection(uint16 op, uint16 var, uint1 } } -void MystScriptParser_Myst::o_dockVaultOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_dockVaultOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Myst 4143 (Dock near Marker Switch) uint16 soundId = argv[0]; uint16 delay = argv[1]; @@ -1003,7 +1002,7 @@ void MystScriptParser_Myst::o_dockVaultOpen(uint16 op, uint16 var, uint16 argc, } } -void MystScriptParser_Myst::o_dockVaultClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_dockVaultClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Myst 4143 (Dock near Marker Switch) uint16 soundId = argv[0]; uint16 delay = argv[1]; @@ -1030,7 +1029,7 @@ void MystScriptParser_Myst::o_dockVaultClose(uint16 op, uint16 var, uint16 argc, } } -void MystScriptParser_Myst::o_bookGivePage(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_bookGivePage(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 cardIdLose = argv[0]; uint16 cardIdBookCover = argv[1]; uint16 soundIdAddPage = argv[2]; @@ -1117,7 +1116,7 @@ void MystScriptParser_Myst::o_bookGivePage(uint16 op, uint16 var, uint16 argc, u } } -void MystScriptParser_Myst::o_clockWheelsExecute(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockWheelsExecute(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 4006 (Clock Tower Time Controls) uint16 soundId = argv[0]; @@ -1153,7 +1152,7 @@ void MystScriptParser_Myst::o_clockWheelsExecute(uint16 op, uint16 var, uint16 a } } -void MystScriptParser_Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager play button", op); uint16 video = getVar(51); @@ -1232,7 +1231,7 @@ void MystScriptParser_Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 arg _vm->_cursor->showCursor(); } -void MystScriptParser_Myst::o_imagerEraseButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_imagerEraseButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager erase button", op); _imagerRedButton = static_cast<MystResourceType8 *>(_invokingResource->_parent); @@ -1279,7 +1278,7 @@ void MystScriptParser_Myst::o_imagerEraseButton(uint16 op, uint16 var, uint16 ar } } -void MystScriptParser_Myst::imagerValidation_run() { +void Myst::imagerValidation_run() { uint32 time = _vm->_system->getMillis(); if (time > _startTime) { @@ -1307,7 +1306,7 @@ void MystScriptParser_Myst::imagerValidation_run() { } } -void MystScriptParser_Myst::o_towerElevatorAnimation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_towerElevatorAnimation(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tower elevator animation", op); _treeStopped = true; @@ -1332,7 +1331,7 @@ void MystScriptParser_Myst::o_towerElevatorAnimation(uint16 op, uint16 var, uint _treeStopped = false; } -void MystScriptParser_Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator button pressed", op); MystResource *button = _invokingResource->_parent; @@ -1374,13 +1373,13 @@ void MystScriptParser_Myst::o_generatorButtonPressed(uint16 op, uint16 var, uint _state.generatorBreakers = _vm->_rnd->getRandomNumberRng(1, 2); } -void MystScriptParser_Myst::generatorRedrawRocket() { +void Myst::generatorRedrawRocket() { _vm->redrawArea(64); _vm->redrawArea(65); _vm->redrawArea(97); } -void MystScriptParser_Myst::generatorButtonValue(MystResource *button, uint16 &mask, uint16 &value) { +void Myst::generatorButtonValue(MystResource *button, uint16 &mask, uint16 &value) { switch (button->getType8Var()) { case 52: // Generator Switch #1 mask = 1; @@ -1425,7 +1424,7 @@ void MystScriptParser_Myst::generatorButtonValue(MystResource *button, uint16 &m } } -void MystScriptParser_Myst::o_cabinSafeChangeDigit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinSafeChangeDigit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cabin safe change digit", op); uint16 d1 = _state.cabinSafeCombination / 100; @@ -1444,7 +1443,7 @@ void MystScriptParser_Myst::o_cabinSafeChangeDigit(uint16 op, uint16 var, uint16 _vm->redrawArea(var); } -void MystScriptParser_Myst::o_cabinSafeHandleStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinSafeHandleStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cabin safe handle start move", op); // Used on Card 4100 @@ -1454,7 +1453,7 @@ void MystScriptParser_Myst::o_cabinSafeHandleStartMove(uint16 op, uint16 var, ui _tempVar = 0; } -void MystScriptParser_Myst::o_cabinSafeHandleMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinSafeHandleMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cabin safe handle move", op); // Used on Card 4100 @@ -1484,7 +1483,7 @@ void MystScriptParser_Myst::o_cabinSafeHandleMove(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Myst::o_cabinSafeHandleEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinSafeHandleEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cabin safe handle end move", op); // Used on Card 4100 @@ -1493,7 +1492,7 @@ void MystScriptParser_Myst::o_cabinSafeHandleEndMove(uint16 op, uint16 var, uint _vm->checkCursorHints(); } -void MystScriptParser_Myst::o_observatoryMonthChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryMonthChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory month change start", op); _vm->_sound->pauseBackgroundMyst(); @@ -1528,7 +1527,7 @@ void MystScriptParser_Myst::o_observatoryMonthChangeStart(uint16 op, uint16 var, _observatoryMonthChanging = true; } -void MystScriptParser_Myst::observatoryIncrementMonth(int16 increment) { +void Myst::observatoryIncrementMonth(int16 increment) { int16 newMonth = _state.observatoryMonthSetting + increment; if (newMonth >= 0 && newMonth <= 11) { @@ -1547,12 +1546,12 @@ void MystScriptParser_Myst::observatoryIncrementMonth(int16 increment) { _vm->_sound->replaceSoundMyst(8500); } -void MystScriptParser_Myst::observatoryMonthChange_run() { +void Myst::observatoryMonthChange_run() { if (_startTime + 500 < _vm->_system->getMillis()) observatoryIncrementMonth(_observatoryIncrement); } -void MystScriptParser_Myst::o_observatoryDayChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryDayChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory day change start", op); _vm->_sound->pauseBackgroundMyst(); @@ -1587,7 +1586,7 @@ void MystScriptParser_Myst::o_observatoryDayChangeStart(uint16 op, uint16 var, u _observatoryDayChanging = true; } -void MystScriptParser_Myst::observatoryIncrementDay(int16 increment) { +void Myst::observatoryIncrementDay(int16 increment) { int16 newDay = _state.observatoryDaySetting + increment; if (newDay >= 1 && newDay <= 31) { @@ -1607,12 +1606,12 @@ void MystScriptParser_Myst::observatoryIncrementDay(int16 increment) { _vm->_sound->replaceSoundMyst(8500); } -void MystScriptParser_Myst::observatoryDayChange_run() { +void Myst::observatoryDayChange_run() { if (_startTime + 500 < _vm->_system->getMillis()) observatoryIncrementDay(_observatoryIncrement); } -void MystScriptParser_Myst::o_observatoryYearChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryYearChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory year change start", op); _vm->_sound->pauseBackgroundMyst(); @@ -1639,7 +1638,7 @@ void MystScriptParser_Myst::o_observatoryYearChangeStart(uint16 op, uint16 var, _observatoryYearChanging = true; } -void MystScriptParser_Myst::observatoryIncrementYear(int16 increment) { +void Myst::observatoryIncrementYear(int16 increment) { int16 newYear = _state.observatoryYearSetting + increment; if (newYear >= 0 && newYear <= 9999) { @@ -1661,12 +1660,12 @@ void MystScriptParser_Myst::observatoryIncrementYear(int16 increment) { _vm->_sound->replaceSoundMyst(8500); } -void MystScriptParser_Myst::observatoryYearChange_run() { +void Myst::observatoryYearChange_run() { if (_startTime + 500 < _vm->_system->getMillis()) observatoryIncrementYear(_observatoryIncrement); } -void MystScriptParser_Myst::o_observatoryTimeChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryTimeChangeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory time change start", op); _vm->_sound->pauseBackgroundMyst(); @@ -1693,7 +1692,7 @@ void MystScriptParser_Myst::o_observatoryTimeChangeStart(uint16 op, uint16 var, _observatoryTimeChanging = true; } -void MystScriptParser_Myst::observatoryIncrementTime(int16 increment) { +void Myst::observatoryIncrementTime(int16 increment) { int16 newTime = _state.observatoryTimeSetting + increment; if (newTime >= 0 && newTime <= 1439) { @@ -1720,12 +1719,12 @@ void MystScriptParser_Myst::observatoryIncrementTime(int16 increment) { _vm->_sound->replaceSoundMyst(8500); } -void MystScriptParser_Myst::observatoryTimeChange_run() { +void Myst::observatoryTimeChange_run() { if (_startTime + 500 < _vm->_system->getMillis()) observatoryIncrementTime(_observatoryIncrement); } -void MystScriptParser_Myst::o_observatoryGoButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryGoButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory go button", op); // Setting not at target @@ -1759,31 +1758,31 @@ void MystScriptParser_Myst::o_observatoryGoButton(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Myst::o_observatoryMonthSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryMonthSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Month slider move", op); observatoryUpdateMonth(); } -void MystScriptParser_Myst::o_observatoryDaySliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryDaySliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Day slider move", op); observatoryUpdateDay(); } -void MystScriptParser_Myst::o_observatoryYearSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryYearSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Year slider move", op); observatoryUpdateYear(); } -void MystScriptParser_Myst::o_observatoryTimeSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryTimeSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Time slider move", op); observatoryUpdateTime(); } -void MystScriptParser_Myst::o_circuitBreakerStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_circuitBreakerStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker start move", op); MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); @@ -1792,7 +1791,7 @@ void MystScriptParser_Myst::o_circuitBreakerStartMove(uint16 op, uint16 var, uin _tempVar = 0; } -void MystScriptParser_Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker move", op); MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); @@ -1843,7 +1842,7 @@ void MystScriptParser_Myst::o_circuitBreakerMove(uint16 op, uint16 var, uint16 a } } -void MystScriptParser_Myst::o_circuitBreakerEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_circuitBreakerEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Circuit breaker end move", op); MystResourceType12 *breaker = static_cast<MystResourceType12 *>(_invokingResource); @@ -1851,7 +1850,7 @@ void MystScriptParser_Myst::o_circuitBreakerEndMove(uint16 op, uint16 var, uint1 _vm->checkCursorHints(); } -void MystScriptParser_Myst::o_boilerIncreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_boilerIncreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Boiler increase pressure start", op); _treeStopped = true; @@ -1861,7 +1860,7 @@ void MystScriptParser_Myst::o_boilerIncreasePressureStart(uint16 op, uint16 var, _boilerPressureIncreasing = true; } -void MystScriptParser_Myst::o_boilerLightPilot(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_boilerLightPilot(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Boiler light pilot", op); // Match is lit @@ -1882,7 +1881,7 @@ void MystScriptParser_Myst::o_boilerLightPilot(uint16 op, uint16 var, uint16 arg } } -void MystScriptParser_Myst::o_boilerIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_boilerIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Boiler increase pressure stop", op); _treeStopped = false; @@ -1898,7 +1897,7 @@ void MystScriptParser_Myst::o_boilerIncreasePressureStop(uint16 op, uint16 var, _vm->_sound->replaceBackgroundMyst(4098, _state.cabinValvePosition << 10); } -void MystScriptParser_Myst::boilerPressureIncrease_run() { +void Myst::boilerPressureIncrease_run() { // Allow increasing pressure if sound has stopped if (!_vm->_sound->isPlaying(5098) && _state.cabinValvePosition < 25) { _state.cabinValvePosition++; @@ -1922,7 +1921,7 @@ void MystScriptParser_Myst::boilerPressureIncrease_run() { } } -void MystScriptParser_Myst::boilerPressureDecrease_run() { +void Myst::boilerPressureDecrease_run() { // Allow decreasing pressure if sound has stopped if (!_vm->_sound->isPlaying(5098) && _state.cabinValvePosition > 0) { _state.cabinValvePosition--; @@ -1941,7 +1940,7 @@ void MystScriptParser_Myst::boilerPressureDecrease_run() { } } -void MystScriptParser_Myst::o_boilerDecreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_boilerDecreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Boiler decrease pressure start", op); _treeStopped = true; @@ -1950,7 +1949,7 @@ void MystScriptParser_Myst::o_boilerDecreasePressureStart(uint16 op, uint16 var, _boilerPressureDecreasing = true; } -void MystScriptParser_Myst::o_boilerDecreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_boilerDecreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Boiler decrease pressure stop", op); _treeStopped = false; @@ -1968,14 +1967,14 @@ void MystScriptParser_Myst::o_boilerDecreasePressureStop(uint16 op, uint16 var, } } -void MystScriptParser_Myst::o_basementIncreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_basementIncreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Basement increase pressure start", op); _treeStopped = true; _basementPressureIncreasing = true; } -void MystScriptParser_Myst::o_basementIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_basementIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Basement increase pressure stop", op); _treeStopped = false; @@ -1983,7 +1982,7 @@ void MystScriptParser_Myst::o_basementIncreasePressureStop(uint16 op, uint16 var _state.treeLastMoveTime = _vm->_system->getMillis(); } -void MystScriptParser_Myst::basementPressureIncrease_run() { +void Myst::basementPressureIncrease_run() { // Allow increasing pressure if sound has stopped if (!_vm->_sound->isPlaying(4642) && _state.cabinValvePosition < 25) { _state.cabinValvePosition++; @@ -1996,7 +1995,7 @@ void MystScriptParser_Myst::basementPressureIncrease_run() { } } -void MystScriptParser_Myst::basementPressureDecrease_run() { +void Myst::basementPressureDecrease_run() { // Allow decreasing pressure if sound has stopped if (!_vm->_sound->isPlaying(4642) && _state.cabinValvePosition > 0) { _state.cabinValvePosition--; @@ -2009,14 +2008,14 @@ void MystScriptParser_Myst::basementPressureDecrease_run() { } } -void MystScriptParser_Myst::o_basementDecreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_basementDecreasePressureStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Basement decrease pressure start", op); _treeStopped = true; _basementPressureDecreasing = true; } -void MystScriptParser_Myst::o_basementDecreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_basementDecreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Basement decrease pressure stop", op); _treeStopped = false; @@ -2024,7 +2023,7 @@ void MystScriptParser_Myst::o_basementDecreasePressureStop(uint16 op, uint16 var _state.treeLastMoveTime = _vm->_system->getMillis(); } -void MystScriptParser_Myst::tree_run() { +void Myst::tree_run() { uint16 pressure; if (_state.cabinPilotLightLit) pressure = _state.cabinValvePosition; @@ -2073,7 +2072,7 @@ void MystScriptParser_Myst::tree_run() { } } -void MystScriptParser_Myst::treeSetAlcoveAccessible() { +void Myst::treeSetAlcoveAccessible() { if (_treeAlcove) { // Make alcove accessible if the tree is in the correct position _treeAlcove->setEnabled(_state.treePosition >= _treeMinAccessiblePosition @@ -2081,14 +2080,14 @@ void MystScriptParser_Myst::treeSetAlcoveAccessible() { } } -uint32 MystScriptParser_Myst::treeNextMoveDelay(uint16 pressure) { +uint32 Myst::treeNextMoveDelay(uint16 pressure) { if (pressure >= 12) return 25000 * (13 - (pressure - 12)) / 12 + 3000; else return 25000 * pressure / 13 + 3000; } -void MystScriptParser_Myst::o_rocketSoundSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketSoundSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket slider start move", op); _rocketSliderSound = 0; @@ -2097,13 +2096,13 @@ void MystScriptParser_Myst::o_rocketSoundSliderStartMove(uint16 op, uint16 var, rocketSliderMove(); } -void MystScriptParser_Myst::o_rocketSoundSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketSoundSliderMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket slider move", op); rocketSliderMove(); } -void MystScriptParser_Myst::o_rocketSoundSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketSoundSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket slider end move", op); _vm->checkCursorHints(); @@ -2125,7 +2124,7 @@ void MystScriptParser_Myst::o_rocketSoundSliderEndMove(uint16 op, uint16 var, ui _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Myst::rocketSliderMove() { +void Myst::rocketSliderMove() { MystResourceType10 *slider = static_cast<MystResourceType10 *>(_invokingResource); if (_state.generatorVoltage == 59 && !_state.generatorBreakers) { @@ -2137,11 +2136,11 @@ void MystScriptParser_Myst::rocketSliderMove() { } } -uint16 MystScriptParser_Myst::rocketSliderGetSound(uint16 pos) { +uint16 Myst::rocketSliderGetSound(uint16 pos) { return (uint16)(9530 + (pos - 216) * 35.0 * 0.01639344262295082); } -void MystScriptParser_Myst::rocketCheckSolution() { +void Myst::rocketCheckSolution() { _vm->_cursor->hideCursor(); uint16 soundId; @@ -2211,7 +2210,7 @@ void MystScriptParser_Myst::rocketCheckSolution() { _vm->_cursor->showCursor(); } -void MystScriptParser_Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket piano start move", op); MystResourceType11 *key = static_cast<MystResourceType11 *>(_invokingResource); @@ -2234,7 +2233,7 @@ void MystScriptParser_Myst::o_rocketPianoStart(uint16 op, uint16 var, uint16 arg } } -void MystScriptParser_Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket piano move", op); const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); @@ -2280,7 +2279,7 @@ void MystScriptParser_Myst::o_rocketPianoMove(uint16 op, uint16 var, uint16 argc _vm->_system->updateScreen(); } -void MystScriptParser_Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket piano end move", op); MystResourceType8 *key = static_cast<MystResourceType8 *>(_invokingResource); @@ -2298,7 +2297,7 @@ void MystScriptParser_Myst::o_rocketPianoStop(uint16 op, uint16 var, uint16 argc _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever start move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -2308,7 +2307,7 @@ void MystScriptParser_Myst::o_rocketLeverStartMove(uint16 op, uint16 var, uint16 lever->drawFrame(0); } -void MystScriptParser_Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket open link book", op); // Flyby movie @@ -2318,7 +2317,7 @@ void MystScriptParser_Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, _tempVar = 2; } -void MystScriptParser_Myst::o_rocketLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -2347,7 +2346,7 @@ void MystScriptParser_Myst::o_rocketLeverMove(uint16 op, uint16 var, uint16 argc _rocketLeverPosition = step; } -void MystScriptParser_Myst::o_rocketLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket lever end move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -2357,7 +2356,7 @@ void MystScriptParser_Myst::o_rocketLeverEndMove(uint16 op, uint16 var, uint16 a lever->drawFrame(0); } -void MystScriptParser_Myst::o_cabinLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Leave cabin", op); // If match is lit, put out @@ -2369,7 +2368,7 @@ void MystScriptParser_Myst::o_cabinLeave(uint16 op, uint16 var, uint16 argc, uin } } -void MystScriptParser_Myst::o_treePressureReleaseStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treePressureReleaseStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tree pressure release start", op); Common::Rect src = Common::Rect(0, 0, 49, 86); @@ -2386,7 +2385,7 @@ void MystScriptParser_Myst::o_treePressureReleaseStart(uint16 op, uint16 var, ui } } -void MystScriptParser_Myst::o_treePressureReleaseStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treePressureReleaseStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tree pressure release stop", op); Common::Rect rect = Common::Rect(78, 46, 127, 132); @@ -2397,7 +2396,7 @@ void MystScriptParser_Myst::o_treePressureReleaseStop(uint16 op, uint16 var, uin _treeMinPosition = 0; } -void MystScriptParser_Myst::o_observatoryMonthSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryMonthSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Month slider start move", op); _vm->_cursor->setCursor(700); @@ -2406,7 +2405,7 @@ void MystScriptParser_Myst::o_observatoryMonthSliderStartMove(uint16 op, uint16 observatoryUpdateMonth(); } -void MystScriptParser_Myst::o_observatoryMonthSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryMonthSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Month slider end move", op); _vm->checkCursorHints(); @@ -2415,7 +2414,7 @@ void MystScriptParser_Myst::o_observatoryMonthSliderEndMove(uint16 op, uint16 va observatoryUpdateMonth(); } -void MystScriptParser_Myst::observatoryUpdateMonth() { +void Myst::observatoryUpdateMonth() { int16 month = (_observatoryMonthSlider->_pos.y - 94) / 8; if (month != _state.observatoryMonthSetting) { @@ -2428,7 +2427,7 @@ void MystScriptParser_Myst::observatoryUpdateMonth() { } } -void MystScriptParser_Myst::o_observatoryDaySliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryDaySliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Day slider start move", op); _vm->_cursor->setCursor(700); @@ -2437,7 +2436,7 @@ void MystScriptParser_Myst::o_observatoryDaySliderStartMove(uint16 op, uint16 va observatoryUpdateDay(); } -void MystScriptParser_Myst::o_observatoryDaySliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryDaySliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Day slider end move", op); _vm->checkCursorHints(); @@ -2446,7 +2445,7 @@ void MystScriptParser_Myst::o_observatoryDaySliderEndMove(uint16 op, uint16 var, observatoryUpdateDay(); } -void MystScriptParser_Myst::observatoryUpdateDay() { +void Myst::observatoryUpdateDay() { int16 day = (_observatoryDaySlider->_pos.y - 94) * 30 / 94 + 1; if (day != _state.observatoryDaySetting) { @@ -2460,7 +2459,7 @@ void MystScriptParser_Myst::observatoryUpdateDay() { } } -void MystScriptParser_Myst::o_observatoryYearSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryYearSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Year slider start move", op); _vm->_cursor->setCursor(700); @@ -2469,7 +2468,7 @@ void MystScriptParser_Myst::o_observatoryYearSliderStartMove(uint16 op, uint16 v observatoryUpdateYear(); } -void MystScriptParser_Myst::o_observatoryYearSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryYearSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Year slider end move", op); _vm->checkCursorHints(); @@ -2478,7 +2477,7 @@ void MystScriptParser_Myst::o_observatoryYearSliderEndMove(uint16 op, uint16 var observatoryUpdateYear(); } -void MystScriptParser_Myst::observatoryUpdateYear() { +void Myst::observatoryUpdateYear() { int16 year = (_observatoryYearSlider->_pos.y - 94) * 9999 / 94; if (year != _state.observatoryYearSetting) { @@ -2494,7 +2493,7 @@ void MystScriptParser_Myst::observatoryUpdateYear() { } } -void MystScriptParser_Myst::o_observatoryTimeSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryTimeSliderStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Time slider start move", op); _vm->_cursor->setCursor(700); @@ -2503,7 +2502,7 @@ void MystScriptParser_Myst::o_observatoryTimeSliderStartMove(uint16 op, uint16 v observatoryUpdateTime(); } -void MystScriptParser_Myst::o_observatoryTimeSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryTimeSliderEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Time slider end move", op); _vm->checkCursorHints(); @@ -2512,7 +2511,7 @@ void MystScriptParser_Myst::o_observatoryTimeSliderEndMove(uint16 op, uint16 var observatoryUpdateTime(); } -void MystScriptParser_Myst::observatoryUpdateTime() { +void Myst::observatoryUpdateTime() { int16 time = (_observatoryTimeSlider->_pos.y - 94) * 1439 / 94; if (time != _state.observatoryTimeSetting) { @@ -2532,12 +2531,12 @@ void MystScriptParser_Myst::observatoryUpdateTime() { } } -void MystScriptParser_Myst::o_libraryCombinationBookStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryCombinationBookStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Combination book stop turning pages", op); _libraryCombinationBookPagesTurning = false; } -void MystScriptParser_Myst::o_cabinMatchLight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_cabinMatchLight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { if (!_cabinMatchState) { _vm->_sound->replaceSoundMyst(4103); @@ -2552,7 +2551,7 @@ void MystScriptParser_Myst::o_cabinMatchLight(uint16 op, uint16 var, uint16 argc } } -void MystScriptParser_Myst::matchBurn_run() { +void Myst::matchBurn_run() { uint32 time = _vm->_system->getMillis(); if (time > _matchGoOutTime) { @@ -2576,41 +2575,41 @@ void MystScriptParser_Myst::matchBurn_run() { } } -void MystScriptParser_Myst::o_courtyardBoxEnter(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_courtyardBoxEnter(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Mouse enters courtyard box", op); _tempVar = 1; _vm->_sound->playSound(_courtyardBoxSound); _vm->redrawArea(var); } -void MystScriptParser_Myst::o_courtyardBoxLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_courtyardBoxLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Mouse leaves courtyard box", op); _tempVar = 0; _vm->redrawArea(var); } -void MystScriptParser_Myst::o_clockMinuteWheelStartTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockMinuteWheelStartTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 4006 debugC(kDebugScript, "Opcode %d: Minute wheel start turn", op); clockWheelStartTurn(2); } -void MystScriptParser_Myst::o_clockWheelEndTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockWheelEndTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 4006 debugC(kDebugScript, "Opcode %d: Wheel end turn", op); _clockTurningWheel = 0; } -void MystScriptParser_Myst::o_clockHourWheelStartTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockHourWheelStartTurn(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Card 4006 debugC(kDebugScript, "Opcode %d: Hour wheel start turn", op); clockWheelStartTurn(1); } -void MystScriptParser_Myst::clockWheel_run() { +void Myst::clockWheel_run() { // Turn wheel one step each second uint32 time = _vm->_system->getMillis(); @@ -2626,7 +2625,7 @@ void MystScriptParser_Myst::clockWheel_run() { } } -void MystScriptParser_Myst::clockWheelStartTurn(uint16 wheel) { +void Myst::clockWheelStartTurn(uint16 wheel) { MystResourceType11 *resource = static_cast<MystResourceType11 *>(_invokingResource); uint16 soundId = resource->getList1(0); @@ -2646,7 +2645,7 @@ void MystScriptParser_Myst::clockWheelStartTurn(uint16 wheel) { _startTime = _vm->_system->getMillis(); } -void MystScriptParser_Myst::clockWheelTurn(uint16 var) { +void Myst::clockWheelTurn(uint16 var) { if (var == 38) { // Hours _state.clockTowerHourPosition = (_state.clockTowerHourPosition + 1) % 12; @@ -2656,7 +2655,7 @@ void MystScriptParser_Myst::clockWheelTurn(uint16 var) { } } -void MystScriptParser_Myst::o_libraryCombinationBookStartRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryCombinationBookStartRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Combination book start turning pages right", op); _tempVar = 0; @@ -2665,7 +2664,7 @@ void MystScriptParser_Myst::o_libraryCombinationBookStartRight(uint16 op, uint16 _libraryCombinationBookPagesTurning = true; } -void MystScriptParser_Myst::o_libraryCombinationBookStartLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryCombinationBookStartLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Combination book start turning pages left", op); _tempVar = 0; @@ -2674,7 +2673,7 @@ void MystScriptParser_Myst::o_libraryCombinationBookStartLeft(uint16 op, uint16 _libraryCombinationBookPagesTurning = true; } -void MystScriptParser_Myst::libraryCombinationBookTurnLeft() { +void Myst::libraryCombinationBookTurnLeft() { // Turn page left if (_libraryBookPage - 1 >= 0) { _tempVar--; @@ -2700,7 +2699,7 @@ void MystScriptParser_Myst::libraryCombinationBookTurnLeft() { } } -void MystScriptParser_Myst::libraryCombinationBookTurnRight() { +void Myst::libraryCombinationBookTurnRight() { // Turn page right if (_libraryBookPage + 1 < _libraryBookNumPages) { _tempVar++; @@ -2726,7 +2725,7 @@ void MystScriptParser_Myst::libraryCombinationBookTurnRight() { } } -void MystScriptParser_Myst::libraryCombinationBook_run() { +void Myst::libraryCombinationBook_run() { uint32 time = _vm->_system->getMillis(); if (time >= _startTime + 500) { if (_tempVar > 0) { @@ -2739,7 +2738,7 @@ void MystScriptParser_Myst::libraryCombinationBook_run() { } } -void MystScriptParser_Myst::o_observatoryChangeSettingStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatoryChangeSettingStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Observatory change setting stop", op); // Stop persistent scripts @@ -2758,7 +2757,7 @@ void MystScriptParser_Myst::o_observatoryChangeSettingStop(uint16 op, uint16 var _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Myst::o_dockVaultForceClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_dockVaultForceClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Myst 4143 (Dock near Marker Switch) uint16 soundId = argv[0]; uint16 delay = argv[1]; @@ -2782,12 +2781,12 @@ void MystScriptParser_Myst::o_dockVaultForceClose(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Myst::o_imagerEraseStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_imagerEraseStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager stop erase", op); _imagerValidationRunning = false; } -void MystScriptParser_Myst::o_clockLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock lever start move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); lever->drawFrame(0); @@ -2796,7 +2795,7 @@ void MystScriptParser_Myst::o_clockLeverStartMove(uint16 op, uint16 var, uint16 _clockLeverPulled = false; } -void MystScriptParser_Myst::o_clockLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock left lever move", op); if (!_clockLeverPulled) { @@ -2822,7 +2821,7 @@ void MystScriptParser_Myst::o_clockLeverMove(uint16 op, uint16 var, uint16 argc, } } -void MystScriptParser_Myst::clockGearForwardOneStep(uint16 gear) { +void Myst::clockGearForwardOneStep(uint16 gear) { static const uint16 startTime[] = { 0, 324, 618 }; static const uint16 endTime[] = { 324, 618, 950 }; static const char *videos[] = { "cl1wg1", "cl1wg2", "cl1wg3" }; @@ -2840,7 +2839,7 @@ void MystScriptParser_Myst::clockGearForwardOneStep(uint16 gear) { Audio::Timestamp(0, endTime[gearPosition], 600)); } -void MystScriptParser_Myst::clockWeightDownOneStep() { +void Myst::clockWeightDownOneStep() { // Set video bounds _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); _vm->_video->setVideoBounds(_clockWeightVideo, @@ -2851,7 +2850,7 @@ void MystScriptParser_Myst::clockWeightDownOneStep() { _clockWeightPosition += 246; } -void MystScriptParser_Myst::clockGears_run() { +void Myst::clockGears_run() { if (!_vm->_video->isVideoPlaying() && _clockWeightPosition < 2214) { _clockMiddleGearMovedAlone = true; _vm->_sound->replaceSoundMyst(5113); @@ -2860,7 +2859,7 @@ void MystScriptParser_Myst::clockGears_run() { } } -void MystScriptParser_Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock lever end move", op); static const char *videos[] = { "cl1wg1", "cl1wg2", "cl1wg3", "cl1wlfch" }; @@ -2887,7 +2886,7 @@ void MystScriptParser_Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 ar _vm->_cursor->showCursor(); } -void MystScriptParser_Myst::clockGearsCheckSolution() { +void Myst::clockGearsCheckSolution() { if (_clockGearsPositions[0] == 2 && _clockGearsPositions[1] == 2 && _clockGearsPositions[2] == 1 @@ -2915,7 +2914,7 @@ void MystScriptParser_Myst::clockGearsCheckSolution() { } } -void MystScriptParser_Myst::o_clockResetLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockResetLeverStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock reset lever start move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -2923,7 +2922,7 @@ void MystScriptParser_Myst::o_clockResetLeverStartMove(uint16 op, uint16 var, ui _vm->_cursor->setCursor(700); } -void MystScriptParser_Myst::o_clockResetLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockResetLeverMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock reset lever move", op); MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); @@ -2933,7 +2932,7 @@ void MystScriptParser_Myst::o_clockResetLeverMove(uint16 op, uint16 var, uint16 clockReset(); } -void MystScriptParser_Myst::clockReset() { +void Myst::clockReset() { static const char *videos[] = { "cl1wg1", "cl1wg2", "cl1wg3", "cl1wlfch" }; _vm->_cursor->hideCursor(); @@ -2971,7 +2970,7 @@ void MystScriptParser_Myst::clockReset() { _vm->_cursor->showCursor(); } -void MystScriptParser_Myst::clockResetWeight() { +void Myst::clockResetWeight() { // Set video bounds, weight going up if (!(_vm->getFeatures() & GF_ME)) { _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); @@ -2987,7 +2986,7 @@ void MystScriptParser_Myst::clockResetWeight() { _clockWeightPosition = 0; } -void MystScriptParser_Myst::clockResetGear(uint16 gear) { +void Myst::clockResetGear(uint16 gear) { static const uint16 time[] = { 324, 618, 950 }; static const char *videos[] = { "cl1wg1", "cl1wg2", "cl1wg3" }; static const uint16 x[] = { 224, 224, 224 }; @@ -3006,7 +3005,7 @@ void MystScriptParser_Myst::clockResetGear(uint16 gear) { _clockGearsPositions[gear] = 3; } -void MystScriptParser_Myst::o_clockResetLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockResetLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Clock reset lever end move", op); // Get current lever frame @@ -3017,7 +3016,7 @@ void MystScriptParser_Myst::o_clockResetLeverEndMove(uint16 op, uint16 var, uint _vm->checkCursorHints(); } -void MystScriptParser_Myst::o_libraryBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _libraryBookPage = 0; _libraryBookNumPages = argv[0]; _libraryBookBaseImage = argv[1]; @@ -3025,13 +3024,13 @@ void MystScriptParser_Myst::o_libraryBook_init(uint16 op, uint16 var, uint16 arg _libraryBookSound2 = argv[3]; } -void MystScriptParser_Myst::o_courtyardBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_courtyardBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Courtyard box init", op); _courtyardBoxSound = argv[0]; } -void MystScriptParser_Myst::towerRotationMap_run() { +void Myst::towerRotationMap_run() { if (!_towerRotationMapInitialized) { _towerRotationMapInitialized = true; _vm->_sound->replaceSoundMyst(4378); @@ -3072,7 +3071,7 @@ void MystScriptParser_Myst::towerRotationMap_run() { } } -void MystScriptParser_Myst::o_towerRotationMap_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_towerRotationMap_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _towerRotationMapRunning = true; _towerRotationMapTower = static_cast<MystResourceType11 *>(_invokingResource); _towerRotationMapLabel = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); @@ -3081,7 +3080,7 @@ void MystScriptParser_Myst::o_towerRotationMap_init(uint16 op, uint16 var, uint1 _towerRotationMapClicked = false; } -void MystScriptParser_Myst::towerRotationDrawBuildings() { +void Myst::towerRotationDrawBuildings() { // Draw library _vm->redrawArea(304, false); @@ -3092,7 +3091,7 @@ void MystScriptParser_Myst::towerRotationDrawBuildings() { } } -uint16 MystScriptParser_Myst::towerRotationMapComputeAngle() { +uint16 Myst::towerRotationMapComputeAngle() { _towerRotationSpeed++; if (_towerRotationSpeed >= 7) _towerRotationSpeed = 7; @@ -3128,7 +3127,7 @@ uint16 MystScriptParser_Myst::towerRotationMapComputeAngle() { return angle; } -Common::Point MystScriptParser_Myst::towerRotationMapComputeCoords(const Common::Point ¢er, uint16 angle) { +Common::Point Myst::towerRotationMapComputeCoords(const Common::Point ¢er, uint16 angle) { Common::Point end; // Polar to rect coords @@ -3139,7 +3138,7 @@ Common::Point MystScriptParser_Myst::towerRotationMapComputeCoords(const Common: return end; } -void MystScriptParser_Myst::towerRotationMapDrawLine(const Common::Point ¢er, const Common::Point &end) { +void Myst::towerRotationMapDrawLine(const Common::Point ¢er, const Common::Point &end) { Graphics::PixelFormat pf = _vm->_system->getScreenFormat(); uint32 color = 0; @@ -3174,27 +3173,27 @@ void MystScriptParser_Myst::towerRotationMapDrawLine(const Common::Point ¢er _vm->_system->updateScreen(); } -void MystScriptParser_Myst::towerRotationMapRotate() { +void Myst::towerRotationMapRotate() { const Common::Point center = Common::Point(383, 124); uint16 angle = towerRotationMapComputeAngle(); Common::Point end = towerRotationMapComputeCoords(center, angle); towerRotationMapDrawLine(center, end); } -void MystScriptParser_Myst::o_forechamberDoor_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_forechamberDoor_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Card 4138 (Dock Forechamber Door) // Set forechamber door to closed _tempVar = 0; } -void MystScriptParser_Myst::o_shipAccess_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_shipAccess_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Enable acces to the ship if (_state.shipFloating) { _invokingResource->setEnabled(true); } } -void MystScriptParser_Myst::o_butterflies_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_butterflies_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Butterflies movie init", op); // Used for Card 4256 (Butterfly Movie Activation) @@ -3206,7 +3205,7 @@ void MystScriptParser_Myst::o_butterflies_init(uint16 op, uint16 var, uint16 arg } } -void MystScriptParser_Myst::o_imager_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_imager_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Imager init", op); debugC(kDebugScript, "Var: %d", var); @@ -3215,7 +3214,7 @@ void MystScriptParser_Myst::o_imager_init(uint16 op, uint16 var, uint16 argc, ui _imagerRunning = true; } -void MystScriptParser_Myst::imager_run() { +void Myst::imager_run() { _imagerRunning = false; if (_state.imagerActive && _state.imagerSelection == 67) { @@ -3225,7 +3224,7 @@ void MystScriptParser_Myst::imager_run() { } } -void MystScriptParser_Myst::libraryBookcaseTransform_run(void) { +void Myst::libraryBookcaseTransform_run(void) { if (_libraryBookcaseChanged) { _libraryBookcaseChanged = false; _libraryBookcaseMoving = false; @@ -3252,7 +3251,7 @@ void MystScriptParser_Myst::libraryBookcaseTransform_run(void) { } } -void MystScriptParser_Myst::o_libraryBookcaseTransform_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_libraryBookcaseTransform_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { if (_libraryBookcaseChanged) { MystResourceType7 *resource = static_cast<MystResourceType7 *>(_invokingResource); _libraryBookcaseMovie = static_cast<MystResourceType6 *>(resource->getSubResource(getVar(0))); @@ -3261,7 +3260,7 @@ void MystScriptParser_Myst::o_libraryBookcaseTransform_init(uint16 op, uint16 va } } -void MystScriptParser_Myst::generatorControlRoom_run(void) { +void Myst::generatorControlRoom_run(void) { if (_generatorVoltage == _state.generatorVoltage) { generatorRedrawRocket(); } else { @@ -3278,14 +3277,14 @@ void MystScriptParser_Myst::generatorControlRoom_run(void) { } } -void MystScriptParser_Myst::o_generatorControlRoom_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_generatorControlRoom_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator control room init", op); _generatorVoltage = _state.generatorVoltage; _generatorControlRoomRunning = true; } -void MystScriptParser_Myst::o_fireplace_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_fireplace_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Fireplace grid init", op); // Clear fireplace grid @@ -3293,7 +3292,7 @@ void MystScriptParser_Myst::o_fireplace_init(uint16 op, uint16 var, uint16 argc, _fireplaceLines[i] = 0; } -void MystScriptParser_Myst::o_clockGears_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_clockGears_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Card 4113 (Clock Tower Cog Puzzle) debugC(kDebugScript, "Opcode %d: Gears puzzle init", op); @@ -3311,7 +3310,7 @@ void MystScriptParser_Myst::o_clockGears_init(uint16 op, uint16 var, uint16 argc } } -void MystScriptParser_Myst::o_gulls1_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_gulls1_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Gulls init", op); if (!_state.shipFloating) { @@ -3320,7 +3319,7 @@ void MystScriptParser_Myst::o_gulls1_init(uint16 op, uint16 var, uint16 argc, ui } } -void MystScriptParser_Myst::gullsFly1_run() { +void Myst::gullsFly1_run() { static const char* gulls[] = { "birds1", "birds2", "birds3" }; uint32 time = _vm->_system->getMillis(); @@ -3340,7 +3339,7 @@ void MystScriptParser_Myst::gullsFly1_run() { } } -void MystScriptParser_Myst::o_observatory_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_observatory_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Stellar observatory init", op); _tempVar = 0; @@ -3370,13 +3369,13 @@ void MystScriptParser_Myst::o_observatory_init(uint16 op, uint16 var, uint16 arg _observatoryRunning = true; } -bool MystScriptParser_Myst::observatoryIsDDMMYYYY2400() { +bool Myst::observatoryIsDDMMYYYY2400() { // TODO: Auto-detect based on the month rect position return !(_vm->getFeatures() & GF_ME) && (_vm->getLanguage() == Common::FR_FRA || _vm->getLanguage() == Common::DE_DEU); } -void MystScriptParser_Myst::observatoryUpdateVisualizer(uint16 x, uint16 y) { +void Myst::observatoryUpdateVisualizer(uint16 x, uint16 y) { Common::Rect &visu0 = _observatoryVisualizer->_subImages[0].rect; Common::Rect &visu1 = _observatoryVisualizer->_subImages[1].rect; @@ -3391,7 +3390,7 @@ void MystScriptParser_Myst::observatoryUpdateVisualizer(uint16 x, uint16 y) { visu1.bottom = visu0.bottom; } -void MystScriptParser_Myst::observatorySetTargetToSetting() { +void Myst::observatorySetTargetToSetting() { uint32 visuX = _state.observatoryTimeSetting * 7 / 25; uint32 visuY = 250 * _state.observatoryYearSetting + 65 * (_state.observatoryMonthSetting + 1) @@ -3405,7 +3404,7 @@ void MystScriptParser_Myst::observatorySetTargetToSetting() { _state.observatoryTimeTarget = _state.observatoryTimeSetting; } -void MystScriptParser_Myst::observatory_run() { +void Myst::observatory_run() { if (_observatoryNotInitialized) { _observatoryNotInitialized = false; @@ -3463,7 +3462,7 @@ void MystScriptParser_Myst::observatory_run() { } } -void MystScriptParser_Myst::o_gulls2_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_gulls2_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Gulls init", op); if (!_state.shipFloating) { @@ -3472,7 +3471,7 @@ void MystScriptParser_Myst::o_gulls2_init(uint16 op, uint16 var, uint16 argc, ui } } -void MystScriptParser_Myst::gullsFly2_run() { +void Myst::gullsFly2_run() { static const char* gulls[] = { "birds1", "birds2", "birds3" }; uint32 time = _vm->_system->getMillis(); @@ -3486,13 +3485,13 @@ void MystScriptParser_Myst::gullsFly2_run() { } } -void MystScriptParser_Myst::o_treeCard_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treeCard_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Enter tree card", op); _tree = static_cast<MystResourceType8 *>(_invokingResource); } -void MystScriptParser_Myst::o_treeEntry_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treeEntry_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Enter tree card with entry", op); _treeAlcove = static_cast<MystResourceType5 *>(_invokingResource); @@ -3502,7 +3501,7 @@ void MystScriptParser_Myst::o_treeEntry_init(uint16 op, uint16 var, uint16 argc, treeSetAlcoveAccessible(); } -void MystScriptParser_Myst::opcode_218(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::opcode_218(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 4097 (Cabin Boiler) @@ -3520,7 +3519,7 @@ void MystScriptParser_Myst::opcode_218(uint16 op, uint16 var, uint16 argc, uint1 } } -void MystScriptParser_Myst::o_rocketSliders_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketSliders_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket sliders init", op); _rocketSlider1 = static_cast<MystResourceType10 *>(_vm->_resources[argv[0]]); @@ -3541,12 +3540,12 @@ void MystScriptParser_Myst::o_rocketSliders_init(uint16 op, uint16 var, uint16 a _rocketSlider5->setPosition(_state.rocketSliderPosition[4]); } -void MystScriptParser_Myst::o_rocketLinkVideo_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_rocketLinkVideo_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket link video init", op); _tempVar = 0; } -void MystScriptParser_Myst::o_greenBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_greenBook_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Card 4168 (Green Book Movies) debugC(kDebugScript, "Opcode %d: Green book init", op); @@ -3554,7 +3553,7 @@ void MystScriptParser_Myst::o_greenBook_init(uint16 op, uint16 var, uint16 argc, _tempVar = 1; } -void MystScriptParser_Myst::greenBook_run() { +void Myst::greenBook_run() { uint loopStart = 0; uint loopEnd = 0; Common::String file; @@ -3589,7 +3588,7 @@ void MystScriptParser_Myst::greenBook_run() { } } -void MystScriptParser_Myst::o_gulls3_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_gulls3_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Gulls init", op); if (!_state.shipFloating) { @@ -3598,7 +3597,7 @@ void MystScriptParser_Myst::o_gulls3_init(uint16 op, uint16 var, uint16 argc, ui } } -void MystScriptParser_Myst::gullsFly3_run() { +void Myst::gullsFly3_run() { static const char* gulls[] = { "birds1", "birds2", "birds3" }; uint32 time = _vm->_system->getMillis(); @@ -3614,7 +3613,7 @@ void MystScriptParser_Myst::gullsFly3_run() { } } -void MystScriptParser_Myst::o_bookAddSpecialPage_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_bookAddSpecialPage_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Book Exit Function", op); uint16 numPages = bookCountPages(var); @@ -3628,22 +3627,23 @@ void MystScriptParser_Myst::o_bookAddSpecialPage_exit(uint16 op, uint16 var, uin } } -void MystScriptParser_Myst::o_treeCard_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treeCard_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Exit tree card", op); _tree = 0; } -void MystScriptParser_Myst::o_treeEntry_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_treeEntry_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Exit tree card with entry", op); _treeAlcove = 0; } -void MystScriptParser_Myst::o_generatorControlRoom_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Myst::o_generatorControlRoom_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator room exit", op); _generatorVoltage = _state.generatorVoltage; } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index e41527a5b8..51dffd0abe 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Myst : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Myst : public MystScriptParser { public: - MystScriptParser_Myst(MohawkEngine_Myst *vm); - ~MystScriptParser_Myst(); + Myst(MohawkEngine_Myst *vm); + ~Myst(); void disablePersistentScripts(); void runPersistentScripts(); @@ -333,6 +334,7 @@ private: void observatoryUpdateTime(); }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index bbf324714b..dc491c7573 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -33,25 +33,26 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Preview::MystScriptParser_Preview(MohawkEngine_Myst *vm) : MystScriptParser_Myst(vm) { +Preview::Preview(MohawkEngine_Myst *vm) : Myst(vm) { setupOpcodes(); } -MystScriptParser_Preview::~MystScriptParser_Preview() { +Preview::~Preview() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Preview::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Preview::x, #x)) #define OVERRIDE_OPCODE(opcode, x) \ for (uint32 i = 0; i < _opcodes.size(); i++) \ if (_opcodes[i]->op == opcode) { \ - _opcodes[i]->proc = (OpcodeProcMyst) &MystScriptParser_Preview::x; \ + _opcodes[i]->proc = (OpcodeProcMyst) &Preview::x; \ _opcodes[i]->desc = #x; \ break; \ } -void MystScriptParser_Preview::setupOpcodes() { +void Preview::setupOpcodes() { // "Stack-Specific" Opcodes OVERRIDE_OPCODE(196, opcode_196); OVERRIDE_OPCODE(197, opcode_197); @@ -66,7 +67,7 @@ void MystScriptParser_Preview::setupOpcodes() { #undef OPCODE #undef OVERRIDE_OPCODE -void MystScriptParser_Preview::opcode_196(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_196(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card ... @@ -74,7 +75,7 @@ void MystScriptParser_Preview::opcode_196(uint16 op, uint16 var, uint16 argc, ui // Voice Over and Card Advance? } -void MystScriptParser_Preview::opcode_197(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_197(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card ... @@ -83,7 +84,7 @@ void MystScriptParser_Preview::opcode_197(uint16 op, uint16 var, uint16 argc, ui } // TODO: Merge with Opcode 42? -void MystScriptParser_Preview::opcode_198(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_198(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); if (argc == 0) { @@ -94,7 +95,7 @@ void MystScriptParser_Preview::opcode_198(uint16 op, uint16 var, uint16 argc, ui unknown(op, var, argc, argv); } -void MystScriptParser_Preview::opcode_199(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_199(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used on Card ... @@ -102,7 +103,7 @@ void MystScriptParser_Preview::opcode_199(uint16 op, uint16 var, uint16 argc, ui // Voice Over and Card Advance? } -void MystScriptParser_Preview::opcode_298(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_298(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 3000 (Closed Myst Book) @@ -125,7 +126,7 @@ void MystScriptParser_Preview::opcode_298(uint16 op, uint16 var, uint16 argc, ui } } -void MystScriptParser_Preview::opcode_299(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Preview::opcode_299(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); // Used for Card 3002 (Myst Island Overview) @@ -135,4 +136,5 @@ void MystScriptParser_Preview::opcode_299(uint16 op, uint16 var, uint16 argc, ui // can change the Myst Library to Red.. } +} // 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 25f0ab514f..870e4b9272 100644 --- a/engines/mohawk/myst_stacks/preview.h +++ b/engines/mohawk/myst_stacks/preview.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Preview : public MystScriptParser_Myst { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Preview : public Myst { public: - MystScriptParser_Preview(MohawkEngine_Myst *vm); - ~MystScriptParser_Preview(); + Preview(MohawkEngine_Myst *vm); + ~Preview(); private: void setupOpcodes(); @@ -54,6 +55,7 @@ private: DECLARE_OPCODE(opcode_299); }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 3e00d242be..f485bab2f9 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -35,8 +35,9 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Selenitic::MystScriptParser_Selenitic(MohawkEngine_Myst *vm) : +Selenitic::Selenitic(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(vm->_gameState->_selenitic) { setupOpcodes(); _invokingResource = NULL; @@ -44,12 +45,12 @@ MystScriptParser_Selenitic::MystScriptParser_Selenitic(MohawkEngine_Myst *vm) : _mazeRunnerDirection = 8; } -MystScriptParser_Selenitic::~MystScriptParser_Selenitic() { +Selenitic::~Selenitic() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Selenitic::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Selenitic::x, #x)) -void MystScriptParser_Selenitic::setupOpcodes() { +void Selenitic::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_mazeRunnerMove); OPCODE(101, o_mazeRunnerSoundRepeat); @@ -82,16 +83,16 @@ void MystScriptParser_Selenitic::setupOpcodes() { #undef OPCODE -void MystScriptParser_Selenitic::disablePersistentScripts() { +void Selenitic::disablePersistentScripts() { _soundReceiverRunning = false; } -void MystScriptParser_Selenitic::runPersistentScripts() { +void Selenitic::runPersistentScripts() { if (_soundReceiverRunning) soundReceiver_run(); } -uint16 MystScriptParser_Selenitic::getVar(uint16 var) { +uint16 Selenitic::getVar(uint16 var) { switch(var) { case 0: // Sound receiver emitters enabled return _state.emitterEnabledWind; @@ -166,7 +167,7 @@ uint16 MystScriptParser_Selenitic::getVar(uint16 var) { } } -void MystScriptParser_Selenitic::toggleVar(uint16 var) { +void Selenitic::toggleVar(uint16 var) { switch(var) { case 0: // Sound receiver emitters enabled _state.emitterEnabledWind = (_state.emitterEnabledWind + 1) % 2; @@ -211,7 +212,7 @@ void MystScriptParser_Selenitic::toggleVar(uint16 var) { } } -bool MystScriptParser_Selenitic::setVarValue(uint16 var, uint16 value) { +bool Selenitic::setVarValue(uint16 var, uint16 value) { bool refresh = false; switch (var) { @@ -283,7 +284,7 @@ bool MystScriptParser_Selenitic::setVarValue(uint16 var, uint16 value) { return refresh; } -void MystScriptParser_Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 oldPosition = _mazeRunnerPosition; uint16 move = var; @@ -304,7 +305,7 @@ void MystScriptParser_Selenitic::o_mazeRunnerMove(uint16 op, uint16 var, uint16 } } -void MystScriptParser_Selenitic::mazeRunnerBacktrack(uint16 &oldPosition) { +void Selenitic::mazeRunnerBacktrack(uint16 &oldPosition) { if (oldPosition == 289) _mazeRunnerDirection = 3; @@ -365,7 +366,7 @@ void MystScriptParser_Selenitic::mazeRunnerBacktrack(uint16 &oldPosition) { } } -void MystScriptParser_Selenitic::mazeRunnerPlayVideo(uint16 video, uint16 pos) { +void Selenitic::mazeRunnerPlayVideo(uint16 video, uint16 pos) { Common::String file; switch (video) { @@ -486,7 +487,7 @@ void MystScriptParser_Selenitic::mazeRunnerPlayVideo(uint16 video, uint16 pos) { } } -void MystScriptParser_Selenitic::mazeRunnerUpdateCompass() { +void Selenitic::mazeRunnerUpdateCompass() { if (_mazeRunnerPosition == 288 || _mazeRunnerPosition == 289) _mazeRunnerDirection = 8; else @@ -495,12 +496,12 @@ void MystScriptParser_Selenitic::mazeRunnerUpdateCompass() { _mazeRunnerCompass->drawConditionalDataToScreen(_mazeRunnerDirection); } -bool MystScriptParser_Selenitic::mazeRunnerForwardAllowed(uint16 position) { +bool Selenitic::mazeRunnerForwardAllowed(uint16 position) { uint16 move = _mazeRunnerVideos[position][1]; return move == 6 || move == 7; } -void MystScriptParser_Selenitic::mazeRunnerPlaySoundHelp() { +void Selenitic::mazeRunnerPlaySoundHelp() { uint16 soundId = 0; _mazeRunnerLight->drawConditionalDataToScreen(1); @@ -564,14 +565,14 @@ void MystScriptParser_Selenitic::mazeRunnerPlaySoundHelp() { _mazeRunnerLight->drawConditionalDataToScreen(0); } -void MystScriptParser_Selenitic::o_mazeRunnerSoundRepeat(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerSoundRepeat(uint16 op, uint16 var, uint16 argc, uint16 *argv) { mazeRunnerPlaySoundHelp(); } /** * Sound receiver sigma button */ -void MystScriptParser_Selenitic::o_soundReceiverSigma(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverSigma(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver sigma button", op); _vm->_cursor->hideCursor(); @@ -623,7 +624,7 @@ void MystScriptParser_Selenitic::o_soundReceiverSigma(uint16 op, uint16 var, uin /** * Sound receiver right button */ -void MystScriptParser_Selenitic::o_soundReceiverRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverRight(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver right", op); soundReceiverLeftRight(1); @@ -632,13 +633,13 @@ void MystScriptParser_Selenitic::o_soundReceiverRight(uint16 op, uint16 var, uin /** * Sound receiver left button */ -void MystScriptParser_Selenitic::o_soundReceiverLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverLeft(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver left", op); soundReceiverLeftRight(2); } -void MystScriptParser_Selenitic::soundReceiverLeftRight(uint direction) { +void Selenitic::soundReceiverLeftRight(uint direction) { if (_soundReceiverSigmaPressed) { _soundReceiverSigmaButton->drawConditionalDataToScreen(0); @@ -659,7 +660,7 @@ void MystScriptParser_Selenitic::soundReceiverLeftRight(uint direction) { soundReceiverUpdate(); } -void MystScriptParser_Selenitic::soundReceiverUpdate() { +void Selenitic::soundReceiverUpdate() { if (_soundReceiverDirection == 1) *_soundReceiverPosition = ((*_soundReceiverPosition) + _soundReceiverSpeed) % 3600; else if (_soundReceiverDirection == 2) @@ -668,7 +669,7 @@ void MystScriptParser_Selenitic::soundReceiverUpdate() { soundReceiverDrawView(); } -void MystScriptParser_Selenitic::soundReceiverDrawView() { +void Selenitic::soundReceiverDrawView() { uint32 left = ((*_soundReceiverPosition) * 1800) / 3600; _soundReceiverViewer->_subImages->rect.left = left; @@ -679,7 +680,7 @@ void MystScriptParser_Selenitic::soundReceiverDrawView() { soundReceiverDrawAngle(); } -void MystScriptParser_Selenitic::soundReceiverDrawAngle() { +void Selenitic::soundReceiverDrawAngle() { _vm->redrawResource(_soundReceiverAngle1); _vm->redrawResource(_soundReceiverAngle2); _vm->redrawResource(_soundReceiverAngle3); @@ -689,7 +690,7 @@ void MystScriptParser_Selenitic::soundReceiverDrawAngle() { /** * Sound receiver source selection buttons */ -void MystScriptParser_Selenitic::o_soundReceiverSource(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverSource(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver source", op); if (_soundReceiverSigmaPressed) { @@ -723,7 +724,7 @@ void MystScriptParser_Selenitic::o_soundReceiverSource(uint16 op, uint16 var, ui _vm->_cursor->showCursor(); } -void MystScriptParser_Selenitic::o_mazeRunnerDoorButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerDoorButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Selenitic Maze Runner Exit Logic uint16 cardIdExit = argv[0]; uint16 cardIdEntry = argv[1]; @@ -739,13 +740,13 @@ void MystScriptParser_Selenitic::o_mazeRunnerDoorButton(uint16 op, uint16 var, u } } -void MystScriptParser_Selenitic::o_soundReceiverUpdateSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverUpdateSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver update sound", op); soundReceiverUpdateSound(); } -uint16 MystScriptParser_Selenitic::soundLockCurrentSound(uint16 position, bool pixels) { +uint16 Selenitic::soundLockCurrentSound(uint16 position, bool pixels) { if ((pixels && position < 96) || (!pixels && position == 0)) return 289; else if ((pixels && position < 108) || (!pixels && position == 1)) @@ -770,7 +771,7 @@ uint16 MystScriptParser_Selenitic::soundLockCurrentSound(uint16 position, bool p return 0; } -MystResourceType10 *MystScriptParser_Selenitic::soundLockSliderFromVar(uint16 var) { +MystResourceType10 *Selenitic::soundLockSliderFromVar(uint16 var) { switch (var) { case 20: return _soundLockSlider1; @@ -787,7 +788,7 @@ MystResourceType10 *MystScriptParser_Selenitic::soundLockSliderFromVar(uint16 va return 0; } -void MystScriptParser_Selenitic::o_soundLockMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundLockMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock move", op); MystResourceType10 *slider = soundLockSliderFromVar(var); @@ -799,7 +800,7 @@ void MystScriptParser_Selenitic::o_soundLockMove(uint16 op, uint16 var, uint16 a } } -void MystScriptParser_Selenitic::o_soundLockStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundLockStartMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock start move", op); MystResourceType10 *slider = soundLockSliderFromVar(var); @@ -811,7 +812,7 @@ void MystScriptParser_Selenitic::o_soundLockStartMove(uint16 op, uint16 var, uin _vm->_sound->replaceSoundMyst(_soundLockSoundId, Audio::Mixer::kMaxChannelVolume, true); } -void MystScriptParser_Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock end move", op); MystResourceType10 *slider = soundLockSliderFromVar(var); @@ -855,7 +856,7 @@ void MystScriptParser_Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint1 _vm->_sound->resumeBackgroundMyst(); } -void MystScriptParser_Selenitic::soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved) { +void Selenitic::soundLockCheckSolution(MystResourceType10 *slider, uint16 value, uint16 solution, bool &solved) { slider->drawConditionalDataToScreen(2); _vm->_sound->replaceSoundMyst(soundLockCurrentSound(value / 12, false)); _vm->_system->delayMillis(1500); @@ -867,7 +868,7 @@ void MystScriptParser_Selenitic::soundLockCheckSolution(MystResourceType10 *slid _vm->_sound->stopSound(); } -void MystScriptParser_Selenitic::o_soundLockButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundLockButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock button", op); bool solved = true; @@ -905,7 +906,7 @@ void MystScriptParser_Selenitic::o_soundLockButton(uint16 op, uint16 var, uint16 _vm->_cursor->showCursor(); } -void MystScriptParser_Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver end move", op); uint16 oldDirection = _soundReceiverDirection; @@ -922,19 +923,19 @@ void MystScriptParser_Selenitic::o_soundReceiverEndMove(uint16 op, uint16 var, u } } -void MystScriptParser_Selenitic::o_mazeRunnerCompass_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerCompass_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _mazeRunnerCompass = static_cast<MystResourceType8 *>(_invokingResource); } -void MystScriptParser_Selenitic::o_mazeRunnerWindow_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerWindow_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _mazeRunnerWindow = static_cast<MystResourceType8 *>(_invokingResource); } -void MystScriptParser_Selenitic::o_mazeRunnerLight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerLight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _mazeRunnerLight = static_cast<MystResourceType8 *>(_invokingResource); } -void MystScriptParser_Selenitic::soundReceiver_run() { +void Selenitic::soundReceiver_run() { if (_soundReceiverStartTime) { if (_soundReceiverDirection) { uint32 currentTime = _vm->_system->getMillis(); @@ -952,7 +953,7 @@ void MystScriptParser_Selenitic::soundReceiver_run() { } } -void MystScriptParser_Selenitic::soundReceiverIncreaseSpeed() { +void Selenitic::soundReceiverIncreaseSpeed() { switch (_soundReceiverSpeed) { case 1: _soundReceiverSpeed = 10; @@ -966,12 +967,12 @@ void MystScriptParser_Selenitic::soundReceiverIncreaseSpeed() { } } -void MystScriptParser_Selenitic::soundReceiverUpdateSound() { +void Selenitic::soundReceiverUpdateSound() { uint16 soundId = soundReceiverCurrentSound(_state.soundReceiverCurrentSource, *_soundReceiverPosition); _vm->_sound->replaceSoundMyst(soundId); } -uint16 MystScriptParser_Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) { +uint16 Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) { uint16 solution = 0; bool sourceEnabled = false; soundReceiverSolution(source, solution, sourceEnabled); @@ -1022,7 +1023,7 @@ uint16 MystScriptParser_Selenitic::soundReceiverCurrentSound(uint16 source, uint return soundId; } -void MystScriptParser_Selenitic::soundReceiverSolution(uint16 source, uint16 &solution, bool &enabled) { +void Selenitic::soundReceiverSolution(uint16 source, uint16 &solution, bool &enabled) { switch (source) { case 0: enabled = _state.emitterEnabledWater; @@ -1047,7 +1048,7 @@ void MystScriptParser_Selenitic::soundReceiverSolution(uint16 source, uint16 &so } } -void MystScriptParser_Selenitic::o_soundReceiver_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundReceiver_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound receiver init", op); // Used for Card 1245 (Sound Receiver) @@ -1074,7 +1075,7 @@ void MystScriptParser_Selenitic::o_soundReceiver_init(uint16 op, uint16 var, uin _soundReceiverSigmaPressed = false; } -void MystScriptParser_Selenitic::o_soundLock_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_soundLock_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Sound lock init", op); for (uint i = 0; i < _vm->_resources.size(); i++) { @@ -1109,15 +1110,15 @@ void MystScriptParser_Selenitic::o_soundLock_init(uint16 op, uint16 var, uint16 _soundLockSoundId = 0; } -void MystScriptParser_Selenitic::o_mazeRunnerRight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerRight_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _mazeRunnerRightButton = static_cast<MystResourceType8 *>(_invokingResource); } -void MystScriptParser_Selenitic::o_mazeRunnerLeft_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Selenitic::o_mazeRunnerLeft_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _mazeRunnerLeftButton = static_cast<MystResourceType8 *>(_invokingResource); } -const uint16 MystScriptParser_Selenitic::_mazeRunnerMap[300][4] = { +const uint16 Selenitic::_mazeRunnerMap[300][4] = { {8, 7, 1, 288}, {1, 0, 2, 288}, {2, 1, 3, 288}, @@ -1420,7 +1421,7 @@ const uint16 MystScriptParser_Selenitic::_mazeRunnerMap[300][4] = { { 0, 0, 0, 0} }; -const uint8 MystScriptParser_Selenitic::_mazeRunnerVideos[300][4] = { +const uint8 Selenitic::_mazeRunnerVideos[300][4] = { {3, 6, 10, 17}, {0, 5, 8, 17}, {0, 4, 8, 17}, @@ -1723,4 +1724,5 @@ const uint8 MystScriptParser_Selenitic::_mazeRunnerVideos[300][4] = { {0, 0, 0, 0} }; +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 54e9db4d66..4ec92b9869 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -32,16 +32,17 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; class MystResourceType8; struct MystScriptEntry; -class MystScriptParser_Selenitic : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Selenitic : public MystScriptParser { public: - MystScriptParser_Selenitic(MohawkEngine_Myst *vm); - ~MystScriptParser_Selenitic(); + Selenitic(MohawkEngine_Myst *vm); + ~Selenitic(); void disablePersistentScripts(); void runPersistentScripts(); @@ -135,6 +136,7 @@ private: void mazeRunnerBacktrack(uint16 &oldPosition); }; +} // End of namespace MystStacks } #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp index 128505d266..e664081c96 100644 --- a/engines/mohawk/myst_stacks/slides.cpp +++ b/engines/mohawk/myst_stacks/slides.cpp @@ -33,19 +33,18 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -// NOTE: Credits Start Card is 10000 - -MystScriptParser_Slides::MystScriptParser_Slides(MohawkEngine_Myst *vm) : MystScriptParser(vm) { +Slides::Slides(MohawkEngine_Myst *vm) : MystScriptParser(vm) { setupOpcodes(); } -MystScriptParser_Slides::~MystScriptParser_Slides() { +Slides::~Slides() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Slides::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Slides::x, #x)) -void MystScriptParser_Slides::setupOpcodes() { +void Slides::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_returnToMenu); @@ -55,11 +54,11 @@ void MystScriptParser_Slides::setupOpcodes() { #undef OPCODE -void MystScriptParser_Slides::disablePersistentScripts() { +void Slides::disablePersistentScripts() { _cardSwapEnabled = false; } -void MystScriptParser_Slides::runPersistentScripts() { +void Slides::runPersistentScripts() { if (_cardSwapEnabled) { // Used on Cards... if (_vm->_system->getMillis() - _lastCardTime >= 2 * 1000) @@ -67,11 +66,11 @@ void MystScriptParser_Slides::runPersistentScripts() { } } -void MystScriptParser_Slides::o_returnToMenu(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Slides::o_returnToMenu(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _vm->changeToStack(kDemoStack, 2001, 0, 0); } -void MystScriptParser_Slides::o_setCardSwap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Slides::o_setCardSwap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used on Cards... if (argc == 1) { _nextCardID = argv[0]; @@ -81,4 +80,5 @@ void MystScriptParser_Slides::o_setCardSwap(uint16 op, uint16 var, uint16 argc, unknown(op, var, argc, argv); } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h index 7230eead25..1e0504a665 100644 --- a/engines/mohawk/myst_stacks/slides.h +++ b/engines/mohawk/myst_stacks/slides.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Slides : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Slides : public MystScriptParser { public: - MystScriptParser_Slides(MohawkEngine_Myst *vm); - ~MystScriptParser_Slides(); + Slides(MohawkEngine_Myst *vm); + ~Slides(); void disablePersistentScripts(); void runPersistentScripts(); @@ -57,6 +58,7 @@ private: uint32 _lastCardTime; }; +} // End of namespace MystStacks } // End of namespace Mohawk #undef DECLARE_OPCODE diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index ebf7f75d88..b5b403dad8 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -35,8 +35,9 @@ #include "gui/message.h" namespace Mohawk { +namespace MystStacks { -MystScriptParser_Stoneship::MystScriptParser_Stoneship(MohawkEngine_Myst *vm) : +Stoneship::Stoneship(MohawkEngine_Myst *vm) : MystScriptParser(vm), _state(vm->_gameState->_stoneship) { setupOpcodes(); @@ -60,12 +61,12 @@ MystScriptParser_Stoneship::MystScriptParser_Stoneship(MohawkEngine_Myst *vm) : _state.generatorPowerAvailable = 0; } -MystScriptParser_Stoneship::~MystScriptParser_Stoneship() { +Stoneship::~Stoneship() { } -#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Stoneship::x, #x)) +#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &Stoneship::x, #x)) -void MystScriptParser_Stoneship::setupOpcodes() { +void Stoneship::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_pumpTurnOff); OPCODE(101, o_brotherDoorOpen); @@ -111,14 +112,14 @@ void MystScriptParser_Stoneship::setupOpcodes() { #undef OPCODE -void MystScriptParser_Stoneship::disablePersistentScripts() { +void Stoneship::disablePersistentScripts() { _batteryCharging = false; _batteryDepleting = false; _batteryGaugeRunning = false; _telescopeRunning = false; } -void MystScriptParser_Stoneship::runPersistentScripts() { +void Stoneship::runPersistentScripts() { if (_batteryCharging) chargeBattery_run(); @@ -135,7 +136,7 @@ void MystScriptParser_Stoneship::runPersistentScripts() { tunnel_run(); } -uint16 MystScriptParser_Stoneship::getVar(uint16 var) { +uint16 Stoneship::getVar(uint16 var) { switch(var) { case 0: // Water Drained From Lighthouse / Right Button Of Pump return _state.pumpState == 4; @@ -260,7 +261,7 @@ uint16 MystScriptParser_Stoneship::getVar(uint16 var) { } } -void MystScriptParser_Stoneship::toggleVar(uint16 var) { +void Stoneship::toggleVar(uint16 var) { switch(var) { case 0: // Water Drained From Lighthouse / Right Button Of Pump if (_state.pumpState == 4) @@ -326,7 +327,7 @@ void MystScriptParser_Stoneship::toggleVar(uint16 var) { } } -bool MystScriptParser_Stoneship::setVarValue(uint16 var, uint16 value) { +bool Stoneship::setVarValue(uint16 var, uint16 value) { bool refresh = false; switch (var) { @@ -380,7 +381,7 @@ bool MystScriptParser_Stoneship::setVarValue(uint16 var, uint16 value) { return refresh; } -void MystScriptParser_Stoneship::o_pumpTurnOff(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_pumpTurnOff(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Turn off previous pump selection", op); if (_state.pumpState) { @@ -410,7 +411,7 @@ void MystScriptParser_Stoneship::o_pumpTurnOff(uint16 op, uint16 var, uint16 arg } } -void MystScriptParser_Stoneship::o_brotherDoorOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_brotherDoorOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open brother door", op); _brotherDoorOpen = 1; @@ -418,7 +419,7 @@ void MystScriptParser_Stoneship::o_brotherDoorOpen(uint16 op, uint16 var, uint16 animatedUpdate(argc, argv, 5); } -void MystScriptParser_Stoneship::o_cabinBookMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_cabinBookMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Play Book Room Movie", op); uint16 startTime = argv[0]; @@ -429,7 +430,7 @@ void MystScriptParser_Stoneship::o_cabinBookMovie(uint16 op, uint16 var, uint16 _vm->_video->waitUntilMovieEnds(book); } -void MystScriptParser_Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open drawer", op); MystResourceType8 *drawer = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); @@ -447,18 +448,18 @@ void MystScriptParser_Stoneship::o_drawerOpenSirius(uint16 op, uint16 var, uint1 _vm->_gfx->runTransition(transition, drawer->getRect(), 25, 5); } -void MystScriptParser_Stoneship::o_drawerClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_drawerClose(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Close drawer", op); drawerClose(argv[0]); } -void MystScriptParser_Stoneship::o_telescopeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_telescopeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); _telescopeOldMouse = mouse.x; _vm->_cursor->setCursor(700); } -void MystScriptParser_Stoneship::o_telescopeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_telescopeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Telescope move", op); MystResourceType11 *display = static_cast<MystResourceType11 *>(_invokingResource); @@ -477,11 +478,11 @@ void MystScriptParser_Stoneship::o_telescopeMove(uint16 op, uint16 var, uint16 a _vm->_system->updateScreen(); } -void MystScriptParser_Stoneship::o_telescopeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_telescopeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { _vm->checkCursorHints(); } -void MystScriptParser_Stoneship::o_generatorStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_generatorStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator start", op); MystResourceType11 *handle = static_cast<MystResourceType11 *>(_invokingResource); @@ -507,7 +508,7 @@ void MystScriptParser_Stoneship::o_generatorStart(uint16 op, uint16 var, uint16 _vm->_sound->replaceSoundMyst(soundId, Audio::Mixer::kMaxChannelVolume, true); } -void MystScriptParser_Stoneship::o_generatorStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_generatorStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Generator stop", op); _batteryCharging = false; @@ -534,7 +535,7 @@ void MystScriptParser_Stoneship::o_generatorStop(uint16 op, uint16 var, uint16 a _vm->_sound->replaceSoundMyst(soundId); } -void MystScriptParser_Stoneship::chargeBattery_run() { +void Stoneship::chargeBattery_run() { uint32 time = _vm->_system->getMillis(); if (time > _batteryNextTime) { @@ -543,7 +544,7 @@ void MystScriptParser_Stoneship::chargeBattery_run() { } } -uint16 MystScriptParser_Stoneship::batteryRemainingCharge() { +uint16 Stoneship::batteryRemainingCharge() { uint32 time = _vm->_system->getMillis(); if (_state.generatorDepletionTime > time) { @@ -553,7 +554,7 @@ uint16 MystScriptParser_Stoneship::batteryRemainingCharge() { } } -void MystScriptParser_Stoneship::batteryDeplete_run() { +void Stoneship::batteryDeplete_run() { uint32 time = _vm->_system->getMillis(); if (time > _batteryNextTime) { @@ -574,7 +575,7 @@ void MystScriptParser_Stoneship::batteryDeplete_run() { } } -void MystScriptParser_Stoneship::o_drawerOpenAchenar(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_drawerOpenAchenar(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Open drawer", op); MystResourceType8 *drawer = static_cast<MystResourceType8 *>(_vm->_resources[argv[0]]); @@ -582,7 +583,7 @@ void MystScriptParser_Stoneship::o_drawerOpenAchenar(uint16 op, uint16 var, uint _vm->_gfx->runTransition(5, drawer->getRect(), 25, 5); } -void MystScriptParser_Stoneship::o_hologramPlayback(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramPlayback(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Card 2013 (Achenar's Rose-Skull Hologram) debugC(kDebugScript, "Opcode %d: Rose-Skull Hologram Playback", op); @@ -604,12 +605,12 @@ void MystScriptParser_Stoneship::o_hologramPlayback(uint16 op, uint16 var, uint1 _vm->_video->delayUntilMovieEnds(displayMovie); } -void MystScriptParser_Stoneship::o_hologramSelectionStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramSelectionStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram start move", op); //_vm->_cursor->setCursor(0); } -void MystScriptParser_Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram move", op); MystResourceType11 *handle = static_cast<MystResourceType11 *>(_invokingResource); @@ -636,12 +637,12 @@ void MystScriptParser_Stoneship::o_hologramSelectionMove(uint16 op, uint16 var, } } -void MystScriptParser_Stoneship::o_hologramSelectionStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramSelectionStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram stop move", op); _vm->checkCursorHints(); } -void MystScriptParser_Stoneship::o_compassButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_compassButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Compass rose button pressed", op); // Used on Card 2111 (Compass Rose) // Called when Button Clicked. @@ -663,7 +664,7 @@ void MystScriptParser_Stoneship::o_compassButton(uint16 op, uint16 var, uint16 a o_redrawCard(op, var, argc, argv); } -void MystScriptParser_Stoneship::o_chestValveVideos(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_chestValveVideos(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Chest valve videos", op); Common::String movie = _vm->wrapMovieFilename("ligspig", kStoneshipStack); @@ -699,7 +700,7 @@ void MystScriptParser_Stoneship::o_chestValveVideos(uint16 op, uint16 var, uint1 } } -void MystScriptParser_Stoneship::o_chestDropKey(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_chestDropKey(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: drop chest key", op); // If holding Key to Lamp Room Trapdoor, drop to bottom of @@ -710,7 +711,7 @@ void MystScriptParser_Stoneship::o_chestDropKey(uint16 op, uint16 var, uint16 ar } } -void MystScriptParser_Stoneship::o_trapLockOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_trapLockOpen(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Trap lock open video", op); Common::String movie = _vm->wrapMovieFilename("openloc", kStoneshipStack); @@ -729,7 +730,7 @@ void MystScriptParser_Stoneship::o_trapLockOpen(uint16 op, uint16 var, uint16 ar _vm->_sound->playSound(4143); } -void MystScriptParser_Stoneship::o_sideDoorsMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_sideDoorsMovies(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Cards 2285, 2289, 2247, 2251 (Side Doors in Tunnels Down To Brothers Rooms) uint16 movieId = argv[0]; @@ -765,14 +766,14 @@ void MystScriptParser_Stoneship::o_sideDoorsMovies(uint16 op, uint16 var, uint16 _vm->_cursor->showCursor(); } -void MystScriptParser_Stoneship::o_cloudOrbEnter(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_cloudOrbEnter(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cloud orb enter", op); _vm->_sound->replaceSoundMyst(_cloudOrbSound, Audio::Mixer::kMaxChannelVolume, true); _cloudOrbMovie->playMovie(); } -void MystScriptParser_Stoneship::o_cloudOrbLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_cloudOrbLeave(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cloud orb leave", op); _cloudOrbMovie->pauseMovie(true); @@ -780,7 +781,7 @@ void MystScriptParser_Stoneship::o_cloudOrbLeave(uint16 op, uint16 var, uint16 a _vm->_gfx->runTransition(5, _invokingResource->getRect(), 4, 0); } -void MystScriptParser_Stoneship::o_drawerCloseOpened(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_drawerCloseOpened(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Close open drawer", op); uint16 drawerOpen = getVar(var); @@ -788,7 +789,7 @@ void MystScriptParser_Stoneship::o_drawerCloseOpened(uint16 op, uint16 var, uint drawerClose(argv[0] + drawerOpen - 1); } -void MystScriptParser_Stoneship::drawerClose(uint16 drawer) { +void Stoneship::drawerClose(uint16 drawer) { _chestDrawersOpen = 0; _vm->drawCardBackground(); _vm->drawResourceImages(); @@ -797,19 +798,19 @@ void MystScriptParser_Stoneship::drawerClose(uint16 drawer) { _vm->_gfx->runTransition(6, res->getRect(), 25, 5); } -void MystScriptParser_Stoneship::o_hologramDisplay_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramDisplay_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram display init", op); _hologramDisplay = static_cast<MystResourceType6 *>(_invokingResource); _hologramDisplayPos = 0; } -void MystScriptParser_Stoneship::o_hologramSelection_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_hologramSelection_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Hologram selection init", op); _hologramSelection = static_cast<MystResourceType6 *>(_invokingResource); } -void MystScriptParser_Stoneship::batteryGaugeUpdate() { +void Stoneship::batteryGaugeUpdate() { uint16 charge = 0; if (_state.generatorDepletionTime) { @@ -823,7 +824,7 @@ void MystScriptParser_Stoneship::batteryGaugeUpdate() { _batteryGauge->setRect(rect); } -void MystScriptParser_Stoneship::o_battery_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_battery_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { // Used for Card 2160 (Lighthouse Battery Pack Closeup) debugC(kDebugScript, "Opcode %d: Battery init", op); @@ -832,7 +833,7 @@ void MystScriptParser_Stoneship::o_battery_init(uint16 op, uint16 var, uint16 ar batteryGaugeUpdate(); } -void MystScriptParser_Stoneship::o_tunnelEnter_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_tunnelEnter_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tunnel enter", op); o_tunnel_init(op, var, argc, argv); @@ -841,13 +842,13 @@ void MystScriptParser_Stoneship::o_tunnelEnter_init(uint16 op, uint16 var, uint1 _tunnelNextTime = _vm->_system->getMillis() + 1500; } -void MystScriptParser_Stoneship::o_batteryGauge_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_batteryGauge_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Battery gauge init", op); _batteryLastCharge = batteryRemainingCharge(); _batteryGaugeRunning = true; } -void MystScriptParser_Stoneship::batteryGauge_run() { +void Stoneship::batteryGauge_run() { uint16 batteryCharge = batteryRemainingCharge(); if (batteryCharge != _batteryLastCharge) { @@ -863,7 +864,7 @@ void MystScriptParser_Stoneship::batteryGauge_run() { } } -void MystScriptParser_Stoneship::o_tunnel_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_tunnel_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tunnel card init", op); _tunnelImagesCount = argv[0]; @@ -880,7 +881,7 @@ void MystScriptParser_Stoneship::o_tunnel_init(uint16 op, uint16 var, uint16 arg debugC(kDebugScript, "\tsoundIdAlarm: %d", _tunnelAlarmSound); } -void MystScriptParser_Stoneship::tunnel_run() { +void Stoneship::tunnel_run() { uint32 time = _vm->_system->getMillis(); if (time > _tunnelNextTime) { @@ -903,19 +904,19 @@ void MystScriptParser_Stoneship::tunnel_run() { } } -void MystScriptParser_Stoneship::o_tunnelLeave_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_tunnelLeave_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Tunnel leave", op); _tunnelRunning = false; } -void MystScriptParser_Stoneship::o_chest_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_chest_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Chest init", op); _state.chestOpenState = 0; } -void MystScriptParser_Stoneship::o_telescope_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_telescope_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Telescope init", op); // Used in Card 2218 (Telescope view) @@ -929,7 +930,7 @@ void MystScriptParser_Stoneship::o_telescope_init(uint16 op, uint16 var, uint16 _telescopeNexTime = _vm->_system->getMillis() + 1000; } -void MystScriptParser_Stoneship::telescope_run() { +void Stoneship::telescope_run() { uint32 time = _vm->_system->getMillis(); if (time > _telescopeNexTime) { @@ -942,7 +943,7 @@ void MystScriptParser_Stoneship::telescope_run() { } } -void MystScriptParser_Stoneship::telescopeLighthouseDraw() { +void Stoneship::telescopeLighthouseDraw() { if (_telescopePosition > 1137 && _telescopePosition < 1294) { uint16 imageId = _telescopeLighthouseOff; @@ -964,7 +965,7 @@ void MystScriptParser_Stoneship::telescopeLighthouseDraw() { } } -void MystScriptParser_Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Achenar's Room Drawers Init", op); // Used for Card 2004 (Achenar's Room Drawers) @@ -982,7 +983,7 @@ void MystScriptParser_Stoneship::o_achenarDrawers_init(uint16 op, uint16 var, ui } } -void MystScriptParser_Stoneship::o_cloudOrb_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { +void Stoneship::o_cloudOrb_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Cloud orb init", op); _cloudOrbMovie = static_cast<MystResourceType6 *>(_invokingResource); @@ -990,4 +991,5 @@ void MystScriptParser_Stoneship::o_cloudOrb_init(uint16 op, uint16 var, uint16 a _cloudOrbStopSound = argv[1]; } +} // End of namespace MystStacks } // End of namespace Mohawk diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index eb58bd6543..091fdcd169 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -32,15 +32,16 @@ namespace Mohawk { -#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) - -class MohawkEngine_Myst; struct MystScriptEntry; -class MystScriptParser_Stoneship : public MystScriptParser { +namespace MystStacks { + +#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv) + +class Stoneship : public MystScriptParser { public: - MystScriptParser_Stoneship(MohawkEngine_Myst *vm); - ~MystScriptParser_Stoneship(); + Stoneship(MohawkEngine_Myst *vm); + ~Stoneship(); void disablePersistentScripts(); void runPersistentScripts(); @@ -142,6 +143,7 @@ private: uint16 batteryRemainingCharge(); }; +} // End of namespace MystStacks } #undef DECLARE_OPCODE |