diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp index 066a418dbb3..0e88e135d35 100644 --- a/engines/titanic/game/transport/service_elevator.cpp +++ b/engines/titanic/game/transport/service_elevator.cpp @@ -207,10 +207,10 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque if (doorbot && _v3 == 0) { _soundHandle1 = playSound("z#415.wav", 50); - addTimer(1, 1000, 500); + _timerId = addTimer(1, 1000, 500); } else if (doorbot && _v3 == 1) { _soundHandle1 = playSound("z#417.wav", 50); - addTimer(1, 1000, 500); + _timerId = addTimer(1, 1000, 500); } else if (_fieldDC == _v3) { switch (_v3) { case 0: @@ -226,7 +226,7 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque break; } - addTimer(1, 1000, 500); + _timerId = addTimer(1, 1000, 500); } else { switch (_v3) { case 0: @@ -242,7 +242,7 @@ bool CServiceElevator::ServiceElevatorFloorRequestMsg(CServiceElevatorFloorReque break; } - addTimer(0, 1000, 500); + _timerId = addTimer(0, 1000, 500); } return true; diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp index e48c8760c5d..fb8cc299df0 100644 --- a/engines/titanic/sound/sound.cpp +++ b/engines/titanic/sound/sound.cpp @@ -57,7 +57,7 @@ void CSound::preEnterView(CViewItem *newView, bool isNewRoom) { _soundManager.setListenerPosition(xp, yp, zp, cosVal, sinVal, 0, isNewRoom); } -bool CSound::isActive(int handle) const { +bool CSound::isActive(int handle) { if (handle != 0 && handle != -1) return _soundManager.isActive(handle); diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h index 21f2a93f240..c767a3d75fc 100644 --- a/engines/titanic/sound/sound.h +++ b/engines/titanic/sound/sound.h @@ -115,7 +115,7 @@ public: /** * Returns true if a sound with the specified handle is active */ - bool isActive(int handle) const; + bool isActive(int handle); /** * Sets the volume for a sound diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp index c1a46e51030..5f8e53caf37 100644 --- a/engines/titanic/sound/sound_manager.cpp +++ b/engines/titanic/sound/sound_manager.cpp @@ -311,7 +311,9 @@ void QSoundManager::setPolarPosition(int handle, double range, double azimuth, d } } -bool QSoundManager::isActive(int handle) const { +bool QSoundManager::isActive(int handle) { + resetChannel(10); + for (uint idx = 0; idx < _slots.size(); ++idx) { if (_slots[idx]._handle == handle) return true; @@ -320,7 +322,7 @@ bool QSoundManager::isActive(int handle) const { return false; } -bool QSoundManager::isActive(const CWaveFile *waveFile) const { +bool QSoundManager::isActive(const CWaveFile *waveFile) { return _sounds.contains(waveFile); } diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h index a3074a8e57f..ff556346deb 100644 --- a/engines/titanic/sound/sound_manager.h +++ b/engines/titanic/sound/sound_manager.h @@ -123,12 +123,12 @@ public: /** * Returns true if the given sound is currently active */ - virtual bool isActive(int handle) const = 0; + virtual bool isActive(int handle) = 0; /** * Returns true if the given sound is currently active */ - virtual bool isActive(const CWaveFile *waveFile) const { return false; } + virtual bool isActive(const CWaveFile *waveFile) { return false; } /** * Handles regularly updating the mixer @@ -395,12 +395,12 @@ public: /** * Returns true if the given sound is currently active */ - virtual bool isActive(int handle) const; + virtual bool isActive(int handle); /** * Returns true if the given sound is currently active */ - virtual bool isActive(const CWaveFile *waveFile) const; + virtual bool isActive(const CWaveFile *waveFile); /** * Handles regularly updating the mixer