aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-11-11 18:31:07 +0100
committerBastien Bouclet2019-11-15 19:34:18 +0100
commitbc983b82af0aa705a702cfeb6e748fbec7c0df67 (patch)
tree734eab7591a616bbd7b62f50248731ec03045da5 /engines/mohawk/myst.cpp
parentad70c10392c49ef8861c0c4ae86472cb5f219c15 (diff)
downloadscummvm-rg350-bc983b82af0aa705a702cfeb6e748fbec7c0df67.tar.gz
scummvm-rg350-bc983b82af0aa705a702cfeb6e748fbec7c0df67.tar.bz2
scummvm-rg350-bc983b82af0aa705a702cfeb6e748fbec7c0df67.zip
MOHAWK: MYST: Loop the flyby movies and allow skipping using left click
Fixes #10599.
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r--engines/mohawk/myst.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index b2d04e1dd5..9d1a1e12a2 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -284,6 +284,7 @@ void MohawkEngine_Myst::playFlybyMovie(MystStack stack) {
// Play Flyby Entry Movie on Masterpiece Edition.
const char *flyby = nullptr;
+ bool looping = true;
switch (stack) {
case kSeleniticStack:
@@ -295,8 +296,10 @@ void MohawkEngine_Myst::playFlybyMovie(MystStack stack) {
// Myst Flyby Movie not used in Original Masterpiece Edition Engine
// We play it when first arriving on Myst, and if the user has chosen so.
case kMystStack:
- if (ConfMan.getBool("playmystflyby"))
+ if (ConfMan.getBool("playmystflyby")) {
flyby = "myst flyby";
+ looping = false;
+ }
break;
case kMechanicalStack:
flyby = "mech age flyby";
@@ -321,7 +324,36 @@ void MohawkEngine_Myst::playFlybyMovie(MystStack stack) {
}
video->center();
- waitUntilMovieEnds(video);
+ playSkippableMovie(video, looping);
+}
+
+void MohawkEngine_Myst::playSkippableMovie(const VideoEntryPtr &video, bool looping) {
+ _waitingOnBlockingOperation = true;
+
+ video->setLooping(true);
+
+ _cursor->setCursor(_mainCursor);
+
+ while ((looping || !video->endOfVideo()) && !shouldQuit()) {
+ doFrame();
+
+ // Allow skipping
+ if (_escapePressed) {
+ _escapePressed = false;
+ break;
+ }
+
+ if (_mouseClicked) {
+ _mouseClicked = false;
+ break;
+ }
+ }
+
+ _cursor->setCursor(0);
+
+ // Ensure it's removed
+ _video->removeEntry(video);
+ _waitingOnBlockingOperation = false;
}
void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) {