FULLPIPE: Proper implementation of FullpipeEngine::playSound()

This commit is contained in:
Eugene Sandulenko 2014-04-26 15:06:23 +03:00
parent ba14a54d79
commit 2f10c8ec55

View File

@ -266,13 +266,20 @@ void FullpipeEngine::toggleMute() {
}
void FullpipeEngine::playSound(int id, int flag) {
SoundList *soundList = _currentScene->_soundList;
Sound *sound = soundList->getSoundById(id);
Sound *sound = 0;
for (int i = 0; i < _currSoundListCount; i++) {
sound = _currSoundList1[i]->getSoundById(id);
if (sound)
break;
}
if (!sound) {
warning("playSound: Can't find sound with ID %d", id);
return;
}
byte *soundData = sound->loadData();
Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, sound->getDataSize());
Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES);