From 8b2d85f8e5b30aeb73817894974a4db53588565b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 3 Jul 2016 19:07:38 -0400 Subject: TITANIC: Figured out remainder of CMovieManager --- engines/titanic/support/movie.cpp | 5 +++-- engines/titanic/support/movie.h | 15 +++++++++++---- engines/titanic/support/movie_manager.cpp | 2 +- engines/titanic/support/movie_manager.h | 16 ++++++++++++++-- 4 files changed, 29 insertions(+), 9 deletions(-) (limited to 'engines/titanic/support') diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 869a3518f8..6a79c02a3e 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -21,6 +21,7 @@ */ #include "video/avi_decoder.h" +#include "titanic/sound/sound_manager.h" #include "titanic/support/movie.h" #include "titanic/titanic.h" @@ -144,9 +145,9 @@ const Common::List OSMovie::getMovieRangeInfo() const { return Common::List(); } -void OSMovie::proc18(int v) { +void OSMovie::setSoundManager(CSoundManager *soundManager) { // if (_aviSurface) -// _aviSurface->_field3C = 0; +// _aviSurface->_field3C = soundManager; warning("TODO: OSMovie::proc18"); } diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h index fbbfebc845..7abca6bbc0 100644 --- a/engines/titanic/support/movie.h +++ b/engines/titanic/support/movie.h @@ -35,9 +35,10 @@ enum MovieState { MOVIE_STOPPED = -1, MOVIE_NONE = 0, MOVIE_FINISHED = 1, MOVIE_FRAME = 2 }; -class CVideoSurface; -class CMovie; class CGameObject; +class CMovie; +class CSoundManager; +class CVideoSurface; class CMovieList : public List { public: @@ -112,7 +113,10 @@ public: */ virtual const Common::List getMovieRangeInfo() const = 0; - virtual void proc18(int v) = 0; + /** + * Set the sound manager reference + */ + virtual void setSoundManager(CSoundManager *soundManager) = 0; /** * Get the current movie frame @@ -189,7 +193,10 @@ public: */ virtual const Common::List getMovieRangeInfo() const; - virtual void proc18(int v); + /** + * Set the sound manager reference + */ + virtual void setSoundManager(CSoundManager *soundManager); /** * Get the current movie frame diff --git a/engines/titanic/support/movie_manager.cpp b/engines/titanic/support/movie_manager.cpp index e3330f0080..bfeb081b5c 100644 --- a/engines/titanic/support/movie_manager.cpp +++ b/engines/titanic/support/movie_manager.cpp @@ -28,7 +28,7 @@ namespace Titanic { CMovie *CMovieManager::createMovie(const CResourceKey &key, CVideoSurface *surface) { CMovie *movie = new OSMovie(key, surface); - movie->proc18(_field4); + movie->setSoundManager(_soundManager); return movie; } diff --git a/engines/titanic/support/movie_manager.h b/engines/titanic/support/movie_manager.h index 91ea75e49b..2920d909b7 100644 --- a/engines/titanic/support/movie_manager.h +++ b/engines/titanic/support/movie_manager.h @@ -25,6 +25,7 @@ #include "titanic/core/list.h" #include "titanic/core/resource_key.h" +#include "titanic/sound/sound_manager.h" namespace Titanic { @@ -35,17 +36,28 @@ class CMovieManagerBase { public: virtual ~CMovieManagerBase() {} + /** + * Create a new movie and return it + */ virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface) = 0; }; class CMovieManager : public CMovieManagerBase { private: - int _field4; + CSoundManager *_soundManager; public: - CMovieManager() : CMovieManagerBase(), _field4(0) {} + CMovieManager() : CMovieManagerBase(), _soundManager(nullptr) {} virtual ~CMovieManager() {} + /** + * Create a new movie and return it + */ virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface); + + /** + * Sets the sound manager that will be attached to all created movies + */ + void setSoundManager(CSoundManager *soundManager) { _soundManager = soundManager; } }; } // End of namespace Titanic -- cgit v1.2.3