aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-04 18:24:58 +0000
committerFilippos Karapetis2010-01-04 18:24:58 +0000
commit97fc845a078293c1de1faf1ab72c98bd898e0d8b (patch)
treec8535ed7e85c63da15fa8936da26c904994dce6a /engines/sci
parent89e18f5f1207caa3a2dcc827da0ae0e7f6c577cf (diff)
downloadscummvm-rg350-97fc845a078293c1de1faf1ab72c98bd898e0d8b.tar.gz
scummvm-rg350-97fc845a078293c1de1faf1ab72c98bd898e0d8b.tar.bz2
scummvm-rg350-97fc845a078293c1de1faf1ab72c98bd898e0d8b.zip
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
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sfx/music.cpp15
-rw-r--r--engines/sci/sfx/music.h4
2 files changed, 9 insertions, 10 deletions
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);