[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.349,1.350 scumm.cpp,1.643,1.644 scumm.h,1.656,1.657

kirben kirben at users.sourceforge.net
Fri Nov 18 19:38:02 CET 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17622/scumm

Modified Files:
	resource.cpp scumm.cpp scumm.h 
Log Message:

Fix the bundled Macintosh version of FT demo.
Filename substitution should only be checked for resource files, not other data files.


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.349
retrieving revision 1.350
diff -u -d -r1.349 -r1.350
--- resource.cpp	5 Nov 2005 10:46:26 -0000	1.349
+++ resource.cpp	19 Nov 2005 03:37:34 -0000	1.350
@@ -230,7 +230,7 @@
 	}
 }
 
-bool ScummEngine::openFile(BaseScummFile &file, const char *filename) {
+bool ScummEngine::openFile(BaseScummFile &file, const char *filename, bool resourceFile) {
 	bool result = false;
 
 	if (!_containerFile.isEmpty()) {
@@ -245,27 +245,29 @@
 		// Some Mac demos (i.e. DOTT) have bundled file names different
 		// from target name. dottdemo.000 vs tentacle.000. So we should
 		// substitute those names too
-		if (_substResFileNameIndexBundle == 0) {
-			int substLastIndex = 0;
+		if (resourceFile == true) {
+			if (_substResFileNameIndexBundle == 0) {
+				int substLastIndex = 0;
 
-			while (substLastIndex != -1) {
-				if (file.openSubFile(name))
-					break;
+				while (substLastIndex != -1) {
+					if (file.openSubFile(name))
+						break;
 
-				substLastIndex = generateSubstResFileName(filename, name, sizeof(name), substLastIndex + 1);
-			}
+					substLastIndex = generateSubstResFileName(filename, name, sizeof(name), substLastIndex + 1);
+				}
 
-			if (substLastIndex == 0)
-				substLastIndex = -1;
+				if (substLastIndex == 0)
+					substLastIndex = -1;
 
-			_substResFileNameIndexBundle = substLastIndex;
+				_substResFileNameIndexBundle = substLastIndex;
 
-			if (substLastIndex != -1)
-				debug(5, "Generated substitute in Mac bundle: [%s -> %s]", filename, name);
-		}
+				if (substLastIndex != -1)
+					debug(5, "Generated substitute in Mac bundle: [%s -> %s]", filename, name);
+			}
 
-		if (_substResFileNameIndexBundle != -1)
-			generateSubstResFileName(filename, name, sizeof(name), _substResFileNameIndexBundle);
+			if (_substResFileNameIndexBundle != -1)
+				generateSubstResFileName(filename, name, sizeof(name), _substResFileNameIndexBundle);
+		}
 
 		result = file.openSubFile(name);
 	}
@@ -281,7 +283,7 @@
 bool ScummEngine::openResourceFile(const char *filename, byte encByte) {
 	debugC(DEBUG_GENERAL, "openResourceFile(%s)", filename);
 
-	if (openFile(*_fileHandle, filename)) {
+	if (openFile(*_fileHandle, filename, true)) {
 		_fileHandle->setEnc(encByte);
 		return true;
 	}

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.643
retrieving revision 1.644
diff -u -d -r1.643 -r1.644
--- scumm.cpp	18 Nov 2005 06:58:34 -0000	1.643
+++ scumm.cpp	19 Nov 2005 03:37:34 -0000	1.644
@@ -717,8 +717,6 @@
 	{ "ft.la0", "Full Throttle Demo Data", kGenAsIs },
 	{ "ft.la0", "Vollgas Data", kGenAsIs },
 	{ "ft.la0", "Vollgas Demo Data", kGenAsIs },
-	{ "ft.la0", "ft.000", kGenAsIs }, // Is this target used?
-	{ "ft.la0", "ftdemo.la0", kGenAsIs },
 	{ "ft", "ftdemo", kGenPC },
 #endif
 #ifndef DISABLE_HE

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.656
retrieving revision 1.657
diff -u -d -r1.656 -r1.657
--- scumm.h	10 Nov 2005 23:09:20 -0000	1.656
+++ scumm.h	19 Nov 2005 03:37:34 -0000	1.657
@@ -691,7 +691,7 @@
 	/** The name of the (macintosh/rescumm style) container file, if any. */
 	Common::String _containerFile;
 
-	bool openFile(BaseScummFile &file, const char *filename);
+	bool openFile(BaseScummFile &file, const char *filename, bool resourceFile = false);
 
 protected:
 	int _resourceHeaderSize;





More information about the Scummvm-git-logs mailing list