From 1ee3f334d39be6944e643c22cd376d5ae4ffaaf5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 10 Apr 2016 14:40:59 -0400 Subject: TITANIC: Change back to using original AVIDecoder --- engines/titanic/support/movie.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'engines/titanic/support/movie.cpp') diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 7593c74e42..6599093226 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -20,8 +20,7 @@ * */ -#include "image/codecs/cinepak.h" -#include "titanic/support/avi_decoder.h" +#include "video/avi_decoder.h" #include "titanic/support/movie.h" #include "titanic/titanic.h" @@ -51,11 +50,18 @@ bool CMovie::get10() { OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface), _gameObject(nullptr) { - _video = new AVIDecoder(); + _video = new Video::AVIDecoder(); if (!_video->loadFile(name.getString())) error("Could not open video - %s", name.getString().c_str()); } +OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) : + _videoSurface(surface), _gameObject(nullptr) { + _video = new Video::AVIDecoder(); + if (!_video->loadStream(stream)) + error("Could not parse movie stream"); +} + OSMovie::~OSMovie() { g_vm->_activeMovies.remove(this); delete _video; @@ -134,7 +140,9 @@ MovieState OSMovie::getState() { void OSMovie::update() { if (_state != MOVIE_STOPPED) { if (_video->isPlaying()) { - if (_video->needsUpdate()) { + if (_video->endOfVideo()) { + _state = MOVIE_FINISHED; + } else if (_video->needsUpdate()) { decodeFrame(); _state = MOVIE_FRAME; } else { -- cgit v1.2.3