diff options
author | Bastien Bouclet | 2017-07-09 14:23:00 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-07-22 20:38:56 +0200 |
commit | 0b9bfb3d3c71df7c011754a2f7b98e32e023dc3e (patch) | |
tree | 742137b36e77cd1585c4db465a0b54d7d54bf416 /engines | |
parent | 8f59348ec33ec7c4357b639e810ff131ab6461e1 (diff) | |
download | scummvm-rg350-0b9bfb3d3c71df7c011754a2f7b98e32e023dc3e.tar.gz scummvm-rg350-0b9bfb3d3c71df7c011754a2f7b98e32e023dc3e.tar.bz2 scummvm-rg350-0b9bfb3d3c71df7c011754a2f7b98e32e023dc3e.zip |
MOHAWK: Myst: Remove delayUntilMovieEnds
This will break movies called by scripts until event handling is
decorrelated from script calls.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/myst_stacks/myst.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/stoneship.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/video.cpp | 27 | ||||
-rw-r--r-- | engines/mohawk/video.h | 3 |
4 files changed, 3 insertions, 33 deletions
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 84a91e2a5b..edd4eccd6c 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -2981,7 +2981,7 @@ void Myst::o_clockLeverEndMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) for (uint i = 0; i < ARRAYSIZE(videos); i++) { VideoHandle handle = _vm->_video->findVideoHandle(_vm->wrapMovieFilename(videos[i], kMystStack)); if (handle) - _vm->_video->delayUntilMovieEnds(handle); + _vm->_video->waitUntilMovieEnds(handle); } if (_clockMiddleGearMovedAlone) @@ -3065,7 +3065,7 @@ void Myst::clockReset() { for (uint i = 0; i < ARRAYSIZE(videos); i++) { VideoHandle handle = _vm->_video->findVideoHandle(_vm->wrapMovieFilename(videos[i], kMystStack)); if (handle) - _vm->_video->delayUntilMovieEnds(handle); + _vm->_video->waitUntilMovieEnds(handle); } _vm->_sound->replaceSoundMyst(10113); diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index 293c0f96f4..2308738957 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -608,7 +608,7 @@ void Stoneship::o_hologramPlayback(uint16 op, uint16 var, uint16 argc, uint16 *a displayMovie->setBounds(Audio::Timestamp(0, startPoint, 600), Audio::Timestamp(0, endPoint, 600)); } - _vm->_video->delayUntilMovieEnds(displayMovie); + _vm->_video->waitUntilMovieEnds(displayMovie); } void Stoneship::o_hologramSelectionStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index eec0e9a7a0..1a7c019973 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -203,10 +203,6 @@ void VideoManager::playMovieBlockingCentered(const Common::String &fileName, boo waitUntilMovieEnds(VideoHandle(ptr)); } -void VideoManager::waitUntilMovieEnds(const VideoEntryPtr &video) { - waitUntilMovieEnds(VideoHandle(video)); -} - void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) { if (!videoHandle) return; @@ -252,29 +248,6 @@ void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) { removeEntry(videoHandle._ptr); } -void VideoManager::delayUntilMovieEnds(VideoHandle videoHandle) { - // FIXME: Why is this separate from waitUntilMovieEnds? - // It seems to only cut out the event loop (which is bad). - - if (!videoHandle) - return; - - // Sanity check - if (videoHandle._ptr->isLooping()) - error("Called delayUntilMovieEnds() on a looping video"); - - while (!videoHandle->endOfVideo() && !_vm->shouldQuit()) { - if (updateMovies()) - _vm->_system->updateScreen(); - - // Cut down on CPU usage - _vm->_system->delayMillis(10); - } - - // Ensure it's removed - removeEntry(videoHandle._ptr); -} - VideoHandle VideoManager::playMovie(const Common::String &fileName) { VideoEntryPtr ptr = open(fileName); if (!ptr) diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index c59c4af96a..4298298b75 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -305,13 +305,10 @@ public: void stopVideos(); bool isVideoPlaying(); - void waitUntilMovieEnds(const VideoEntryPtr &video); - // Handle functions VideoHandle findVideoHandle(uint16 id); VideoHandle findVideoHandle(const Common::String &fileName); void waitUntilMovieEnds(VideoHandle handle); - void delayUntilMovieEnds(VideoHandle handle); void drawVideoFrame(VideoHandle handle, const Audio::Timestamp &time); private: |