aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-01-05 07:49:52 +0000
committerTravis Howell2006-01-05 07:49:52 +0000
commit5551e5d14c202cd801b160f7fc13dd1b2f223b70 (patch)
tree5b87c60e1fde706a39b873932b386df360984770 /scumm
parente01afb0bd4b80c387a6170ee45a74ad684038b49 (diff)
downloadscummvm-rg350-5551e5d14c202cd801b160f7fc13dd1b2f223b70.tar.gz
scummvm-rg350-5551e5d14c202cd801b160f7fc13dd1b2f223b70.tar.bz2
scummvm-rg350-5551e5d14c202cd801b160f7fc13dd1b2f223b70.zip
Enable sound priority in HE games.
svn-id: r19910
Diffstat (limited to 'scumm')
-rw-r--r--scumm/sound.cpp1
-rw-r--r--scumm/sound_he.cpp19
2 files changed, 11 insertions, 9 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 01e292bea3..f0797f4712 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -29,7 +29,6 @@
#include "scumm/util.h"
#include "common/config-manager.h"
-#include "common/system.h"
#include "common/timer.h"
#include "common/util.h"
diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp
index 662417ef26..1355b68aee 100644
--- a/scumm/sound_he.cpp
+++ b/scumm/sound_he.cpp
@@ -22,12 +22,12 @@
#include "common/stdafx.h"
#include "scumm/actor.h"
+#include "scumm/imuse.h"
#include "scumm/scumm.h"
#include "scumm/sound.h"
#include "scumm/util.h"
#include "common/config-manager.h"
-#include "common/system.h"
#include "common/timer.h"
#include "common/util.h"
@@ -96,7 +96,7 @@ int Sound::getSoundVar(int sound, int var) {
}
if (chan != -1) {
- //debug(1, "getSoundVar: sound %d var %d result %d\n", sound, var, _heChannel[chan].soundVars[var]);
+ debug(1, "getSoundVar: sound %d var %d result %d\n", sound, var, _heChannel[chan].soundVars[var]);
return _heChannel[chan].soundVars[var];
} else {
return 0;
@@ -411,8 +411,11 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
ptr += 8 + READ_BE_UINT32(ptr + 12);
}
- //if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel]) && _heChannel[heChannel].priority > priority)
- // return;
+ if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) {
+ int curSnd = _heChannel[heChannel].sound;
+ if (curSnd != 0 && curSnd != 1 && soundID != 1 && _heChannel[heChannel].priority > priority)
+ return;
+ }
int codeOffs = -1;
if (READ_UINT32(ptr) == MKID('SBNG')) {
@@ -442,7 +445,7 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
// Allocate a sound buffer, copy the data into it, and play
sound = (char *)malloc(size);
memcpy(sound, ptr + heOffset + 8, size);
- //_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
+ _vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
_vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID);
_vm->setHETimer(heChannel + 4);
@@ -471,9 +474,9 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
}
else {
- //if (_vm->_musicEngine) {
- // _vm->_musicEngine->startSound(soundID);
- //}
+ if (_vm->_musicEngine) {
+ _vm->_musicEngine->startSound(soundID);
+ }
}
free(mallocedPtr);