[Scummvm-cvs-logs] SF.net SVN: scummvm: [28306] scummvm/trunk/engines/kyra/resource.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jul 29 19:21:21 CEST 2007


Revision: 28306
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28306&view=rev
Author:   lordhoto
Date:     2007-07-29 10:21:21 -0700 (Sun, 29 Jul 2007)

Log Message:
-----------
Fixed bug in Resource::getFileHandle.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.cpp

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2007-07-29 17:19:15 UTC (rev 28305)
+++ scummvm/trunk/engines/kyra/resource.cpp	2007-07-29 17:21:21 UTC (rev 28306)
@@ -220,8 +220,11 @@
 bool Resource::getFileHandle(const char *file, uint32 *size, Common::File &filehandle) {
 	filehandle.close();
 
-	if (filehandle.open(file))
+	if (filehandle.open(file)) {
+		if (size)
+			*size = filehandle.size();
 		return true;
+	}
 
 	uint fileHash = Common::hashit_lower(file);
 	for (ResIterator start = _pakfiles.begin() ;start != _pakfiles.end(); ++start) {
@@ -229,12 +232,14 @@
 			continue;
 
 		if ((*start)->getFileHandle(fileHash, filehandle)) {
-
-			*size = (*start)->getFileSize(fileHash);
+			uint32 tSize = (*start)->getFileSize(fileHash);
 		
-			if (!(*size))
+			if (!tSize)
 				continue;
 
+			if (size)
+				*size = tSize;
+
 			return true;
 		}
 	}


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