diff options
author | Filippos Karapetis | 2010-01-29 19:02:13 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-29 19:02:13 +0000 |
commit | 85517515a76069d77fde6ecfb933f2e133b52a01 (patch) | |
tree | 1cd83d290d5a95e8cd130e3e9876dff507736d09 | |
parent | 31319de828b06dca82a7e878404663a5cb1fe4b4 (diff) | |
download | scummvm-rg350-85517515a76069d77fde6ecfb933f2e133b52a01.tar.gz scummvm-rg350-85517515a76069d77fde6ecfb933f2e133b52a01.tar.bz2 scummvm-rg350-85517515a76069d77fde6ecfb933f2e133b52a01.zip |
Reverting incorrect rev. 47675. The actual problem was that SCI0 doesn't clear a song's handle when stopping it, but when disposing it. Hopefully, a lot of the SCI0 sound oddities are fixed now...
svn-id: r47678
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 5ddd4f329d..f7eb1962cb 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -488,6 +488,7 @@ void SoundCommandParser::cmdDisposeSound(reg_t obj, int16 value) { cmdStopSound(obj, value); _music->soundKill(musicSlot); + PUT_SEL32V(_segMan, obj, handle, 0); if (_soundVersion >= SCI_VERSION_1_EARLY) PUT_SEL32(_segMan, obj, nodePtr, NULL_REG); else @@ -511,14 +512,11 @@ void SoundCommandParser::cmdStopSound(reg_t obj, int16 value) { return; } - // Don't modify the objects of sound slots that are already stopped, - // as the associated objects could be disposed by the game scripts - if (musicSlot->status != kSoundStopped) { + if (_soundVersion <= SCI_VERSION_0_LATE) { + PUT_SEL32V(_segMan, obj, state, kSoundStopped); + } else { PUT_SEL32V(_segMan, obj, handle, 0); - if (_soundVersion <= SCI_VERSION_0_LATE) - PUT_SEL32V(_segMan, obj, state, kSoundStopped); - else - PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET); + PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET); } musicSlot->dataInc = 0; @@ -907,13 +905,11 @@ void SoundCommandParser::cmdStopAllSounds(reg_t obj, int16 value) { const MusicList::iterator end = _music->getPlayListEnd(); for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) { - // Don't modify the objects of sound slots that are already stopped, - // as the associated objects could be disposed by the game scripts - if ((*i)->status != kSoundStopped) { - if (_soundVersion <= SCI_VERSION_0_LATE) - PUT_SEL32V(_segMan, (*i)->soundObj, state, kSoundStopped); - else - PUT_SEL32V(_segMan, (*i)->soundObj, signal, SIGNAL_OFFSET); + if (_soundVersion <= SCI_VERSION_0_LATE) { + PUT_SEL32V(_segMan, (*i)->soundObj, state, kSoundStopped); + } else { + PUT_SEL32V(_segMan, obj, handle, 0); + PUT_SEL32V(_segMan, (*i)->soundObj, signal, SIGNAL_OFFSET); } (*i)->dataInc = 0; |