diff options
author | James Brown | 2002-12-27 12:10:22 +0000 |
---|---|---|
committer | James Brown | 2002-12-27 12:10:22 +0000 |
commit | 540667567e76298ab52467a03bc5e821ce2fb33f (patch) | |
tree | 67757bc64ce7de4a9b11b379c95d67fac2e63f19 | |
parent | c21bd9015aa51792f531922a0ab8c839f99e8594 (diff) | |
download | scummvm-rg350-540667567e76298ab52467a03bc5e821ce2fb33f.tar.gz scummvm-rg350-540667567e76298ab52467a03bc5e821ce2fb33f.tar.bz2 scummvm-rg350-540667567e76298ab52467a03bc5e821ce2fb33f.zip |
Voice sample support, again missing a required codec
svn-id: r6195
-rw-r--r-- | scumm/bundle.cpp | 11 | ||||
-rw-r--r-- | scumm/bundle.h | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp index 001f9dbd05..cbe5913e55 100644 --- a/scumm/bundle.cpp +++ b/scumm/bundle.cpp @@ -204,8 +204,14 @@ int32 Bundle::decompressMusicSampleByIndex(int32 index, int32 number, byte *comp return final_size; } -int32 Bundle::decompressVoiceSampleByName(char *name, byte *comp_final) { +int32 Bundle::decompressVoiceSampleByName(char *name, byte *comp_final, bool use_extended) { int32 final_size = 0, i; + char realName[255]; + + if (use_extended) + sprintf(realName, "%s.IMX", name); + else + strcpy(realName, name); if (_voiceFile.isOpen() == false) { warning("Bundle: voice file is not open!"); @@ -213,11 +219,12 @@ int32 Bundle::decompressVoiceSampleByName(char *name, byte *comp_final) { } for (i = 0; i < _numVoiceFiles; i++) { - if (!scumm_stricmp(name, _bundleVoiceTable[i].filename)) { + if (!scumm_stricmp(realName, _bundleVoiceTable[i].filename)) { final_size = decompressVoiceSampleByIndex(i, comp_final); return final_size; } } + printf("Failed finding voice %s\n", realName); return final_size; } diff --git a/scumm/bundle.h b/scumm/bundle.h index 74984fc883..4b5e2c160a 100644 --- a/scumm/bundle.h +++ b/scumm/bundle.h @@ -58,7 +58,7 @@ public: bool openVoiceFile(const char *filename, const char *directory); bool openMusicFile(const char *filename, const char *directory); - int32 decompressVoiceSampleByName(char *name, byte *comp_final); + int32 decompressVoiceSampleByName(char *name, byte *comp_final, bool use_extended=false); int32 decompressVoiceSampleByIndex(int32 index, byte *comp_final); int32 decompressMusicSampleByName(char *name, int32 number, byte *comp_final, bool fuzzy=false); int32 decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final); diff --git a/scumm/sound.cpp b/scumm/sound.cpp index d12e1bfd4d..c14269ddd7 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1128,7 +1128,7 @@ int Sound::playBundleSound(char *sound) { } ptr = (byte *)malloc(1000000); - if (_scumm->_bundle->decompressVoiceSampleByName(sound, ptr) == 0) { + if (_scumm->_bundle->decompressVoiceSampleByName(sound, ptr, (_scumm->_gameId == GID_CMI)) == 0) { delete ptr; return -1; } |