aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-01 18:49:53 -0400
committerPaul Gilbert2016-09-01 18:49:53 -0400
commitac740c8e39113f0cd50def490dba1c6d51e07e99 (patch)
tree11384f22edfe558c9f33a6505774617f390ac9bc
parent9e70b0853bd79c07380f2e1975677ab85e208bf2 (diff)
downloadscummvm-rg350-ac740c8e39113f0cd50def490dba1c6d51e07e99.tar.gz
scummvm-rg350-ac740c8e39113f0cd50def490dba1c6d51e07e99.tar.bz2
scummvm-rg350-ac740c8e39113f0cd50def490dba1c6d51e07e99.zip
TITANIC: Fix to setting and checking sounds
-rw-r--r--engines/titanic/core/game_object.cpp3
-rw-r--r--engines/titanic/sound/sound.cpp5
-rw-r--r--engines/titanic/support/avi_surface.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 4b88f07478..07358b8115 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 30772e780c..6d27d1de49 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 79c1badf61..ac6cc6dbe7 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() {