From 97fc845a078293c1de1faf1ab72c98bd898e0d8b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 4 Jan 2010 18:24:58 +0000 Subject: SCI/new music code: Fixed the code that handles mixed Adlib/MIDI mode, and added better comments on what it actually does svn-id: r46981 --- engines/sci/sfx/music.cpp | 15 ++++++--------- engines/sci/sfx/music.h | 4 +++- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp index 6f28aa0718..30721f0531 100644 --- a/engines/sci/sfx/music.cpp +++ b/engines/sci/sfx/music.cpp @@ -307,20 +307,17 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_MT32); break; default: + // Should never occur + error("soundInitSnd: Unknown MIDI type"); break; } - // attempting to select default MT-32/Roland track - if (!track) - track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_MT32); if (track) { - // if MIDI device is selected but there is no digital track in sound resource + // If MIDI device is selected but there is no digital track in sound resource // try to use adlib's digital sample if possible - if (_midiType <= MD_MT32 && track->digitalChannelNr == -1 && _bMultiMidi) { - if (pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB)->digitalChannelNr != -1) - track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB); - } - // play digital sample + if (_bMultiMidi && pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB)->digitalChannelNr != -1) + track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB); + // Play digital sample if (track->digitalChannelNr != -1) { byte *channelData = track->channels[track->digitalChannelNr].data; delete pSnd->pStreamAud; diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h index 7f9bd413bc..0b7d880112 100644 --- a/engines/sci/sfx/music.h +++ b/engines/sci/sfx/music.h @@ -203,7 +203,9 @@ protected: MidiDriverType _midiType; uint32 _dwTempo; - bool _bMultiMidi; // use adlib's digital track if midi track don't have one + // Mixed Adlib/MIDI mode: when enabled from the ScummVM sound options screen, + // and a sound has a digital track, the sound from the Adlib track is played + bool _bMultiMidi; private: static void miditimerCallback(void *p); -- cgit v1.2.3