aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-10-22 11:40:51 -0400
committerPaul Gilbert2016-10-22 11:40:51 -0400
commit2bf087d2b9246a5a9383aa789465b35a2b4159c4 (patch)
tree6aa8da469424acb36079861a07701d47100b4c62 /engines/titanic
parent8e328647dc7ee62c26d6a9518c7a9072e637c186 (diff)
downloadscummvm-rg350-2bf087d2b9246a5a9383aa789465b35a2b4159c4.tar.gz
scummvm-rg350-2bf087d2b9246a5a9383aa789465b35a2b4159c4.tar.bz2
scummvm-rg350-2bf087d2b9246a5a9383aa789465b35a2b4159c4.zip
TITANIC: Workaround for Doorbot's 'cloak off' movie playback
The original starts a movie for the Doorbot taking his cloak off, but then plays a cutscene of the doorbot first appearing. Because of this delay, our VideoDecoder wasn't correctly playing the movie after. To fix that, new movies are initially paused when started, and then resumed the first time we try to do events checking for it
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/support/avi_surface.cpp9
-rw-r--r--engines/titanic/support/avi_surface.h10
-rw-r--r--engines/titanic/support/movie.cpp8
-rw-r--r--engines/titanic/support/movie.h16
-rw-r--r--engines/titanic/support/video_surface.cpp1
5 files changed, 44 insertions, 0 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 9e465c705f..07458812b9 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -114,6 +114,15 @@ void AVISurface::stop() {
_movieRangeInfo.destroyContents();
}
+void AVISurface::pause() {
+ _decoder->pauseVideo(true);
+}
+
+void AVISurface::resume() {
+ if (_decoder->isPaused())
+ _decoder->pauseVideo(false);
+}
+
bool AVISurface::startAtFrame(int frameNumber) {
if (isPlaying())
// If it's already playing, then don't allow it
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index b6231a646f..b4e6d420cb 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -120,6 +120,16 @@ public:
virtual void stop();
/**
+ * Pauses video playback
+ */
+ virtual void pause();
+
+ /**
+ * Resumes the video if it's paused
+ */
+ virtual void resume();
+
+ /**
* Return true if a video is currently playing
*/
virtual bool isPlaying() const { return _decoder->isPlaying(); }
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index aea51e1a1e..2115906992 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -143,6 +143,10 @@ void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame)
g_vm->_events->removeTarget();
}
+void OSMovie::pause() {
+ _aviSurface.pause();
+}
+
void OSMovie::stop() {
_aviSurface.stop();
removeFromPlayingMovies();
@@ -161,6 +165,10 @@ void OSMovie::setFrame(uint frameNumber) {
}
bool OSMovie::handleEvents(CMovieEventList &events) {
+ // WORKAROUND: If a movie is paused as part of initial
+ // scene loading, now's the time to un-pause it
+ _aviSurface.resume();
+
if (!_aviSurface.isPlaying())
return false;
if (!_aviSurface.isNextFrame())
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index acc647065f..caeba65584 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -90,6 +90,14 @@ public:
virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0;
/**
+ * Pauses a movie
+ * @remarks Acts a workaround for our video decoder, since some movies started
+ * as part of a scene load need to be paused until the scene is interactive,
+ * or else they get played back too quickly
+ */
+ virtual void pause() = 0;
+
+ /**
* Stops the movie
*/
virtual void stop() = 0;
@@ -189,6 +197,14 @@ public:
virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame);
/**
+ * Pauses a movie
+ * @remarks Acts a workaround for our video decoder, since some movies started
+ * as part of a scene load need to be paused until the scene is interactive,
+ * or else they get played back too quickly
+ */
+ virtual void pause();
+
+ /**
* Stops the movie
*/
virtual void stop();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 45813bb740..293232860c 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -560,6 +560,7 @@ void OSVideoSurface::playMovie(uint flags, CGameObject *obj) {
void OSVideoSurface::playMovie(uint startFrame, uint endFrame, uint flags, CGameObject *obj) {
if (loadIfReady() && _movie) {
_movie->play(startFrame, endFrame, flags, obj);
+ _movie->pause();
}
}