aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-08-30 21:09:13 +0000
committerPaweł Kołodziejski2003-08-30 21:09:13 +0000
commit7b3aae7c03b1b3355d47d5704d9f202c219fc955 (patch)
treecdf65a91704e9f998bc1a35caea47ae28075c242 /sword2
parentf72681b10a8bfea5d5627752112207378c3ddf1b (diff)
downloadscummvm-rg350-7b3aae7c03b1b3355d47d5704d9f202c219fc955.tar.gz
scummvm-rg350-7b3aae7c03b1b3355d47d5704d9f202c219fc955.tar.bz2
scummvm-rg350-7b3aae7c03b1b3355d47d5704d9f202c219fc955.zip
fixed not cleared sound handle for music
svn-id: r9931
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/d_sound.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index d658dc69bc..7010e692dc 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -1169,6 +1169,7 @@ void Sword2Sound::StartMusicFadeDown(int i) {
musFading[i] = -16;
musStreaming[i] = 0;
fpMus.close();
+ soundHandleMusic[i] = 0;
}
int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 looping) {
@@ -1279,7 +1280,7 @@ int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 l
}
if (soundHandleMusic[i] == 0) {
- soundHandleMusic[i] = g_engine->_mixer->newStream(data16, bufferSizeMusic, 22050, SoundMixer::FLAG_16BITS, 100000);
+ soundHandleMusic[i] = g_engine->_mixer->newStream(data16, bufferSizeMusic, 22050, SoundMixer::FLAG_16BITS, 100000);
} else {
g_engine->_mixer->appendStream(soundHandleMusic[i], data16, bufferSizeMusic);
}
@@ -1298,6 +1299,7 @@ int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 l
musFading[i] = 0;
g_engine->_mixer->endStream(soundHandleMusic[i]);
musStreaming[i] = 0;
+ soundHandleMusic[i] = 0;
} else if (musStreaming[0] + musStreaming[1] == 1) {
i = musStreaming[0]; // Set i to the free channel
@@ -1837,6 +1839,7 @@ void Sword2Sound::UpdateCompSampleStreaming(void) {
g_engine->_mixer->endStream(soundHandleMusic[i]);
musStreaming[i] = 0;
musLooping[i] = 0;
+ soundHandleMusic[i] = 0;
} else {
// Modify the volume according to the master volume and music mute state
if (musicMuted)
@@ -1932,6 +1935,7 @@ void Sword2Sound::UpdateCompSampleStreaming(void) {
// End of the music so we need to start fading and start the music again
if (fade) {
+ soundHandleMusic[i] = 0;
musFading[i] = -16; // Fade the old music
// Close the music cluster if it's open
@@ -1944,6 +1948,8 @@ void Sword2Sound::UpdateCompSampleStreaming(void) {
StreamCompMusic(musFilename[i], musId[i], musLooping[i]);
}
}
+ } else {
+ soundHandleMusic[i] = 0;
}
}
}