aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-08-13 01:35:52 +0000
committerEugene Sandulenko2005-08-13 01:35:52 +0000
commit45047c5cdbab69d2e055738ca4b2bdab9e963c59 (patch)
treefafe419618bba30442ac1182c9ab63daf6f65abd
parent8242e3e2bce9b6570854826af2b1d491cad8c3e4 (diff)
downloadscummvm-rg350-45047c5cdbab69d2e055738ca4b2bdab9e963c59.tar.gz
scummvm-rg350-45047c5cdbab69d2e055738ca4b2bdab9e963c59.tar.bz2
scummvm-rg350-45047c5cdbab69d2e055738ca4b2bdab9e963c59.zip
Fix bug #1257542 "ITE: Sounds do not stop after quitting scene". Though
There is a big problem in sound code. It is written with only one SFX and only one Voice playing at the same time in mind which is not the case. This should be rewritten so there are more than 2 sound handles. svn-id: r18674
-rw-r--r--saga/scene.cpp3
-rw-r--r--saga/sound.cpp4
-rw-r--r--saga/sound.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp
index 6369aa988c..951e3896b2 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -812,8 +812,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
_vm->_interface->setMode(kPanelMain);
}
- _vm->_sound->stopVoice();
- _vm->_sound->stopSound();
+ _vm->_sound->stopAll();
if (_sceneDescription.musicResourceId >= 0) {
event.type = kEvTOneshot;
diff --git a/saga/sound.cpp b/saga/sound.cpp
index a5bcc4a24f..3988e34504 100644
--- a/saga/sound.cpp
+++ b/saga/sound.cpp
@@ -92,4 +92,8 @@ void Sound::stopVoice() {
_mixer->stopHandle(_voiceHandle);
}
+void Sound::stopAll() {
+ _mixer->stopAll();
+}
+
} // End of namespace Saga
diff --git a/saga/sound.h b/saga/sound.h
index 78e9317dd3..68c8e2369c 100644
--- a/saga/sound.h
+++ b/saga/sound.h
@@ -61,6 +61,8 @@ public:
void resumeVoice();
void stopVoice();
+ void stopAll();
+
private:
void playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int volume, bool loop);