aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/sound_he.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-06-05 00:57:58 +0000
committerTravis Howell2009-06-05 00:57:58 +0000
commitde348d6fa8bf41ad30f2b85357cd4d20ad64f3e9 (patch)
tree75d5c0c686ffb28c488de53b2b4a9b9ad4adbda4 /engines/scumm/he/sound_he.cpp
parent8e987c80d1d66815687c8aac0efdc5543e2b697a (diff)
downloadscummvm-rg350-de348d6fa8bf41ad30f2b85357cd4d20ad64f3e9.tar.gz
scummvm-rg350-de348d6fa8bf41ad30f2b85357cd4d20ad64f3e9.tar.bz2
scummvm-rg350-de348d6fa8bf41ad30f2b85357cd4d20ad64f3e9.zip
Update sound code in HE80+ games, for sound rate differences.
svn-id: r41185
Diffstat (limited to 'engines/scumm/he/sound_he.cpp')
-rw-r--r--engines/scumm/he/sound_he.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index c5a8988edb..67248f4c22 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -158,6 +158,7 @@ void SoundHE::stopSound(int sound) {
if (_heChannel[i].sound == sound) {
_heChannel[i].sound = 0;
_heChannel[i].priority = 0;
+ _heChannel[i].rate = 0;
_heChannel[i].timer = 0;
_heChannel[i].sbngBlock = 0;
_heChannel[i].codeOffs = 0;
@@ -196,6 +197,7 @@ void SoundHE::stopSoundChannel(int chan) {
_heChannel[chan].sound = 0;
_heChannel[chan].priority = 0;
+ _heChannel[chan].rate = 0;
_heChannel[chan].timer = 0;
_heChannel[chan].sbngBlock = 0;
_heChannel[chan].codeOffs = 0;
@@ -254,7 +256,7 @@ int SoundHE::getSoundPos(int sound) {
}
if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) {
- int time = _vm->getHETimer(chan + 4) * 11025 / 1000;
+ int time = _vm->getHETimer(chan + 4) * _heChannel[chan].rate / 1000;
return time;
} else {
return 0;
@@ -360,7 +362,7 @@ void SoundHE::processSoundCode() {
continue;
}
- tmr = _vm->getHETimer(chan + 4) * 11025 / 1000;
+ tmr = _vm->getHETimer(chan + 4) * _heChannel[chan].rate / 1000;
tmr += _vm->VAR(_vm->VAR_SOUNDCODE_TMR);
if (tmr < 0)
tmr = 0;
@@ -407,6 +409,7 @@ void SoundHE::processSoundCode() {
_heChannel[chan].sound = 0;
_heChannel[chan].priority = 0;
+ _heChannel[chan].rate = 0;
_heChannel[chan].timer = 0;
_heChannel[chan].sbngBlock = 0;
_heChannel[chan].codeOffs = 0;
@@ -625,6 +628,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
_vm->setHETimer(heChannel + 4);
_heChannel[heChannel].sound = soundID;
_heChannel[heChannel].priority = priority;
+ _heChannel[heChannel].rate = rate;
_heChannel[heChannel].sbngBlock = (codeOffs != -1) ? 1 : 0;
_heChannel[heChannel].codeOffs = codeOffs;
memset(_heChannel[heChannel].soundVars, 0, sizeof(_heChannel[heChannel].soundVars));
@@ -646,6 +650,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
size *= 2; // 16bits.
delete voxStream;
+ _heChannel[heChannel].rate = rate;
if (_heChannel[heChannel].timer)
_heChannel[heChannel].timer = size * 1000 / rate;
@@ -696,6 +701,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags)
_vm->setHETimer(heChannel + 4);
_heChannel[heChannel].sound = soundID;
_heChannel[heChannel].priority = priority;
+ _heChannel[heChannel].rate = rate;
_heChannel[heChannel].sbngBlock = (codeOffs != -1) ? 1 : 0;
_heChannel[heChannel].codeOffs = codeOffs;
memset(_heChannel[heChannel].soundVars, 0, sizeof(_heChannel[heChannel].soundVars));