aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-06 03:45:40 +0200
committerJohannes Schickel2011-08-06 03:45:40 +0200
commit68b4873559f31bae2971c3d31c6fac7f1b1f4e1d (patch)
treec15caa9a49d8da254534f6476c37ab50a41c4ec2 /engines/scumm
parent70a694ce43524539b03f9142729b58f5efd47bf4 (diff)
downloadscummvm-rg350-68b4873559f31bae2971c3d31c6fac7f1b1f4e1d.tar.gz
scummvm-rg350-68b4873559f31bae2971c3d31c6fac7f1b1f4e1d.tar.bz2
scummvm-rg350-68b4873559f31bae2971c3d31c6fac7f1b1f4e1d.zip
SCUMM: Properly reset midi channel voice mapping in CMS on new track.
This fixes an ugly dead lock in some cases.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/player_v2cms.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp
index 9908ba5253..c31998e0cf 100644
--- a/engines/scumm/player_v2cms.cpp
+++ b/engines/scumm/player_v2cms.cpp
@@ -291,7 +291,8 @@ void Player_V2CMS::startSound(int nr) {
}
void Player_V2CMS::loadMidiData(byte *data, int sound) {
- memset(_midiChannelUse, 0, sizeof(byte)*16);
+ memset(_midiChannelUse, 0, sizeof(_midiChannelUse));
+ memset(_midiChannel, 0, sizeof(_midiChannel));
_tempo = data[7];
_looping = data[8];
@@ -340,12 +341,10 @@ void Player_V2CMS::loadMidiData(byte *data, int sound) {
}
}
- for (int i = 0, channel = 0; i < 8; ++i, channel += 2) {
+ for (int i = 0; i < 8; ++i) {
_cmsVoices[i].chanNumber = 0xFF;
_cmsVoices[i].curVolume = 0;
_cmsVoices[i].nextVoice = 0;
-
- _midiChannel[channel] = 0;
}
_midiDelay = 0;