aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-01-18 06:06:14 +0000
committerTravis Howell2006-01-18 06:06:14 +0000
commitb88a79750b95e75e8ae15ca2839205bb35545c68 (patch)
tree227ed8236a0d95df4360c99652735bc946096363
parenta4151c99824bb42d440711e0a9d2db877ab68b28 (diff)
downloadscummvm-rg350-b88a79750b95e75e8ae15ca2839205bb35545c68.tar.gz
scummvm-rg350-b88a79750b95e75e8ae15ca2839205bb35545c68.tar.bz2
scummvm-rg350-b88a79750b95e75e8ae15ca2839205bb35545c68.zip
Sound queue order is different in HE72+ games.
Fixes wrong music been played in some locations. svn-id: r20075
-rw-r--r--scumm/sound.cpp38
-rw-r--r--scumm/sound_he.cpp4
2 files changed, 29 insertions, 13 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 534374858c..fb04087eb2 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -142,17 +142,33 @@ void Sound::processSoundQueues() {
int snd, heOffset, heChannel, heFlags;
int data[16];
- while (_soundQue2Pos) {
- _soundQue2Pos--;
- snd = _soundQue2[_soundQue2Pos].sound;
- heOffset = _soundQue2[_soundQue2Pos].offset;
- heChannel = _soundQue2[_soundQue2Pos].channel;
- heFlags = _soundQue2[_soundQue2Pos].flags;
- if (snd) {
- if (_vm->_heversion>= 60)
- playHESound(snd, heOffset, heChannel, heFlags);
- else
- playSound(snd);
+ if (_vm->_heversion >= 72) {
+ for (i = 0; i <_soundQue2Pos; i++) {
+ snd = _soundQue2[i].sound;
+ heOffset = _soundQue2[i].offset;
+ heChannel = _soundQue2[i].channel;
+ heFlags = _soundQue2[i].flags;
+ if (snd) {
+ if (_vm->_heversion>= 60)
+ playHESound(snd, heOffset, heChannel, heFlags);
+ else
+ playSound(snd);
+ }
+ }
+ _soundQue2Pos = 0;
+ } else {
+ while (_soundQue2Pos) {
+ _soundQue2Pos--;
+ snd = _soundQue2[_soundQue2Pos].sound;
+ heOffset = _soundQue2[_soundQue2Pos].offset;
+ heChannel = _soundQue2[_soundQue2Pos].channel;
+ heFlags = _soundQue2[_soundQue2Pos].flags;
+ if (snd) {
+ if (_vm->_heversion>= 60)
+ playHESound(snd, heOffset, heChannel, heFlags);
+ else
+ playSound(snd);
+ }
}
}
diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp
index 18e4a3439f..560a4d5704 100644
--- a/scumm/sound_he.cpp
+++ b/scumm/sound_he.cpp
@@ -416,7 +416,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK')) {
byte *sndPtr = ptr;
- priority = *(ptr + 18);
+ priority = (soundID > _vm->_numSounds) ? 255 : *(ptr + 18);
rate = READ_LE_UINT16(ptr + 22);
ptr += 8 + READ_BE_UINT32(ptr + 12);
@@ -480,7 +480,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
_currentMusic = soundID;
_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
}
- else {
+ else if (READ_UINT32(ptr) == MKID('MIDI')) {
if (_vm->_musicEngine) {
_vm->_musicEngine->startSound(soundID);
}