Sound queue order is different in HE72+ games.
Fixes wrong music been played in some locations. svn-id: r20075
This commit is contained in:
parent
a4151c9982
commit
b88a79750b
2 changed files with 29 additions and 13 deletions
|
@ -142,6 +142,21 @@ void Sound::processSoundQueues() {
|
|||
int snd, heOffset, heChannel, heFlags;
|
||||
int data[16];
|
||||
|
||||
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;
|
||||
|
@ -155,6 +170,7 @@ void Sound::processSoundQueues() {
|
|||
playSound(snd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (i < _soundQuePos) {
|
||||
num = _soundQue[i++];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue