[Scummvm-git-logs] scummvm master -> 64cf3b6e9b9f54ae643e9b3aa6d1db249f53d3bc
sev-
sev at scummvm.org
Mon Sep 23 20:39:17 CEST 2019
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:
64cf3b6e9b ILLUSIONS: DUCKMAN: Fix endless SFX bug #11161
Commit: 64cf3b6e9b9f54ae643e9b3aa6d1db249f53d3bc
https://github.com/scummvm/scummvm/commit/64cf3b6e9b9f54ae643e9b3aa6d1db249f53d3bc
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2019-09-23T20:39:13+02:00
Commit Message:
ILLUSIONS: DUCKMAN: Fix endless SFX bug #11161
Changed paths:
engines/illusions/duckman/illusions_duckman.cpp
engines/illusions/sound.cpp
engines/illusions/sound.h
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 1ffb9f6..326d8ab 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -931,6 +931,7 @@ bool IllusionsEngine_Duckman::changeScene(uint32 sceneId, uint32 threadId, uint3
uint32 currSceneId = getCurrentScene();
if (currSceneId != 0x10003)
dumpCurrSceneFiles(currSceneId, callerThreadId);
+ _soundMan->stopLoopingSounds(); //Fix for global looping sound not stopping in falling scene.
_threads->terminateThreads(callerThreadId);
_controls->destroyControls();
_resSys->unloadSceneResources(0x10003, 0x10001);
diff --git a/engines/illusions/sound.cpp b/engines/illusions/sound.cpp
index bd39469..9a351a2 100644
--- a/engines/illusions/sound.cpp
+++ b/engines/illusions/sound.cpp
@@ -342,6 +342,10 @@ bool Sound::isPlaying() {
return g_system->getMixer()->isSoundHandleActive(_soundHandle);
}
+bool Sound::isLooping() {
+ return _looping;
+}
+
// SoundMan
SoundMan::SoundMan(IllusionsEngine *vm)
@@ -450,6 +454,15 @@ void SoundMan::stopSound(uint32 soundEffectId) {
sound->stop();
}
+void SoundMan::stopLoopingSounds() {
+ for (SoundListIterator it = _sounds.begin(); it != _sounds.end(); ++it) {
+ Sound *sound = *it;
+ if (sound->isPlaying() && sound->isLooping()) {
+ sound->stop();
+ }
+ }
+}
+
void SoundMan::unloadSounds(uint32 soundGroupId) {
SoundListIterator it = _sounds.begin();
while (it != _sounds.end()) {
diff --git a/engines/illusions/sound.h b/engines/illusions/sound.h
index 027228e..db1d47c 100644
--- a/engines/illusions/sound.h
+++ b/engines/illusions/sound.h
@@ -103,6 +103,7 @@ public:
void play(int16 volume, int16 pan);
void stop();
bool isPlaying();
+ bool isLooping();
public:
uint32 _soundEffectId;
uint32 _soundGroupId;
@@ -159,6 +160,7 @@ public:
void loadSound(uint32 soundEffectId, uint32 soundGroupId, bool looping);
void playSound(uint32 soundEffectId, int16 volume, int16 pan);
void stopSound(uint32 soundEffectId);
+ void stopLoopingSounds();
void unloadSounds(uint32 soundGroupId);
protected:
More information about the Scummvm-git-logs
mailing list