[Scummvm-cvs-logs] SF.net SVN: scummvm:[46437] tools/branches/gsoc2009-gui

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Dec 20 20:22:47 CET 2009


Revision: 46437
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46437&view=rev
Author:   sev
Date:     2009-12-20 19:22:47 +0000 (Sun, 20 Dec 2009)

Log Message:
-----------
Fix compress_saga tool

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/compress_saga.cpp
    tools/branches/gsoc2009-gui/compress_saga.h

Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp	2009-12-20 19:09:17 UTC (rev 46436)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp	2009-12-20 19:22:47 UTC (rev 46437)
@@ -65,7 +65,7 @@
 	{"voices.rsc",					false,		"c58e67c506af4ffa03fd0aac2079deb0", kSoundVOC,		-1,			false},	// Early DOS demo
 	{"voicesd.rsc",					false,		"e139d86bab2ee8ba3157337f894a92d4", kSoundVOX,		22050,		false},	// New PC demos and all Mac demos
 	// Unsupported (8 bit unsigned sound) - used in the early ITE Win32 demo
-	//{"voicesd.rsc",				false,		"0759eaf5b64ae19fd429920a70151ad3", kSoundPCM,		22050,			false},	// Old Win32 demo
+	//{"voicesd.rsc",				false,		"0759eaf5b64ae19fd429920a70151ad3", kSoundPCM,		22050,		false},	// Old Win32 demo
 	{"ite voices.bin",				true,		"dba92ae7d57e942250fe135609708369", kSoundMacPCM,	22050,		false}	// MacBinary
 	// TODO: Add known Amiga files
 };
@@ -127,17 +127,14 @@
 }
 
 InspectionMatch CompressSaga::inspectInput(const Filename &filename) {
-	if (filename.hasExtension("rsc") ||
-		filename.hasExtension("res") ||
-		filename.hasExtension("bin") ||
-		filename.getFullName() == "inherit the earth voices")
+	if (detectFile(&filename))
 		return IMATCH_PERFECT;
 	return IMATCH_AWFUL;
 }
 
 // --------------------------------------------------------------------------------
 
-bool CompressSaga::detectFile(Filename *infile) {
+bool CompressSaga::detectFile(const Filename *infile) {
 	int gamesCount = ARRAYSIZE(gameDescriptions);
 	int i, j;
 	uint8 md5sum[16];
@@ -432,30 +429,10 @@
 		outpath.setExtension(".cmp");
 	}
 
-	// ITE
-	inpath.setExtension(".rsc");
 	if (detectFile(&inpath)) {
 		sagaEncode(&inpath, &outpath);
 	} else {
-		// IHNM
-		inpath.setExtension(".res");
-		if (detectFile(&inpath)) {
-			sagaEncode(&inpath, &outpath);
-		} else {
-			// Check for "inherit the earth voices"
-			inpath.setFullName("inherit the earth voices");
-			if (detectFile(&inpath)) {
-				sagaEncode(&inpath, &outpath);
-			} else {
-				// Check for MacBinary
-				inpath.setExtension(".bin");
-				if (detectFile(&inpath)) {
-					sagaEncode(&inpath, &outpath);
-				} else {
-					error("Failed to compress file %s", inpath.getFullPath().c_str());
-				}
-			}
-		}
+		error("Failed to compress file %s", inpath.getFullPath().c_str());
 	}
 }
 

Modified: tools/branches/gsoc2009-gui/compress_saga.h
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.h	2009-12-20 19:09:17 UTC (rev 46436)
+++ tools/branches/gsoc2009-gui/compress_saga.h	2009-12-20 19:22:47 UTC (rev 46437)
@@ -75,7 +75,7 @@
 	uint8 _sampleBits;
 	uint8 _sampleStereo;
 
-	bool detectFile(Filename *infile);
+	bool detectFile(const Filename *infile);
 	uint32 copyFile(const char *fromFileName, File &outputFile);
 	void copyFile(File &inputFile, uint32 inputSize, const char *toFileName);
 	void writeBufferToFile(uint8 *data, uint32 inputSize, const char *toFileName);


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