From 09a3ca07287b77d4abd5713b6c34548ebd8b84a8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 8 Apr 2016 23:01:02 -0400 Subject: TITANIC: Implement movie loading --- engines/titanic/support/video_surface.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'engines/titanic/support/video_surface.cpp') diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp index 1a0d48bebe..c7b437e1e7 100644 --- a/engines/titanic/support/video_surface.cpp +++ b/engines/titanic/support/video_surface.cpp @@ -241,8 +241,24 @@ void OSVideoSurface::loadJPEG(const CResourceKey &key) { _resourceKey = key; } -void OSVideoSurface::loadMovie() { - warning("TODO"); +void OSVideoSurface::loadMovie(const CResourceKey &key, bool destroyFlag) { + // Delete any prior movie + if (_movie) { + delete _movie; + _movie = nullptr; + } + + // Create the new movie and load the first frame to the video surface + _movie = new OSMovie(key, this); + _movie->setFrame(0); + + // If flagged to destroy, then immediately destroy movie instance + if (destroyFlag) { + delete _movie; + _movie = nullptr; + } + + _resourceKey = key; } bool OSVideoSurface::lock() { @@ -329,7 +345,7 @@ bool OSVideoSurface::load() { return true; case FILETYPE_MOVIE: - loadMovie(); + loadMovie(_resourceKey); return true; default: -- cgit v1.2.3