diff options
author | Martin Kiewitz | 2010-01-18 22:39:56 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-01-18 22:39:56 +0000 |
commit | bab35a399156cba3d125c96e39ac96161289caf4 (patch) | |
tree | 281ac6d7ca3cf98dd35c1eb548cdda1a62bfb07f | |
parent | 7112cfe8a27bb5ae3a693332f26aa246d1c8c3e6 (diff) | |
download | scummvm-rg350-bab35a399156cba3d125c96e39ac96161289caf4.tar.gz scummvm-rg350-bab35a399156cba3d125c96e39ac96161289caf4.tar.bz2 scummvm-rg350-bab35a399156cba3d125c96e39ac96161289caf4.zip |
SCI: dont set dataInc selector inside updateCues when dataInc is not available
svn-id: r47362
-rw-r--r-- | engines/sci/sci.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 7 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.h | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 05a1f5cf8b..7e428c4f89 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -165,7 +165,7 @@ Common::Error SciEngine::run() { SciVersion soundVersion = _gamestate->detectDoSoundType(); - _gamestate->_soundCmd = new SoundCommandParser(_resMan, segMan, _audio, soundVersion); + _gamestate->_soundCmd = new SoundCommandParser(_resMan, segMan, _kernel, _audio, soundVersion); // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("undither", "true"); diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 7a83f46132..2268b6b76a 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -126,8 +126,8 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their } #endif -SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion soundVersion) : - _resMan(resMan), _segMan(segMan), _audio(audio), _soundVersion(soundVersion) { +SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion) : + _resMan(resMan), _segMan(segMan), _kernel(kernel), _audio(audio), _soundVersion(soundVersion) { #ifdef USE_OLD_MUSIC_FUNCTIONS // The following hack is needed to ease the change from old to new sound code (because the new sound code does not use SfxState) @@ -840,7 +840,8 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) { // Update MIDI slots if (musicSlot->signal == 0) { if (musicSlot->dataInc != GET_SEL32V(_segMan, obj, dataInc)) { - PUT_SEL32V(_segMan, obj, dataInc, musicSlot->dataInc); + if (_kernel->_selectorCache.dataInc > -1) + PUT_SEL32V(_segMan, obj, dataInc, musicSlot->dataInc); PUT_SEL32V(_segMan, obj, signal, musicSlot->dataInc + 127); } } else { diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index 7c1995e8d4..590aba6388 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -46,7 +46,7 @@ struct MusicEntryCommand { class SoundCommandParser { public: - SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion soundVersion); + SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion); ~SoundCommandParser(); enum { @@ -81,6 +81,7 @@ private: SoundCommandContainer _soundCommands; ResourceManager *_resMan; SegManager *_segMan; + Kernel *_kernel; #ifdef USE_OLD_MUSIC_FUNCTIONS SfxState *_state; int _midiCmd, _controller, _param; |