aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-01-14 04:29:30 +0000
committerTravis Howell2006-01-14 04:29:30 +0000
commit97a3e7c06d8bc4e9a4d2001bfda1378a18e9e884 (patch)
tree702b3c352c58034ed46e1ae29699318a495e2de6
parent68dfd5b4787d568a263ed1ff449233e6b8477179 (diff)
downloadscummvm-rg350-97a3e7c06d8bc4e9a4d2001bfda1378a18e9e884.tar.gz
scummvm-rg350-97a3e7c06d8bc4e9a4d2001bfda1378a18e9e884.tar.bz2
scummvm-rg350-97a3e7c06d8bc4e9a4d2001bfda1378a18e9e884.zip
A few fixes for sound opcodes in HE games.
svn-id: r20010
-rw-r--r--scumm/sound.cpp3
-rw-r--r--scumm/sound_he.cpp8
2 files changed, 9 insertions, 2 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 1757f24f02..3542df7203 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -767,6 +767,9 @@ bool Sound::isSoundInUse(int sound) const {
if (_vm->_imuse)
return _vm->_imuse->get_sound_active(sound);
+ if (_vm->_mixer->isSoundIDActive(sound))
+ return 1;
+
return false;
}
diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp
index 8c2464300a..fcd6df4cf8 100644
--- a/scumm/sound_he.cpp
+++ b/scumm/sound_he.cpp
@@ -87,7 +87,11 @@ int Sound::getSoundPriority(int sound) {
}
int Sound::getSoundVar(int sound, int var) {
- checkRange(26, 0, var, "Illegal sound variable %d");
+ if (_vm->_heversion >= 90 && var == 26) {
+ return isSoundCodeUsed(sound);
+ }
+
+ checkRange(25, 0, var, "Illegal sound variable %d");
int chan = -1;
for (int i = 0; i < ARRAYSIZE(_heChannel); i ++) {
@@ -104,7 +108,7 @@ int Sound::getSoundVar(int sound, int var) {
}
void Sound::setSoundVar(int sound, int var, int val) {
- checkRange(26, 0, var, "Illegal sound variable %d");
+ checkRange(25, 0, var, "Illegal sound variable %d");
int chan = -1;
for (int i = 0; i < ARRAYSIZE(_heChannel); i ++) {