diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/mohawk/myst_stacks/myst.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/mohawk/myst_stacks/myst.cpp')
-rw-r--r-- | engines/mohawk/myst_stacks/myst.cpp | 258 |
1 files changed, 178 insertions, 80 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index c500df5ad3..98f0aa5349 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -51,8 +51,6 @@ Myst::Myst(MohawkEngine_Myst *vm) : _dockVaultState = 0; _cabinDoorOpened = 0; _cabinMatchState = 2; - _cabinGaugeMovie = NULL_VID_HANDLE; - _cabinFireMovie = NULL_VID_HANDLE; _matchBurning = false; _tree = 0; _treeAlcove = 0; @@ -1135,10 +1133,13 @@ void Myst::o_clockWheelsExecute(uint16 op, uint16 var, uint16 argc, uint16 *argv _vm->_system->delayMillis(500); // Gears rise up - VideoHandle gears = _vm->_video->playMovie(_vm->wrapMovieFilename("gears", kMystStack), 305, 33); - _vm->_video->setVideoBounds(gears, Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 650, 600)); - _vm->_video->waitUntilMovieEnds(gears); + VideoHandle gears = _vm->_video->playMovie(_vm->wrapMovieFilename("gears", kMystStack)); + if (!gears) + error("Failed to open gears movie"); + gears->moveTo(305, 33); + gears->setBounds(Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 650, 600)); + _vm->_video->waitUntilMovieEnds(gears); _state.clockTowerBridgeOpen = 1; _vm->redrawArea(12); @@ -1147,8 +1148,12 @@ void Myst::o_clockWheelsExecute(uint16 op, uint16 var, uint16 argc, uint16 *argv _vm->_system->delayMillis(500); // Gears sink down - VideoHandle gears = _vm->_video->playMovie(_vm->wrapMovieFilename("gears", kMystStack), 305, 33); - _vm->_video->setVideoBounds(gears, Audio::Timestamp(0, 700, 600), Audio::Timestamp(0, 1300, 600)); + VideoHandle gears = _vm->_video->playMovie(_vm->wrapMovieFilename("gears", kMystStack)); + if (!gears) + error("Failed to open gears movie"); + + gears->moveTo(305, 33); + gears->setBounds(Audio::Timestamp(0, 700, 600), Audio::Timestamp(0, 1300, 600)); _vm->_video->waitUntilMovieEnds(gears); _state.clockTowerBridgeOpen = 0; @@ -1191,15 +1196,23 @@ void Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) if (_state.imagerActive) { // Mountains disappearing Common::String file = _vm->wrapMovieFilename("vltmntn", kMystStack); - VideoHandle mountain = _vm->_video->playMovie(file, 159, 96, false); - _vm->_video->setVideoBounds(mountain, Audio::Timestamp(0, 11180, 600), Audio::Timestamp(0, 16800, 600)); + VideoHandle mountain = _vm->_video->playMovie(file); + if (!mountain) + error("Failed to open '%s'", file.c_str()); + + mountain->moveTo(159, 96); + mountain->setBounds(Audio::Timestamp(0, 11180, 600), Audio::Timestamp(0, 16800, 600)); _state.imagerActive = 0; } else { // Mountains appearing Common::String file = _vm->wrapMovieFilename("vltmntn", kMystStack); - VideoHandle mountain = _vm->_video->playMovie(file, 159, 96, false); - _vm->_video->setVideoBounds(mountain, Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 11180, 600)); + VideoHandle mountain = _vm->_video->playMovie(file); + if (!mountain) + error("Failed to open '%s'", file.c_str()); + + mountain->moveTo(159, 96); + mountain->setBounds(Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 11180, 600)); _state.imagerActive = 1; } @@ -1212,20 +1225,20 @@ void Myst::o_imagerPlayButton(uint16 op, uint16 var, uint16 argc, uint16 *argv) // Water disappearing VideoHandle water = _imagerMovie->playMovie(); - _vm->_video->setVideoBounds(water, Audio::Timestamp(0, 4204, 600), Audio::Timestamp(0, 6040, 600)); - _vm->_video->setVideoLooping(water, false); + water->setBounds(Audio::Timestamp(0, 4204, 600), Audio::Timestamp(0, 6040, 600)); + water->setLooping(false); _state.imagerActive = 0; } else { // Water appearing VideoHandle water = _imagerMovie->playMovie(); - _vm->_video->setVideoBounds(water, Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 1814, 600)); + water->setBounds(Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 1814, 600)); _vm->_video->waitUntilMovieEnds(water); // Water looping water = _imagerMovie->playMovie(); - _vm->_video->setVideoBounds(water, Audio::Timestamp(0, 1814, 600), Audio::Timestamp(0, 4204, 600)); - _vm->_video->setVideoLooping(water, true); + water->setBounds(Audio::Timestamp(0, 1814, 600), Audio::Timestamp(0, 4204, 600)); + water->setLooping(true); _state.imagerActive = 1; } @@ -1902,11 +1915,19 @@ Common::Rational Myst::boilerComputeGaugeRate(uint16 pressure, uint32 delay) { } void Myst::boilerResetGauge(const Common::Rational &rate) { - if (_vm->_video->endOfVideo(_cabinGaugeMovie)) { + if (!_cabinGaugeMovie || _cabinGaugeMovie->endOfVideo()) { if (_vm->getCurCard() == 4098) { - _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabingau", kMystStack), 243, 96); + _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabingau", kMystStack)); + if (!_cabinGaugeMovie) + error("Failed to open cabingau movie"); + + _cabinGaugeMovie->moveTo(243, 96); } else { - _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabcgfar", kMystStack), 254, 136); + _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabcgfar", kMystStack)); + if (!_cabinGaugeMovie) + error("Failed to open cabingau movie"); + + _cabinGaugeMovie->moveTo(254, 136); } } @@ -1914,10 +1935,10 @@ void Myst::boilerResetGauge(const Common::Rational &rate) { if (rate > 0) goTo = Audio::Timestamp(0, 0, 600); else - goTo = _vm->_video->getDuration(_cabinGaugeMovie); + goTo = _cabinGaugeMovie->getDuration(); - _vm->_video->seekToTime(_cabinGaugeMovie, goTo); - _vm->_video->setVideoRate(_cabinGaugeMovie, rate); + _cabinGaugeMovie->seek(goTo); + _cabinGaugeMovie->setRate(rate); } void Myst::o_boilerIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -1931,10 +1952,10 @@ void Myst::o_boilerIncreasePressureStop(uint16 op, uint16 var, uint16 argc, uint if (_state.cabinValvePosition > 0) _vm->_sound->replaceBackgroundMyst(8098, 49152); - if (!_vm->_video->endOfVideo(_cabinGaugeMovie)) { + if (_cabinGaugeMovie && !_cabinGaugeMovie->endOfVideo()) { uint16 delay = treeNextMoveDelay(_state.cabinValvePosition); Common::Rational rate = boilerComputeGaugeRate(_state.cabinValvePosition, delay); - _vm->_video->setVideoRate(_cabinGaugeMovie, rate); + _cabinGaugeMovie->setRate(rate); } } else if (_state.cabinValvePosition > 0) @@ -2006,10 +2027,10 @@ void Myst::o_boilerDecreasePressureStop(uint16 op, uint16 var, uint16 argc, uint if (_state.cabinValvePosition > 0) _vm->_sound->replaceBackgroundMyst(8098, 49152); - if (!_vm->_video->endOfVideo(_cabinGaugeMovie)) { + if (_cabinGaugeMovie && !_cabinGaugeMovie->endOfVideo()) { uint16 delay = treeNextMoveDelay(_state.cabinValvePosition); Common::Rational rate = boilerComputeGaugeRate(_state.cabinValvePosition, delay); - _vm->_video->setVideoRate(_cabinGaugeMovie, rate); + _cabinGaugeMovie->setRate(rate); } } else { @@ -2117,7 +2138,7 @@ void Myst::tree_run() { // Check if alcove is accessible treeSetAlcoveAccessible(); - if (_cabinGaugeMovie != NULL_VID_HANDLE) { + if (_cabinGaugeMovie) { Common::Rational rate = boilerComputeGaugeRate(pressure, delay); boilerResetGauge(rate); } @@ -2246,13 +2267,22 @@ void Myst::rocketCheckSolution() { // Book appearing Common::String movieFile = _vm->wrapMovieFilename("selenbok", kMystStack); - _rocketLinkBook = _vm->_video->playMovie(movieFile, 224, 41); - _vm->_video->setVideoBounds(_rocketLinkBook, Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 660, 600)); + _rocketLinkBook = _vm->_video->playMovie(movieFile); + if (!_rocketLinkBook) + error("Failed to open '%s'", movieFile.c_str()); + + _rocketLinkBook->moveTo(224, 41); + _rocketLinkBook->setBounds(Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 660, 600)); _vm->_video->waitUntilMovieEnds(_rocketLinkBook); // Book looping closed - _rocketLinkBook = _vm->_video->playMovie(movieFile, 224, 41, true); - _vm->_video->setVideoBounds(_rocketLinkBook, Audio::Timestamp(0, 660, 600), Audio::Timestamp(0, 3500, 600)); + _rocketLinkBook = _vm->_video->playMovie(movieFile); + if (!_rocketLinkBook) + error("Failed to open '%s'", movieFile.c_str()); + + _rocketLinkBook->moveTo(224, 41); + _rocketLinkBook->setLooping(true); + _rocketLinkBook->setBounds(Audio::Timestamp(0, 660, 600), Audio::Timestamp(0, 3500, 600)); _tempVar = 1; } @@ -2367,7 +2397,7 @@ void Myst::o_rocketOpenBook(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Rocket open link book", op); // Flyby movie - _vm->_video->setVideoBounds(_rocketLinkBook, Audio::Timestamp(0, 3500, 600), Audio::Timestamp(0, 13100, 600)); + _rocketLinkBook->setBounds(Audio::Timestamp(0, 3500, 600), Audio::Timestamp(0, 13100, 600)); // Set linkable _tempVar = 2; @@ -2889,8 +2919,12 @@ void Myst::clockGearForwardOneStep(uint16 gear) { // Set video bounds uint16 gearPosition = _clockGearsPositions[gear] - 1; - _clockGearsVideos[gear] = _vm->_video->playMovie(_vm->wrapMovieFilename(videos[gear], kMystStack), x[gear], y[gear]); - _vm->_video->setVideoBounds(_clockGearsVideos[gear], + _clockGearsVideos[gear] = _vm->_video->playMovie(_vm->wrapMovieFilename(videos[gear], kMystStack)); + if (!_clockGearsVideos[gear]) + error("Failed to open %s movie", videos[gear]); + + _clockGearsVideos[gear]->moveTo(x[gear], y[gear]); + _clockGearsVideos[gear]->setBounds( Audio::Timestamp(0, startTime[gearPosition], 600), Audio::Timestamp(0, endTime[gearPosition], 600)); } @@ -2902,8 +2936,12 @@ void Myst::clockWeightDownOneStep() { // Set video bounds if (updateVideo) { - _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); - _vm->_video->setVideoBounds(_clockWeightVideo, + _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack)); + if (!_clockWeightVideo) + error("Failed to open cl1wlfch movie"); + + _clockWeightVideo->moveTo(124, 0); + _clockWeightVideo->setBounds( Audio::Timestamp(0, _clockWeightPosition, 600), Audio::Timestamp(0, _clockWeightPosition + 246, 600)); } @@ -2931,7 +2969,7 @@ void Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) // Let movies stop playing for (uint i = 0; i < ARRAYSIZE(videos); i++) { VideoHandle handle = _vm->_video->findVideoHandle(_vm->wrapMovieFilename(videos[i], kMystStack)); - if (handle != NULL_VID_HANDLE) + if (handle) _vm->_video->delayUntilMovieEnds(handle); } @@ -2956,8 +2994,12 @@ void Myst::clockGearsCheckSolution() { // Make weight go down _vm->_sound->replaceSoundMyst(9113); - _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); - _vm->_video->setVideoBounds(_clockWeightVideo, + _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack)); + if (!_clockWeightVideo) + error("Failed to open cl1wlfch movie"); + + _clockWeightVideo->moveTo(124, 0); + _clockWeightVideo->setBounds( Audio::Timestamp(0, _clockWeightPosition, 600), Audio::Timestamp(0, 2214, 600)); _vm->_video->waitUntilMovieEnds(_clockWeightVideo); @@ -2968,7 +3010,7 @@ void Myst::clockGearsCheckSolution() { _vm->_sound->replaceSoundMyst(7113); // Gear opening video - _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("cl1wggat", kMystStack) , 195, 225); + _vm->_video->playMovieBlocking(_vm->wrapMovieFilename("cl1wggat", kMystStack), 195, 225); _state.gearsOpen = 1; _vm->redrawArea(40); @@ -3011,7 +3053,7 @@ void Myst::clockReset() { // Let movies stop playing for (uint i = 0; i < ARRAYSIZE(videos); i++) { VideoHandle handle = _vm->_video->findVideoHandle(_vm->wrapMovieFilename(videos[i], kMystStack)); - if (handle != NULL_VID_HANDLE) + if (handle) _vm->_video->delayUntilMovieEnds(handle); } @@ -3024,9 +3066,13 @@ void Myst::clockReset() { _vm->_sound->replaceSoundMyst(7113); // Gear closing movie - VideoHandle handle = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wggat", kMystStack) , 195, 225); - _vm->_video->seekToTime(handle, _vm->_video->getDuration(handle)); - _vm->_video->setVideoRate(handle, -1); + VideoHandle handle = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wggat", kMystStack)); + if (!handle) + error("Failed to open cl1wggat movie"); + + handle->moveTo(195, 225); + handle->seek(handle->getDuration()); + handle->setRate(-1); _vm->_video->waitUntilMovieEnds(handle); // Redraw gear @@ -3038,11 +3084,15 @@ void Myst::clockReset() { } void Myst::clockResetWeight() { - _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack) , 124, 0); + _clockWeightVideo = _vm->_video->playMovie(_vm->wrapMovieFilename("cl1wlfch", kMystStack)); + if (!_clockWeightVideo) + error("Failed to open cl1wlfch movie"); + + _clockWeightVideo->moveTo(124, 0); // Play the movie backwards, weight going up - _vm->_video->seekToTime(_clockWeightVideo, Audio::Timestamp(0, _clockWeightPosition, 600)); - _vm->_video->setVideoRate(_clockWeightVideo, -1); + _clockWeightVideo->seek(Audio::Timestamp(0, _clockWeightPosition, 600)); + _clockWeightVideo->setRate(-1); // Reset position _clockWeightPosition = 0; @@ -3057,8 +3107,12 @@ void Myst::clockResetGear(uint16 gear) { // Set video bounds, gears going to 3 uint16 gearPosition = _clockGearsPositions[gear] - 1; if (gearPosition != 2) { - _clockGearsVideos[gear] = _vm->_video->playMovie(_vm->wrapMovieFilename(videos[gear], kMystStack), x[gear], y[gear]); - _vm->_video->setVideoBounds(_clockGearsVideos[gear], + _clockGearsVideos[gear] = _vm->_video->playMovie(_vm->wrapMovieFilename(videos[gear], kMystStack)); + if (!_clockGearsVideos[gear]) + error("Failed to open gears movie"); + + _clockGearsVideos[gear]->moveTo(x[gear], y[gear]); + _clockGearsVideos[gear]->setBounds( Audio::Timestamp(0, time[gearPosition], 600), Audio::Timestamp(0, time[2], 600)); } @@ -3201,13 +3255,21 @@ Common::Point Myst::towerRotationMapComputeCoords(const Common::Point ¢er, u } void Myst::towerRotationMapDrawLine(const Common::Point ¢er, const Common::Point &end) { - Graphics::PixelFormat pf = _vm->_system->getScreenFormat(); - uint32 color = 0; + uint32 color; - if (!_towerRotationOverSpot) - color = pf.RGBToColor(0xFF, 0xFF, 0xFF); // White - else - color = pf.RGBToColor(0xFF, 0, 0); // Red + if (_vm->getFeatures() & GF_ME) { + Graphics::PixelFormat pf = _vm->_system->getScreenFormat(); + + if (!_towerRotationOverSpot) + color = pf.RGBToColor(0xFF, 0xFF, 0xFF); // White + else + color = pf.RGBToColor(0xFF, 0, 0); // Red + } else { + if (!_towerRotationOverSpot) + color = 0x00; // White + else + color = 0xF9; // Red + } const Common::Rect rect = Common::Rect(106, 42, 459, 273); @@ -3281,8 +3343,8 @@ void Myst::imager_run() { if (_state.imagerActive && _state.imagerSelection == 67) { VideoHandle water = _imagerMovie->playMovie(); - _vm->_video->setVideoBounds(water, Audio::Timestamp(0, 1814, 600), Audio::Timestamp(0, 4204, 600)); - _vm->_video->setVideoLooping(water, true); + water->setBounds(Audio::Timestamp(0, 1814, 600), Audio::Timestamp(0, 4204, 600)); + water->setLooping(true); } } @@ -3394,8 +3456,11 @@ void Myst::gullsFly1_run() { else x = _vm->_rnd->getRandomNumber(160) + 260; - _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack), x, 0); + VideoHandle handle = _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack)); + if (!handle) + error("Failed to open gulls movie"); + handle->moveTo(x, 0); _gullsNextTime = time + _vm->_rnd->getRandomNumber(16667) + 13334; } } @@ -3540,8 +3605,11 @@ void Myst::gullsFly2_run() { if (time > _gullsNextTime) { uint16 video = _vm->_rnd->getRandomNumber(3); if (video != 3) { - _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack), 424, 0); - + VideoHandle handle = _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack)); + if (!handle) + error("Failed to open gulls movie"); + + handle->moveTo(424, 0); _gullsNextTime = time + _vm->_rnd->getRandomNumber(16667) + 13334; } } @@ -3572,31 +3640,41 @@ void Myst::o_boilerMovies_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) void Myst::boilerFireInit() { if (_vm->getCurCard() == 4098) { - _cabinFireMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabfire", kMystStack), 240, 279, true); - _vm->_video->pauseMovie(_cabinFireMovie, true); + _cabinFireMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabfire", kMystStack)); + if (!_cabinFireMovie) + error("Failed to open cabfire movie"); + + _cabinFireMovie->moveTo(240, 279); + _cabinFireMovie->setLooping(true); + _cabinFireMovie->pause(true); _vm->redrawArea(305); boilerFireUpdate(true); } else { if (_state.cabinPilotLightLit == 1 && _state.cabinValvePosition >= 1) { - _cabinFireMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabfirfr", kMystStack), 254, 244, true); + _cabinFireMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabfirfr", kMystStack)); + if (!_cabinFireMovie) + error("Failed to open cabfirfr movie"); + + _cabinFireMovie->moveTo(254, 244); + _cabinFireMovie->setLooping(true); } } } void Myst::boilerFireUpdate(bool init) { - uint position = _vm->_video->getTime(_cabinFireMovie); + uint position = _cabinFireMovie->getTime(); if (_state.cabinPilotLightLit == 1) { if (_state.cabinValvePosition == 0) { if (position > (uint)Audio::Timestamp(0, 200, 600).msecs() || init) { - _vm->_video->setVideoBounds(_cabinFireMovie, Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 100, 600)); - _vm->_video->pauseMovie(_cabinFireMovie, false); + _cabinFireMovie->setBounds(Audio::Timestamp(0, 0, 600), Audio::Timestamp(0, 100, 600)); + _cabinFireMovie->pause(false); } } else { if (position < (uint)Audio::Timestamp(0, 200, 600).msecs() || init) { - _vm->_video->setVideoBounds(_cabinFireMovie, Audio::Timestamp(0, 201, 600), Audio::Timestamp(0, 1900, 600)); - _vm->_video->pauseMovie(_cabinFireMovie, false); + _cabinFireMovie->setBounds(Audio::Timestamp(0, 201, 600), Audio::Timestamp(0, 1900, 600)); + _cabinFireMovie->pause(false); } } } @@ -3604,15 +3682,23 @@ void Myst::boilerFireUpdate(bool init) { void Myst::boilerGaugeInit() { if (_vm->getCurCard() == 4098) { - _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabingau", kMystStack), 243, 96); + _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabingau", kMystStack)); + if (!_cabinFireMovie) + error("Failed to open cabingau movie"); + + _cabinFireMovie->moveTo(243, 96); } else { - _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabcgfar", kMystStack), 254, 136); + _cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabcgfar", kMystStack)); + if (!_cabinFireMovie) + error("Failed to open cabcgfar movie"); + + _cabinFireMovie->moveTo(254, 136); } Audio::Timestamp frame; if (_state.cabinPilotLightLit == 1 && _state.cabinValvePosition > 12) - frame = _vm->_video->getDuration(_cabinGaugeMovie); + frame = _cabinGaugeMovie->getDuration(); else frame = Audio::Timestamp(0, 0, 600); @@ -3672,18 +3758,27 @@ void Myst::greenBook_run() { _vm->_sound->stopSound(); _vm->_sound->pauseBackgroundMyst(); + VideoHandle book = _vm->_video->playMovie(file); + if (!book) + error("Failed to open '%s'", file.c_str()); + + book->moveTo(314, 76); + if (_globals.ending != 4) { _tempVar = 2; - _vm->_video->playMovie(file, 314, 76); } else { - VideoHandle book = _vm->_video->playMovie(file, 314, 76, true); - _vm->_video->setVideoBounds(book, Audio::Timestamp(0, loopStart, 600), Audio::Timestamp(0, loopEnd, 600)); + book->setBounds(Audio::Timestamp(0, loopStart, 600), Audio::Timestamp(0, loopEnd, 600)); + book->setLooping(true); _tempVar = 0; } } else if (_tempVar == 2 && !_vm->_video->isVideoPlaying()) { - VideoHandle book = _vm->_video->playMovie(file, 314, 76); - _vm->_video->setVideoBounds(book, Audio::Timestamp(0, loopStart, 600), Audio::Timestamp(0, loopEnd, 600)); - _vm->_video->setVideoLooping(book, true); + VideoHandle book = _vm->_video->playMovie(file); + if (!book) + error("Failed to open '%s'", file.c_str()); + + book->moveTo(314, 76); + book->setBounds(Audio::Timestamp(0, loopStart, 600), Audio::Timestamp(0, loopEnd, 600)); + book->setLooping(true); _tempVar = 0; } } @@ -3706,8 +3801,11 @@ void Myst::gullsFly3_run() { if (video != 3) { uint16 x = _vm->_rnd->getRandomNumber(280) + 135; - _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack), x, 0); + VideoHandle handle = _vm->_video->playMovie(_vm->wrapMovieFilename(gulls[video], kMystStack)); + if (!handle) + error("Failed to open gulls movie"); + handle->moveTo(x, 0); _gullsNextTime = time + _vm->_rnd->getRandomNumber(16667) + 13334; } } @@ -3742,8 +3840,8 @@ void Myst::o_treeEntry_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { void Myst::o_boiler_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Exit boiler card", op); - _cabinGaugeMovie = NULL_VID_HANDLE; - _cabinFireMovie = NULL_VID_HANDLE; + _cabinGaugeMovie = VideoHandle(); + _cabinFireMovie = VideoHandle(); } void Myst::o_generatorControlRoom_exit(uint16 op, uint16 var, uint16 argc, uint16 *argv) { |