aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorGregory Montoir2007-02-25 19:15:00 +0000
committerGregory Montoir2007-02-25 19:15:00 +0000
commitf68105912af1337a5ffe96be2e44adedceeb0ca1 (patch)
tree33f2630a489cb3c7a1cb315f8d1074928c263aee /engines/scumm
parent4af53c56e91c41fbbb117312c0a2087f728e45a9 (diff)
downloadscummvm-rg350-f68105912af1337a5ffe96be2e44adedceeb0ca1.tar.gz
scummvm-rg350-f68105912af1337a5ffe96be2e44adedceeb0ca1.tar.bz2
scummvm-rg350-f68105912af1337a5ffe96be2e44adedceeb0ca1.zip
fixed background music in catalog_cup_demo_de : only stop sfx if it was started in a previous block
svn-id: r25863
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/he/cup_player_he.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index f2e181fb41..d0691e3869 100644
--- a/engines/scumm/he/cup_player_he.cpp
+++ b/engines/scumm/he/cup_player_he.cpp
@@ -128,6 +128,7 @@ void CUP_Player::updateScreen() {
}
void CUP_Player::updateSfx() {
+ int lastSfxChannel = _lastSfxChannel;
for (int i = 0; i < _sfxQueuePos; ++i) {
const CUP_Sfx *sfx = &_sfxQueue[i];
if (sfx->num == -1) {
@@ -148,7 +149,7 @@ void CUP_Player::updateSfx() {
CUP_SfxChannel *sfxChannel = 0;
for (int ch = 0; ch < kSfxChannels; ++ch) {
if (!_mixer->isSoundHandleActive(_sfxChannels[ch].handle)) {
- _lastSfxChannel = ch;
+ lastSfxChannel = ch;
sfxChannel = &_sfxChannels[ch];
sfxChannel->sfxNum = sfx->num;
sfxChannel->flags = sfx->flags;
@@ -156,7 +157,7 @@ void CUP_Player::updateSfx() {
}
}
if (sfxChannel) {
- debug(1, "Start sound %d channel %d flags 0x%X", sfx->num, _lastSfxChannel, sfx->flags);
+ debug(1, "Start sound %d channel %d flags 0x%X", sfx->num, lastSfxChannel, sfx->flags);
int sfxIndex = sfxChannel->sfxNum - 1;
assert(sfxIndex >= 0 && sfxIndex < _sfxCount);
uint32 offset = READ_LE_UINT32(_sfxBuffer + sfxIndex * 4) - 8;
@@ -175,6 +176,7 @@ void CUP_Player::updateSfx() {
warning("Unable to find a free channel to play sound %d", sfx->num);
}
}
+ _lastSfxChannel = lastSfxChannel;
_sfxQueuePos = 0;
}