diff options
author | Gregory Montoir | 2007-05-20 11:48:53 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-05-20 11:48:53 +0000 |
commit | b37c83448aaeb9a88a6f88fb58d9dda6634ef5f4 (patch) | |
tree | e0f33d8a600637dca50e27d1a29da9cce42645e3 /engines | |
parent | 11f2d4052a9cfca3414fbaec514930123b434928 (diff) | |
download | scummvm-rg350-b37c83448aaeb9a88a6f88fb58d9dda6634ef5f4.tar.gz scummvm-rg350-b37c83448aaeb9a88a6f88fb58d9dda6634ef5f4.tar.bz2 scummvm-rg350-b37c83448aaeb9a88a6f88fb58d9dda6634ef5f4.zip |
made the resource loading function case insensitive to the filename and removed a NULL dereference if a file is not found
svn-id: r26885
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/part.cpp | 13 | ||||
-rw-r--r-- | engines/cine/part.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index f915fc3260..7ef81f5069 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -331,7 +331,7 @@ int16 findFileInBundle(const char *fileName) { if (g_cine->getGameType() == Cine::GType_OS) { for (i = 0; i < numElementInPart; i++) { - if (!strcmp(fileName, partBuffer[i].partName)) { + if (!scumm_stricmp(fileName, partBuffer[i].partName)) { return i; } } @@ -374,11 +374,11 @@ int16 findFileInBundle(const char *fileName) { bPtr = bundleNamesAtari; } - while (**bPtr) { + while (*bPtr) { loadPart(*bPtr); for (i = 0; i < numElementInPart; i++) { - if (!strcmp(fileName, partBuffer[i].partName)) { + if (!scumm_stricmp(fileName, partBuffer[i].partName)) { return i; } } @@ -386,7 +386,7 @@ int16 findFileInBundle(const char *fileName) { } } else { for (i = 0; i < numElementInPart; i++) { - if (!strcmp(fileName, partBuffer[i].partName)) { + if (!scumm_stricmp(fileName, partBuffer[i].partName)) { return i; } } @@ -420,7 +420,7 @@ byte *readBundleFile(int16 foundFileIdx) { return dataPtr; } -byte *readBundleSoundFile(const char *entryName) { +byte *readBundleSoundFile(const char *entryName, uint32 *size) { int16 index; byte *data = 0; char previousPartName[15] = ""; @@ -432,6 +432,9 @@ byte *readBundleSoundFile(const char *entryName) { index = findFileInBundle((const char *)entryName); if (index != -1) { data = readBundleFile(index); + if (size) { + *size = partBuffer[index].unpackedSize; + } } if (g_cine->getGameType() == Cine::GType_FW) { loadPart(previousPartName); diff --git a/engines/cine/part.h b/engines/cine/part.h index 657d00465c..b8abd7620c 100644 --- a/engines/cine/part.h +++ b/engines/cine/part.h @@ -65,7 +65,7 @@ int16 findFileInBundle(const char *fileName); void readFromPart(int16 idx, byte *dataPtr); byte *readBundleFile(int16 foundFileIdx); -byte *readBundleSoundFile(const char *entryName); +byte *readBundleSoundFile(const char *entryName, uint32 *size = 0); byte *readFile(const char *filename); void checkDataDisk(int16 param); |