Fixed the demo version of Longbow - speech was not played at all with the new sound code

svn-id: r47610
This commit is contained in:
Filippos Karapetis 2010-01-27 21:11:24 +00:00
parent e81ddfcdcc
commit 76ff84a62f
2 changed files with 13 additions and 13 deletions

View file

@ -170,15 +170,15 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
int channelFilterMask = 0; int channelFilterMask = 0;
SoundResource::Track *track = pSnd->soundRes->getTrackByType(_pMidiDrv->getPlayId()); SoundResource::Track *track = pSnd->soundRes->getTrackByType(_pMidiDrv->getPlayId());
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
// try to use adlib's digital sample if possible if (_bMultiMidi && (!track || track->digitalChannelNr == -1)) {
if (_bMultiMidi && (track->digitalChannelNr == -1)) { SoundResource::Track *digital = pSnd->soundRes->getDigitalTrack();
SoundResource::Track *digital = pSnd->soundRes->getDigitalTrack(); if (digital)
if (digital) track = digital;
track = digital; }
}
if (track) {
// Play digital sample // Play digital sample
if (track->digitalChannelNr != -1) { if (track->digitalChannelNr != -1) {
byte *channelData = track->channels[track->digitalChannelNr].data; byte *channelData = track->channels[track->digitalChannelNr].data;

View file

@ -286,6 +286,11 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
#else #else
// Check if a track with the same sound object is already playing
MusicEntry *oldSound = _music->getSlot(obj);
if (oldSound)
cmdDisposeSound(obj, value);
MusicEntry *newSound = new MusicEntry(); MusicEntry *newSound = new MusicEntry();
newSound->resnum = number; newSound->resnum = number;
if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number))) if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number)))
@ -299,11 +304,6 @@ void SoundCommandParser::cmdInitSound(reg_t obj, int16 value) {
if (_soundVersion >= SCI_VERSION_1_LATE) if (_soundVersion >= SCI_VERSION_1_LATE)
newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX); newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX);
// Check if a track with the same sound object is already playing
MusicEntry *oldSound = _music->getSlot(obj);
if (oldSound)
cmdDisposeSound(obj, value);
// In SCI1.1 games, sound effects are started from here. If we can find // In SCI1.1 games, sound effects are started from here. If we can find
// a relevant audio resource, play it, otherwise switch to synthesized // a relevant audio resource, play it, otherwise switch to synthesized
// effects. If the resource exists, play it using map 65535 (sound // effects. If the resource exists, play it using map 65535 (sound