aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/soundcmd.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-27 21:11:24 +0000
committerFilippos Karapetis2010-01-27 21:11:24 +0000
commit76ff84a62fcbec28b58ab14a157ec9fc74dd05d6 (patch)
tree5613fb6b362df23f1861782c2c3e199bd28839b8 /engines/sci/sound/soundcmd.cpp
parente81ddfcdccffa431532d5e6d604d49084dd212b4 (diff)
downloadscummvm-rg350-76ff84a62fcbec28b58ab14a157ec9fc74dd05d6.tar.gz
scummvm-rg350-76ff84a62fcbec28b58ab14a157ec9fc74dd05d6.tar.bz2
scummvm-rg350-76ff84a62fcbec28b58ab14a157ec9fc74dd05d6.zip
Fixed the demo version of Longbow - speech was not played at all with the new sound code
svn-id: r47610
Diffstat (limited to 'engines/sci/sound/soundcmd.cpp')
-rw-r--r--engines/sci/sound/soundcmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 7b1f108667..b9609014e7 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -286,6 +286,11 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
#else
+ // Check if a track with the same sound object is already playing
+ MusicEntry *oldSound = _music->getSlot(obj);
+ if (oldSound)
+ cmdDisposeSound(obj, value);
+
MusicEntry *newSound = new MusicEntry();
newSound->resnum = number;
if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number)))
@@ -299,11 +304,6 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
if (_soundVersion >= SCI_VERSION_1_LATE)
newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX);
- // Check if a track with the same sound object is already playing
- MusicEntry *oldSound = _music->getSlot(obj);
- if (oldSound)
- cmdDisposeSound(obj, value);
-
// In SCI1.1 games, sound effects are started from here. If we can find
// a relevant audio resource, play it, otherwise switch to synthesized
// effects. If the resource exists, play it using map 65535 (sound