[Scummvm-cvs-logs] SF.net SVN: scummvm: [26279] scummvm/trunk/engines/scumm/he/script_v80he. cpp

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Mar 23 03:55:09 CET 2007


Revision: 26279
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26279&view=rev
Author:   kirben
Date:     2007-03-22 19:55:07 -0700 (Thu, 22 Mar 2007)

Log Message:
-----------
Change getFileSize opcode, to check for files via SaveFileManager too. Fixes loading the high score table in the mini game of SPY Fox 2.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/script_v80he.cpp

Modified: scummvm/trunk/engines/scumm/he/script_v80he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v80he.cpp	2007-03-22 22:29:00 UTC (rev 26278)
+++ scummvm/trunk/engines/scumm/he/script_v80he.cpp	2007-03-23 02:55:07 UTC (rev 26279)
@@ -25,6 +25,7 @@
 
 #include "common/config-file.h"
 #include "common/config-manager.h"
+#include "common/savefile.h"
 #include "common/str.h"
 
 #include "scumm/actor.h"
@@ -403,13 +404,20 @@
 	copyScriptString(filename, sizeof(filename));
 	convertFilePath(filename);
 
-	Common::File f;
-	if (!f.open((char *)filename)) {
+	Common::SeekableReadStream *f = _saveFileMan->openForLoading((const char *)filename);
+	if (!f) {
+		Common::File *file = new Common::File();
+		file->open((const char *)filename, Common::File::kFileReadMode);
+		f = file;
+	}
+
+	if (!f) {
 		push(-1);
 	} else {
-		push(f.size());
-		f.close();
+		push(f->size());
 	}
+
+	delete f;
 }
 
 void ScummEngine_v80he::o80_stringToInt() {


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