aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/bundle.cpp11
-rw-r--r--scumm/bundle.h2
-rw-r--r--scumm/sound.cpp2
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;
}