[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.339.2.6,1.339.2.7 scumm.h,1.647.2.9,1.647.2.10

kirben kirben at users.sourceforge.net
Wed Dec 21 04:40:00 CET 2005


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

Modified Files:
      Tag: branch-0-8-0
	resource.cpp scumm.h 
Log Message:

Backport fix for bundled Macintosh version of FT demo.


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.339.2.6
retrieving revision 1.339.2.7
diff -u -d -r1.339.2.6 -r1.339.2.7
--- resource.cpp	22 Oct 2005 10:53:16 -0000	1.339.2.6
+++ resource.cpp	21 Dec 2005 12:38:53 -0000	1.339.2.7
@@ -222,7 +222,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()) {
@@ -237,27 +237,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);
 	}
@@ -273,7 +275,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.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.647.2.9
retrieving revision 1.647.2.10
diff -u -d -r1.647.2.9 -r1.647.2.10
--- scumm.h	21 Dec 2005 12:30:58 -0000	1.647.2.9
+++ scumm.h	21 Dec 2005 12:38:53 -0000	1.647.2.10
@@ -690,7 +690,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