[Scummvm-cvs-logs] SF.net SVN: scummvm:[33487] tools/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Aug 1 12:12:02 CEST 2008


Revision: 33487
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33487&view=rev
Author:   lordhoto
Date:     2008-08-01 10:12:02 +0000 (Fri, 01 Aug 2008)

Log Message:
-----------
Fixed extract_kyra and compress_kyra for PAK files with multiple file entries for one file.

Modified Paths:
--------------
    tools/trunk/compress_kyra.cpp
    tools/trunk/kyra_pak.cpp

Modified: tools/trunk/compress_kyra.cpp
===================================================================
--- tools/trunk/compress_kyra.cpp	2008-08-01 08:55:21 UTC (rev 33486)
+++ tools/trunk/compress_kyra.cpp	2008-08-01 10:12:02 UTC (rev 33487)
@@ -166,7 +166,7 @@
 			continue;
 
 		if (list->data[26] != 1) {
-			warning("broken VOC file '%s' skipping it...", list->filename);
+			warning("'%s' contains broken VOC file '%s' skipping it...", infile, list->filename);
 			continue;
 		}
 

Modified: tools/trunk/kyra_pak.cpp
===================================================================
--- tools/trunk/kyra_pak.cpp	2008-08-01 08:55:21 UTC (rev 33486)
+++ tools/trunk/kyra_pak.cpp	2008-08-01 10:12:02 UTC (rev 33487)
@@ -218,6 +218,17 @@
 
 bool PAKFile::addFile(const char *name, uint8 *data, uint32 size) {
 	if ((_fileList && _fileList->findEntry(name)) || (_links && _links->findSrcEntry(name))) {
+		uint32 origSize = 0;
+		const uint8 *fileData = getFileData(name, &origSize);
+
+		if (size != origSize) {
+			error("entry '%s' already exists");
+			return false;
+		}
+		
+		if (memcmp(fileData, data, size) == 0)
+			return true;
+
 		error("entry '%s' already exists");
 		return false;
 	}


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