aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-03 19:07:38 -0400
committerPaul Gilbert2016-07-15 19:27:16 -0400
commit8b2d85f8e5b30aeb73817894974a4db53588565b (patch)
tree2ef506017bf8c814f86e956773ed383729756d2a /engines/titanic
parentfb06cb4dde4d612289ea1b5830f8cd1c9e1bedfc (diff)
downloadscummvm-rg350-8b2d85f8e5b30aeb73817894974a4db53588565b.tar.gz
scummvm-rg350-8b2d85f8e5b30aeb73817894974a4db53588565b.tar.bz2
scummvm-rg350-8b2d85f8e5b30aeb73817894974a4db53588565b.zip
TITANIC: Figured out remainder of CMovieManager
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/sound/sound.cpp2
-rw-r--r--engines/titanic/sound/sound_manager.cpp2
-rw-r--r--engines/titanic/sound/sound_manager.h8
-rw-r--r--engines/titanic/support/movie.cpp5
-rw-r--r--engines/titanic/support/movie.h15
-rw-r--r--engines/titanic/support/movie_manager.cpp2
-rw-r--r--engines/titanic/support/movie_manager.h16
7 files changed, 36 insertions, 14 deletions
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index dc8d0eeb21..7968a088da 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -22,6 +22,7 @@
#include "titanic/sound/sound.h"
#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -31,6 +32,7 @@ int CSoundItem::fn1() {
}
CSound::CSound(CGameManager *owner) : _gameManager(owner) {
+ g_vm->_movieManager.setSoundManager(&_soundManager);
}
void CSound::save(SimpleFile *file) const {
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index fa1e5fb166..05a924f352 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -24,7 +24,7 @@
namespace Titanic {
-SoundManager::SoundManager() : _musicPercent(75.0), _speechPercent(75.0),
+CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0),
_masterPercent(75.0), _parrotPercent(75.0), _field14(1) {
}
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 75cf06e931..ac4ac1ef9f 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -27,7 +27,7 @@
namespace Titanic {
-class SoundManager {
+class CSoundManager {
protected:
double _musicPercent;
double _speechPercent;
@@ -35,8 +35,8 @@ protected:
double _parrotPercent;
int _field14;
public:
- SoundManager();
- virtual ~SoundManager() {}
+ CSoundManager();
+ virtual ~CSoundManager() {}
/**
* Loads a sound
@@ -98,7 +98,7 @@ public:
virtual void proc29() {}
};
-class QSoundManager : public SoundManager {
+class QSoundManager : public CSoundManager {
public:
int _field18;
int _field1C;
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<CMovieRangeInfo *> OSMovie::getMovieRangeInfo() const {
return Common::List<CMovieRangeInfo *>();
}
-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<CMovie> {
public:
@@ -112,7 +113,10 @@ public:
*/
virtual const Common::List<CMovieRangeInfo *> 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<CMovieRangeInfo *> 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