aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_towns.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-24 01:29:09 +0000
committerJohannes Schickel2009-05-24 01:29:09 +0000
commit344caa88fcf8ce352e7bee6b2c6d4a8df2df548e (patch)
tree34060263b7e3c21cfab3df09ce811fe7d094d34e /engines/kyra/sound_towns.cpp
parentc2812140274d1c37e57f732f0a30e8a39d30e2ca (diff)
downloadscummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.tar.gz
scummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.tar.bz2
scummvm-rg350-344caa88fcf8ce352e7bee6b2c6d4a8df2df548e.zip
Make various Sound functionality SoundHandle instead of filename based.
- This fixes multiple sounds being played at once in Lands of Lore svn-id: r40848
Diffstat (limited to 'engines/kyra/sound_towns.cpp')
-rw-r--r--engines/kyra/sound_towns.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index f96e37b94f..3e39a1d131 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -4231,14 +4231,14 @@ void SoundTownsPC98_v2::beginFadeOut() {
haltTrack();
}
-int32 SoundTownsPC98_v2::voicePlay(const char *file, uint8, bool) {
+int32 SoundTownsPC98_v2::voicePlay(const char *file, uint8, bool, Audio::SoundHandle *handle) {
static const uint16 rates[] = { 0x10E1, 0x0CA9, 0x0870, 0x0654, 0x0438, 0x032A, 0x021C, 0x0194 };
static const char patternHOF[] = "%s.PCM";
static const char patternLOL[] = "%s.VOC";
int h = 0;
if (_currentSFX) {
- while (_mixer->isSoundHandleActive(_soundChannels[h].channelHandle) && h < kNumChannelHandles)
+ while (_mixer->isSoundHandleActive(_soundChannels[h]) && h < kNumChannelHandles)
h++;
if (h >= kNumChannelHandles)
return 0;
@@ -4297,8 +4297,9 @@ int32 SoundTownsPC98_v2::voicePlay(const char *file, uint8, bool) {
_currentSFX = Audio::makeLinearInputStream(sfx, outsize, outputRate,
Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LITTLE_ENDIAN | Audio::Mixer::FLAG_AUTOFREE, 0, 0);
- _soundChannels[h].file = file;
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h].channelHandle, _currentSFX);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h], _currentSFX);
+ if (handle)
+ *handle = _soundChannels[h];
delete[] data;
return 1;