diff options
author | Filippos Karapetis | 2009-11-19 08:56:05 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-11-19 08:56:05 +0000 |
commit | f9a1a5751ea246b23543cfd3e92dd5039c8bd158 (patch) | |
tree | abcb3c01c0958f3f40b3bb8848c12c38059c51bb /engines/sci/sfx | |
parent | c7e89bc18e03933aed48995d80af378a1f34f406 (diff) | |
download | scummvm-rg350-f9a1a5751ea246b23543cfd3e92dd5039c8bd158.tar.gz scummvm-rg350-f9a1a5751ea246b23543cfd3e92dd5039c8bd158.tar.bz2 scummvm-rg350-f9a1a5751ea246b23543cfd3e92dd5039c8bd158.zip |
Fixed regression from commit #45862
svn-id: r45985
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r-- | engines/sci/sfx/soundcmd.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index 6ac2a13452..6623fae549 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -219,7 +219,7 @@ reg_t SoundCommandParser::parseCommand(int argc, reg_t *argv, reg_t acc) { } if (command < _soundCommands.size()) { - printf("%s\n", _soundCommands[command]->desc); + // printf("%s\n", _soundCommands[command]->desc); // debug debugC(2, kDebugLevelSound, "%s", _soundCommands[command]->desc); (this->*(_soundCommands[command]->sndCmd))(obj, handle, value); } else { @@ -230,12 +230,15 @@ reg_t SoundCommandParser::parseCommand(int argc, reg_t *argv, reg_t acc) { } void SoundCommandParser::cmdInitHandle(reg_t obj, SongHandle handle, int value) { - if (!obj.segment) - return; - #ifdef USE_OLD_MUSIC_FUNCTIONS + + if (_doSoundVersion != SCI_VERSION_1_LATE) { + if (!obj.segment) + return; + } + SongIteratorType type = (_doSoundVersion == SCI_VERSION_0_EARLY) ? SCI_SONG_ITERATOR_TYPE_SCI0 : SCI_SONG_ITERATOR_TYPE_SCI1; - int number = GET_SEL32V(_segMan, obj, number); + int number = obj.segment ? GET_SEL32V(_segMan, obj, number) : -1; if (_hasNodePtr) { if (GET_SEL32V(_segMan, obj, nodePtr)) { @@ -246,7 +249,7 @@ void SoundCommandParser::cmdInitHandle(reg_t obj, SongHandle handle, int value) // Some games try to init non-existing sounds (e.g. KQ6) if (_doSoundVersion == SCI_VERSION_1_LATE) { - if (!_resMan->testResource(ResourceId(kResourceTypeSound, value))) + if (!obj.segment || !_resMan->testResource(ResourceId(kResourceTypeSound, number))) return; } |