aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/video_surface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-08 23:01:02 -0400
committerPaul Gilbert2016-04-08 23:01:02 -0400
commit09a3ca07287b77d4abd5713b6c34548ebd8b84a8 (patch)
treea1296a53ed0079d4542464a80e3b496e9b3002fe /engines/titanic/support/video_surface.cpp
parente3d02532f7a64f194a802e29abef4b03eb6395b4 (diff)
downloadscummvm-rg350-09a3ca07287b77d4abd5713b6c34548ebd8b84a8.tar.gz
scummvm-rg350-09a3ca07287b77d4abd5713b6c34548ebd8b84a8.tar.bz2
scummvm-rg350-09a3ca07287b77d4abd5713b6c34548ebd8b84a8.zip
TITANIC: Implement movie loading
Diffstat (limited to 'engines/titanic/support/video_surface.cpp')
-rw-r--r--engines/titanic/support/video_surface.cpp22
1 files changed, 19 insertions, 3 deletions
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: