diff options
| author | Paul Gilbert | 2017-07-31 22:20:50 -0400 |
|---|---|---|
| committer | Paul Gilbert | 2017-07-31 22:20:50 -0400 |
| commit | bc29ee474a4e95b91c6be3a33fd67de2a402a112 (patch) | |
| tree | 036a706f2cbf84553cfc84a8b3359466ac91e77b /engines/titanic/support | |
| parent | a42172485efb47638bd4cb27f7be8d32247a5605 (diff) | |
| download | scummvm-rg350-bc29ee474a4e95b91c6be3a33fd67de2a402a112.tar.gz scummvm-rg350-bc29ee474a4e95b91c6be3a33fd67de2a402a112.tar.bz2 scummvm-rg350-bc29ee474a4e95b91c6be3a33fd67de2a402a112.zip | |
TITANIC: Handle brief freeze if prologue credits are skipped
Diffstat (limited to 'engines/titanic/support')
| -rw-r--r-- | engines/titanic/support/avi_surface.cpp | 8 | ||||
| -rw-r--r-- | engines/titanic/support/avi_surface.h | 3 | ||||
| -rw-r--r-- | engines/titanic/support/movie.cpp | 5 | ||||
| -rw-r--r-- | engines/titanic/support/movie.h | 6 |
4 files changed, 15 insertions, 7 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index e52c2a7ea5..86daeab344 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -471,7 +471,7 @@ Graphics::ManagedSurface *AVISurface::duplicateTransparency() const { } } -void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { +bool AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { bool isDifferent = false; if (_currentFrame != ((int)startFrame - 1) || startFrame == 0) { @@ -487,6 +487,7 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { isDifferent = _movieFrameSurface[0]->w != r.width() || _movieFrameSurface[0]->h != r.height(); + bool isFinished = true; while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) { if (isNextFrame()) { renderFrame(); @@ -507,11 +508,14 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { } // Brief wait, and check at the same time for clicks to abort the clip - if (g_vm->_events->waitForPress(10)) + if (g_vm->_events->waitForPress(10)) { + isFinished = false; break; + } } stop(); + return isFinished; } uint AVISurface::getBitDepth() const { diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h index fd21c9ceab..cb2e562d54 100644 --- a/engines/titanic/support/avi_surface.h +++ b/engines/titanic/support/avi_surface.h @@ -215,8 +215,9 @@ public: /** * Plays an interruptable cutscene + * @returns True if the cutscene was not interrupted */ - void playCutscene(const Rect &r, uint startFrame, uint endFrame); + bool playCutscene(const Rect &r, uint startFrame, uint endFrame); /** * Returns the pixel depth of the movie in bits diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index eb65cf1a8a..a57a84d5b0 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -116,7 +116,7 @@ void OSMovie::play(uint startFrame, uint endFrame, uint initialFrame, uint flags movieStarted(); } -void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) { +bool OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) { if (!_movieSurface) _movieSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340, 32); @@ -124,9 +124,10 @@ void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) CEventTarget eventTarget; g_vm->_events->addTarget(&eventTarget); - _aviSurface.playCutscene(drawRect, startFrame, endFrame); + bool result = _aviSurface.playCutscene(drawRect, startFrame, endFrame); g_vm->_events->removeTarget(); + return result; } void OSMovie::pause() { diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h index caeba65584..cedf7c4d20 100644 --- a/engines/titanic/support/movie.h +++ b/engines/titanic/support/movie.h @@ -86,8 +86,9 @@ public: /** * Plays a sub-section of a movie, and doesn't return until either * the playback ends or a key has been pressed + * @returns True if the cutscene was not interrupted */ - virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0; + virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0; /** * Pauses a movie @@ -193,8 +194,9 @@ public: /** * Plays a sub-section of a movie, and doesn't return until either * the playback ends or a key has been pressed + * @returns True if the cutscene was not interrupted */ - virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame); + virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame); /** * Pauses a movie |
