diff options
author | Bastien Bouclet | 2011-01-22 09:37:56 +0000 |
---|---|---|
committer | Bastien Bouclet | 2011-01-22 09:37:56 +0000 |
commit | 552648c225560d8029dd2f73b290457f48176d68 (patch) | |
tree | 7d0a1f70a3ff40969c89ccb93e79c6e4b673a6e2 /engines/mohawk/myst_stacks | |
parent | 5660b42a897018c4c6e92ed5f6b63142024f8cc5 (diff) | |
download | scummvm-rg350-552648c225560d8029dd2f73b290457f48176d68.tar.gz scummvm-rg350-552648c225560d8029dd2f73b290457f48176d68.tar.bz2 scummvm-rg350-552648c225560d8029dd2f73b290457f48176d68.zip |
MOHAWK: Complete Channelwood opcode 101, pipe bridge
svn-id: r55412
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.cpp | 37 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.h | 2 |
2 files changed, 16 insertions, 23 deletions
diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 77a12644f5..562997b8ea 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -49,7 +49,7 @@ MystScriptParser_Channelwood::~MystScriptParser_Channelwood() { void MystScriptParser_Channelwood::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_bridgeToggle); - OPCODE(101, opcode_101); + OPCODE(101, o_pipeExtend); OPCODE(102, opcode_102); OPCODE(104, o_waterTankValveOpen); OPCODE(105, o_leverStartMove); @@ -234,6 +234,7 @@ void MystScriptParser_Channelwood::o_bridgeToggle(uint16 op, uint16 var, uint16 VideoHandle bridge = _vm->_video->playMovie(_vm->wrapMovieFilename("bridge", kChannelwoodStack), 292, 203); + // Toggle bridge state if (_state.waterPumpBridgeState) _vm->_video->setVideoBounds(bridge, Graphics::VideoTimestamp(3050, 600), Graphics::VideoTimestamp(6100, 600)); else @@ -242,31 +243,23 @@ void MystScriptParser_Channelwood::o_bridgeToggle(uint16 op, uint16 var, uint16 _vm->_video->waitUntilMovieEnds(bridge); } -void MystScriptParser_Channelwood::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); +void MystScriptParser_Channelwood::o_pipeExtend(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Play Pipe Movie and Sound", op); - if (argc == 1) { - debugC(kDebugScript, "Opcode %d: Play Pipe Movie and Sound", op); + uint16 soundId = argv[0]; + debugC(kDebugScript, "\tsoundId: %d", soundId); - uint16 soundId = argv[0]; - debugC(kDebugScript, "\tsoundId: %d", soundId); + _vm->_sound->replaceSoundMyst(soundId); + VideoHandle pipe = _vm->_video->playMovie(_vm->wrapMovieFilename("pipebrid", kChannelwoodStack), 267, 170); - _vm->_sound->replaceSoundMyst(soundId); + // Toggle pipe state + if (_state.pipeState) + _vm->_video->setVideoBounds(pipe, Graphics::VideoTimestamp(3040, 600), Graphics::VideoTimestamp(6080, 600)); + else + _vm->_video->setVideoBounds(pipe, Graphics::VideoTimestamp(0, 600), Graphics::VideoTimestamp(3040, 600)); - // TODO: Get Movie Location from Invoking Resource Rect, rather than - // hardcoded 267, 170 ? - - // TODO: Need version of playMovie blocking which allows selection - // of start and finish points. - if (!_vm->_varStore->getVar(6)) { - // Play Pipe Extending i.e. 0 to 1/2 way through file - _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("pipebrid", kChannelwoodStack), 267, 170); - } else { - // Play Pipe Retracting i.e. 1/2 way to end of file - _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("pipebrid", kChannelwoodStack), 267, 170); - } - } else - unknown(op, var, argc, argv); + _vm->_video->waitUntilMovieEnds(pipe); + _vm->_sound->resumeBackgroundMyst(); } void MystScriptParser_Channelwood::opcode_102(uint16 op, uint16 var, uint16 argc, uint16 *argv) { diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 349a73dd08..9967bcd8c1 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -55,7 +55,7 @@ private: void opcode_203_disable(); DECLARE_OPCODE(o_bridgeToggle); - DECLARE_OPCODE(opcode_101); + DECLARE_OPCODE(o_pipeExtend); DECLARE_OPCODE(opcode_102); DECLARE_OPCODE(o_waterTankValveOpen); DECLARE_OPCODE(o_leverStartMove); |