From 68b4873559f31bae2971c3d31c6fac7f1b1f4e1d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 6 Aug 2011 03:45:40 +0200 Subject: SCUMM: Properly reset midi channel voice mapping in CMS on new track. This fixes an ugly dead lock in some cases. --- engines/scumm/player_v2cms.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'engines/scumm') 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; -- cgit v1.2.3