[Scummvm-git-logs] scummvm master -> c8c83145a8dc90c8ea340b258999e32db56e40a0

dreammaster dreammaster at scummvm.org
Tue Sep 12 01:35:30 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c8c83145a8 TITANIC: The hasAudioTiming code was just an isActive flag


Commit: c8c83145a8dc90c8ea340b258999e32db56e40a0
    https://github.com/scummvm/scummvm/commit/c8c83145a8dc90c8ea340b258999e32db56e40a0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-11T19:35:21-04:00

Commit Message:
TITANIC: The hasAudioTiming code was just an isActive flag

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/sound/music_room_instrument.cpp
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h


diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ae517a2..ef7a8c2 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 f79c9e1..b592806 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 52151f3..7041874 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 b923298..15ac2cd 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 bd41845..c6365a8 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 03f8f24..4e9166c 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 56e7b7e..8c130dd 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 cedf7c4..36a7665 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;





More information about the Scummvm-git-logs mailing list