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

dreammaster dreammaster at scummvm.org
Fri Sep 2 00:50:00 CEST 2016


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:
ac740c8e39 TITANIC: Fix to setting and checking sounds


Commit: ac740c8e39113f0cd50def490dba1c6d51e07e99
    https://github.com/scummvm/scummvm/commit/ac740c8e39113f0cd50def490dba1c6d51e07e99
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-01T18:49:53-04:00

Commit Message:
TITANIC: Fix to setting and checking sounds

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/sound/sound.cpp
    engines/titanic/support/avi_surface.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 4b88f07..07358b8 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -42,7 +42,7 @@ int CGameObject::_soundHandles[4];
 
 void CGameObject::init() {
 	_credits = nullptr;
-	_soundHandles[0] = _soundHandles[1] = 0;
+	_soundHandles[0] = _soundHandles[1] = -1;
 	_soundHandles[2] = _soundHandles[3] = -1;
 }
 
@@ -521,7 +521,6 @@ void CGameObject::stopGlobalSound(bool transition, int handleIndex) {
 		sound.stopSound(_soundHandles[handleIndex]);
 		_soundHandles[handleIndex] = -1;
 	}
-	warning("CGameObject::soundFn4");
 }
 
 void CGameObject::setGlobalSoundVolume(int mode, uint seconds, int handleIndex) {
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 30772e7..6d27d1d 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -94,10 +94,11 @@ void CSound::checkSounds() {
 			if (_soundManager.isActive(soundItem->_waveFile)) {
 				i = _sounds.erase(i);
 				delete soundItem;
+				continue;
 			}
-		} else {
-			++i;
 		}
+
+		++i;
 	}
 }
 
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 79c1bad..ac6cc6d 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -339,9 +339,9 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 }
 
 void AVISurface::setFrameRate(double rate) {
-	_decoders[0]->setRate(Common::Rational(rate));
+	_decoders[0]->setRate(Common::Rational((int)rate));
 	if (_decoders[1])
-		_decoders[1]->setRate(Common::Rational(rate));
+		_decoders[1]->setRate(Common::Rational((int)rate));
 }
 
 Graphics::ManagedSurface *AVISurface::getSecondarySurface() {





More information about the Scummvm-git-logs mailing list