From ac740c8e39113f0cd50def490dba1c6d51e07e99 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 1 Sep 2016 18:49:53 -0400 Subject: TITANIC: Fix to setting and checking sounds --- engines/titanic/core/game_object.cpp | 3 +-- engines/titanic/sound/sound.cpp | 5 +++-- engines/titanic/support/avi_surface.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines') 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() { -- cgit v1.2.3