diff options
author | Matthew Hoops | 2010-06-24 05:31:07 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-06-24 05:31:07 +0000 |
commit | 7c9cbf75c0ed6e66b5c7875f5e7657313b943a5c (patch) | |
tree | 9c8c657db685a4af6712b88b0df30885c0092245 /engines/mohawk/riven_external.cpp | |
parent | 3838197ac14be050f1b2db5e1f26d82052dbd331 (diff) | |
download | scummvm-rg350-7c9cbf75c0ed6e66b5c7875f5e7657313b943a5c.tar.gz scummvm-rg350-7c9cbf75c0ed6e66b5c7875f5e7657313b943a5c.tar.bz2 scummvm-rg350-7c9cbf75c0ed6e66b5c7875f5e7657313b943a5c.zip |
Implement the rest of xvalvecontrol for the boiler puzzle in Riven, initialize a variable for the boiler platform switch.
svn-id: r50200
Diffstat (limited to 'engines/mohawk/riven_external.cpp')
-rw-r--r-- | engines/mohawk/riven_external.cpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index 89e10c7deb..5b5163dbb3 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -662,15 +662,17 @@ void RivenExternal::xvalvecontrol(uint16 argc, uint16 *argv) { // Get the variable for the valve uint32 *valve = _vm->matchVarToString("bvalve"); - Common::Event event; int changeX = 0; int changeY = 0; + bool done = false; // Set the cursor to the closed position _vm->_gfx->changeCursor(2004); _vm->_system->updateScreen(); - for (;;) { + while (!done) { + Common::Event event; + while (_vm->_system->getEventManager()->pollEvent(event)) { switch (event.type) { case Common::EVENT_MOUSEMOVE: @@ -682,30 +684,53 @@ void RivenExternal::xvalvecontrol(uint16 argc, uint16 *argv) { // FIXME: These values for changes in x/y could be tweaked. if (*valve == 0 && changeY <= -10) { *valve = 1; - // TODO: Play movie + _vm->_gfx->changeCursor(kRivenHideCursor); + _vm->_video->playMovieBlocking(2); _vm->refreshCard(); } else if (*valve == 1) { if (changeX >= 0 && changeY >= 10) { *valve = 0; - // TODO: Play movie + _vm->_gfx->changeCursor(kRivenHideCursor); + _vm->_video->playMovieBlocking(3); _vm->refreshCard(); } else if (changeX <= -10 && changeY <= 10) { *valve = 2; - // TODO: Play movie + _vm->_gfx->changeCursor(kRivenHideCursor); + _vm->_video->playMovieBlocking(1); _vm->refreshCard(); } } else if (*valve == 2 && changeX >= 10) { *valve = 1; - // TODO: Play movie + _vm->_gfx->changeCursor(kRivenHideCursor); + _vm->_video->playMovieBlocking(4); _vm->refreshCard(); } - return; + done = true; default: break; } } _vm->_system->delayMillis(10); } + + // If we changed state and the new state is that the valve is flowing to + // the boiler, we need to update the boiler state. + if (*valve == 1) { + if (*_vm->matchVarToString("bidvlv") == 1) { // Check which way the water is going at the boiler + if (*_vm->matchVarToString("bblrarm") == 1) { + // If the pipe is open, make sure the water is drained out + *_vm->matchVarToString("bheat") = 0; + *_vm->matchVarToString("bblrwtr") = 0; + } else { + // If the pipe is closed, fill the boiler again + *_vm->matchVarToString("bheat") = *_vm->matchVarToString("bblrvalve"); + *_vm->matchVarToString("bblrwtr") = 1; + } + } else { + // Have the grating inside the boiler match the switch outside + *_vm->matchVarToString("bblrgrt") = (*_vm->matchVarToString("bblrsw") == 1) ? 0 : 1; + } + } } void RivenExternal::xbchipper(uint16 argc, uint16 *argv) { |