[Scummvm-cvs-logs] SF.net SVN: scummvm: [26885] scummvm/trunk/engines/cine

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sun May 20 13:48:54 CEST 2007


Revision: 26885
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26885&view=rev
Author:   cyx
Date:     2007-05-20 04:48:53 -0700 (Sun, 20 May 2007)

Log Message:
-----------
made the resource loading function case insensitive to the filename and removed a NULL dereference if a file is not found

Modified Paths:
--------------
    scummvm/trunk/engines/cine/part.cpp
    scummvm/trunk/engines/cine/part.h

Modified: scummvm/trunk/engines/cine/part.cpp
===================================================================
--- scummvm/trunk/engines/cine/part.cpp	2007-05-20 08:30:43 UTC (rev 26884)
+++ scummvm/trunk/engines/cine/part.cpp	2007-05-20 11:48:53 UTC (rev 26885)
@@ -331,7 +331,7 @@
 
 	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 @@
 				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 @@
 		}
 	} 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 @@
 	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 @@
 	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);

Modified: scummvm/trunk/engines/cine/part.h
===================================================================
--- scummvm/trunk/engines/cine/part.h	2007-05-20 08:30:43 UTC (rev 26884)
+++ scummvm/trunk/engines/cine/part.h	2007-05-20 11:48:53 UTC (rev 26885)
@@ -65,7 +65,7 @@
 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);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list