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/cine/part.cpp | |
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/cine/part.cpp')
-rw-r--r-- | engines/cine/part.cpp | 13 |
1 files changed, 8 insertions, 5 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); |