diff options
| author | Filippos Karapetis | 2009-05-26 10:02:25 +0000 |
|---|---|---|
| committer | Filippos Karapetis | 2009-05-26 10:02:25 +0000 |
| commit | 780899fb0e0be87bd87386fc5f6aeffb4bc30c42 (patch) | |
| tree | 75c43c31d900466648eb8b0c99f012b39363c662 /engines/sci/engine | |
| parent | 9900cbcb70859741e1df6fd26064a82cbc303302 (diff) | |
| download | scummvm-rg350-780899fb0e0be87bd87386fc5f6aeffb4bc30c42.tar.gz scummvm-rg350-780899fb0e0be87bd87386fc5f6aeffb4bc30c42.tar.bz2 scummvm-rg350-780899fb0e0be87bd87386fc5f6aeffb4bc30c42.zip | |
Rewrote the Audio stream parser. The introduction of KQ6 should work more correctly now (apart from Cassima's speech)
svn-id: r40904
Diffstat (limited to 'engines/sci/engine')
| -rw-r--r-- | engines/sci/engine/ksound.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 1f7ece33c3..b6ac628a6b 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -1001,37 +1001,18 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) { int sampleLen = 0; if (!s->sound.audioResource) - s->sound.audioResource = new AudioResource(); + s->sound.audioResource = new AudioResource(s->resmgr, s->version); switch (UKPV(0)) { case kSci1AudioWPlay: case kSci1AudioPlay: { s->sound.audioResource->stop(); - Audio::AudioStream *audioStream = 0; - - // Try to load from an external patch file first - Sci::Resource* audioRes = s->resmgr->findResource(kResourceTypeAudio, UKPV(1), 1); - - if (s->_gameName == "KQ5") { - if (audioRes) { - audioStream = s->sound.audioResource->getAudioStreamKQ5CD(audioRes, &sampleLen); - } else { - // No patch file found, read it from the audio volume - audioStream = s->sound.audioResource->getAudioStreamKQ5CD(UKPV(1), &sampleLen); - } - } else if (s->_gameName == "Kq6") { - if (audioRes) { - audioStream = s->sound.audioResource->getAudioStreamKQ6Floppy(audioRes, &sampleLen); - } else { - // No patch file found, read it from the audio volume - audioStream = s->sound.audioResource->getAudioStreamKQ6Floppy(UKPV(1), &sampleLen); - } - } + Audio::AudioStream *audioStream = + audioStream = s->sound.audioResource->getAudioStream(UKPV(1), &sampleLen); if (audioStream) mixer->playInputStream(Audio::Mixer::kSpeechSoundType, s->sound.audioResource->getAudioHandle(), audioStream); - } return make_reg(0, sampleLen); // return sample length in ticks case kSci1AudioStop: |
