aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-11 19:35:21 -0400
committerPaul Gilbert2017-09-11 19:35:21 -0400
commitc8c83145a8dc90c8ea340b258999e32db56e40a0 (patch)
treea30d6b5289fdac45d657ce22f272ff5b53ce95e2 /engines
parent5d419c2b58841b2bc56c40caebab5e38622dee88 (diff)
downloadscummvm-rg350-c8c83145a8dc90c8ea340b258999e32db56e40a0.tar.gz
scummvm-rg350-c8c83145a8dc90c8ea340b258999e32db56e40a0.tar.bz2
scummvm-rg350-c8c83145a8dc90c8ea340b258999e32db56e40a0.zip
TITANIC: The hasAudioTiming code was just an isActive flag
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/core/game_object.h4
-rw-r--r--engines/titanic/game/end_sequence_control.cpp2
-rw-r--r--engines/titanic/sound/music_room_instrument.cpp4
-rw-r--r--engines/titanic/sound/titania_speech.cpp2
-rw-r--r--engines/titanic/support/avi_surface.h7
-rw-r--r--engines/titanic/support/movie.cpp7
-rw-r--r--engines/titanic/support/movie.h11
8 files changed, 30 insertions, 11 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ae517a2689..ef7a8c2bca 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1374,14 +1374,14 @@ void CGameObject::setToggleColor(byte r, byte g, byte b) {
_toggleB = b;
}
-void CGameObject::movieSetAudioTiming(bool flag) {
+void CGameObject::movieSetPlaying(bool flag) {
if (!_surface && !_resource.empty()) {
loadResource(_resource);
_resource.clear();
}
if (_surface && _surface->_movie)
- _surface->_movie->_hasAudioTiming = flag;
+ _surface->_movie->setPlaying(flag);
}
void CGameObject::movieEvent(int frameNumber) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index f79c9e1d1e..b592806977 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -653,9 +653,9 @@ public:
void stopMovie();
/**
- * Overrides whether the object's movie has audio timing
+ * Overrides whether the object's movie is playing or paused
*/
- void movieSetAudioTiming(bool flag);
+ void movieSetPlaying(bool flag);
/**
* Get the current movie frame
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index 52151f353e..7041874368 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -76,8 +76,8 @@ bool CEndSequenceControl::EnterRoomMsg(CEnterRoomMsg *msg) {
}
bool CEndSequenceControl::EnterViewMsg(CEnterViewMsg *msg) {
- movieSetAudioTiming(true);
playMovie(MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
+ movieSetPlaying(true);
return true;
}
diff --git a/engines/titanic/sound/music_room_instrument.cpp b/engines/titanic/sound/music_room_instrument.cpp
index b92329850b..15ac2cd192 100644
--- a/engines/titanic/sound/music_room_instrument.cpp
+++ b/engines/titanic/sound/music_room_instrument.cpp
@@ -115,7 +115,7 @@ void CMusicRoomInstrument::start() {
case MV_BELLS:
_gameObjects[0]->loadFrame(0);
- _gameObjects[0]->movieSetAudioTiming(true);
+ _gameObjects[0]->movieSetPlaying(true);
break;
case MV_SNAKE:
@@ -210,8 +210,8 @@ void CMusicRoomInstrument::update(int val) {
case MV_BELLS:
switch (val) {
case 60:
- _gameObjects[0]->movieSetAudioTiming(true);
_gameObjects[0]->playMovie(0, 512, MOVIE_STOP_PREVIOUS);
+ _gameObjects[0]->movieSetPlaying(true);
_animTime = 0.6;
break;
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
index bd41845712..c6365a828b 100644
--- a/engines/titanic/sound/titania_speech.cpp
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -57,10 +57,10 @@ bool CTitaniaSpeech::ActMsg(CActMsg *msg) {
CProximity prox(Audio::Mixer::kSpeechSoundType);
switch (_actionNum) {
case 1:
- movieSetAudioTiming(true);
loadSound("a#12.wav");
sleep(1000);
playMovie(0, 187, MOVIE_WAIT_FOR_FINISH | MOVIE_NOTIFY_OBJECT);
+ movieSetPlaying(true);
movieEvent(0);
break;
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 03f8f24cfe..4e9166c0f0 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -184,6 +184,13 @@ public:
}
/**
+ * Sets whether the video is playing (versus paused)
+ */
+ virtual void setPlaying(bool playingFlag) {
+ _decoder->pauseVideo(!playingFlag);
+ }
+
+ /**
* Handle any movie events relevent for the frame
*/
virtual bool handleEvents(CMovieEventList &events);
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 56e7b7e6f2..8c130ddb6f 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -40,8 +40,7 @@ namespace Titanic {
CMovieList *CMovie::_playingMovies;
CVideoSurface *CMovie::_movieSurface;
-CMovie::CMovie() : ListItem(), _handled(false), _hasVideoFrame(false),
- _hasAudioTiming(false) {
+CMovie::CMovie() : ListItem(), _handled(false), _hasVideoFrame(false) {
}
CMovie::~CMovie() {
@@ -200,6 +199,10 @@ void OSMovie::setFrameRate(double rate) {
_aviSurface.setFrameRate(rate);
}
+void OSMovie::setPlaying(bool playingFlag) {
+ _aviSurface.setPlaying(playingFlag);
+}
+
Graphics::ManagedSurface *OSMovie::duplicateTransparency() const {
return _aviSurface.duplicateTransparency();
}
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index cedf7c4d20..36a76654e4 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -50,7 +50,6 @@ protected:
public:
bool _handled;
bool _hasVideoFrame;
- bool _hasAudioTiming;
public:
static CMovieList *_playingMovies;
static CVideoSurface *_movieSurface;
@@ -139,6 +138,11 @@ public:
virtual void setFrameRate(double rate) = 0;
/**
+ * Sets whether the video is playing (versus paused)
+ */
+ virtual void setPlaying(bool playingFlag) = 0;
+
+ /**
* Creates a duplicate of the transparency surface
*/
virtual Graphics::ManagedSurface *duplicateTransparency() const = 0;
@@ -247,6 +251,11 @@ public:
virtual void setFrameRate(double rate);
/**
+ * Sets whether the video is playing (versus paused)
+ */
+ virtual void setPlaying(bool playingFlag);
+
+ /**
* Creates a duplicate of the transparency surface
*/
virtual Graphics::ManagedSurface *duplicateTransparency() const;