aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-03 21:51:30 +0000
committerFilippos Karapetis2010-01-03 21:51:30 +0000
commitdccc1db768240fe7e8d814fae92606be6b5bfe47 (patch)
tree716bf96d797d2ea51f0b652254ebc10f120574b3 /engines
parente71754b64d8c0f590a40a0766c7293afd46df8da (diff)
downloadscummvm-rg350-dccc1db768240fe7e8d814fae92606be6b5bfe47.tar.gz
scummvm-rg350-dccc1db768240fe7e8d814fae92606be6b5bfe47.tar.bz2
scummvm-rg350-dccc1db768240fe7e8d814fae92606be6b5bfe47.zip
Fixed regression from commit #46950 (fixes KQ6CD, Pharkas CD, and others)
svn-id: r46955
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sfx/soundcmd.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 6a20d5f2df..3fa9e91a86 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -271,6 +271,15 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
_state->sfx_add_song(build_iterator(_resMan, number, type, handle), 0, handle, number);
+
+ // Notify the engine
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ PUT_SEL32V(_segMan, obj, state, kSoundInitialized);
+ else
+ PUT_SEL32(_segMan, obj, nodePtr, obj);
+
+ PUT_SEL32(_segMan, obj, handle, obj);
+
#else
MusicEntry *newSound = new MusicEntry();
@@ -302,24 +311,23 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
newSound->pStreamAud = _audio->getAudioStream(number, 65535, &sampleLen);
newSound->soundType = Audio::Mixer::kSpeechSoundType;
} else {
- // If sound resource doesnt exist, we are supposed to leave nodePtr/handle selector alone
- // otherwise character selection music in qfg1vga wont work.
- if (!newSound->soundRes)
- return;
- _music->soundInitSnd(newSound);
+ if (newSound->soundRes)
+ _music->soundInitSnd(newSound);
}
_music->pushBackSlot(newSound);
-#endif
+ if (newSound->soundRes || newSound->pStreamAud) {
+ // Notify the engine
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ PUT_SEL32V(_segMan, obj, state, kSoundInitialized);
+ else
+ PUT_SEL32(_segMan, obj, nodePtr, obj);
- // Notify the engine
- if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(_segMan, obj, state, kSoundInitialized);
- else
- PUT_SEL32(_segMan, obj, nodePtr, obj);
+ PUT_SEL32(_segMan, obj, handle, obj);
+ }
+#endif
- PUT_SEL32(_segMan, obj, handle, obj);
}
void SoundCommandParser::cmdPlaySound(reg_t obj, int16 value) {