From dccc1db768240fe7e8d814fae92606be6b5bfe47 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 3 Jan 2010 21:51:30 +0000 Subject: Fixed regression from commit #46950 (fixes KQ6CD, Pharkas CD, and others) svn-id: r46955 --- engines/sci/sfx/soundcmd.cpp | 32 ++++++++++++++++++++------------ 1 file 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) { -- cgit v1.2.3