[Scummvm-cvs-logs] SF.net SVN: scummvm:[40724] scummvm/trunk/engines/sci

waltervn at users.sourceforge.net waltervn at users.sourceforge.net
Tue May 19 13:30:51 CEST 2009


Revision: 40724
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40724&view=rev
Author:   waltervn
Date:     2009-05-19 11:30:51 +0000 (Tue, 19 May 2009)

Log Message:
-----------
SCI: Changed K_FILEIO_FILE_EXISTS to check regular files too.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/vocab_debug.cpp

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-05-19 11:23:13 UTC (rev 40723)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-05-19 11:30:51 UTC (rev 40724)
@@ -836,17 +836,19 @@
 	}
 	case K_FILEIO_FILE_EXISTS : {
 		char *name = kernel_dereference_char_pointer(s, argv[1], 0);
-		// TODO: Transform the name given by the scripts to us, e.g. by
-		// prepending TARGET-
-		// TODO: We may have to also check for a regular file with the
-		// given name, using File::exists(). Really depends on *how*
-		// scripts use this opcode. Need more test data...
-		Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
-		bool exists = !saveFileMan->listSavefiles(name).empty();
 
-		s->r_acc = make_reg(0, exists);
-		debug(3, "K_FILEIO_FILE_EXISTS(%s) -> %d", name, s->r_acc.offset);
-		break;
+		// Check for regular file
+		bool exists = Common::File::exists(name);
+
+		if (!exists) {
+			// TODO: Transform the name given by the scripts to us, e.g. by
+			// prepending TARGET-
+			Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
+			exists = !saveFileMan->listSavefiles(name).empty();
+		}
+
+		debug(3, "K_FILEIO_FILE_EXISTS(%s) -> %d", name, exists);
+		return make_reg(0, exists);
 	}
 	default :
 		error("Unknown FileIO() sub-command: %d\n", func_nr);

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-05-19 11:23:13 UTC (rev 40723)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-05-19 11:30:51 UTC (rev 40724)
@@ -847,7 +847,7 @@
 	ResourceSource *psrcPatch;
 	bool bAdd;
 
-	for (int i = kResourceTypeView; i < kResourceTypeInvalid; i ++) {
+	for (int i = kResourceTypeView; i < kResourceTypeAudio36; i ++) {
 		files.clear();
 		szResType = getResourceTypeName((ResourceType)i);
 		// SCI0 naming - type.nnn

Modified: scummvm/trunk/engines/sci/vocab_debug.cpp
===================================================================
--- scummvm/trunk/engines/sci/vocab_debug.cpp	2009-05-19 11:23:13 UTC (rev 40723)
+++ scummvm/trunk/engines/sci/vocab_debug.cpp	2009-05-19 11:30:51 UTC (rev 40724)
@@ -285,7 +285,7 @@
 	/*0x82*/ "TextFonts",
 	/*0x83*/ "Record",
 	/*0x84*/ "PlayBack",
-	/*0x85*/ SCRIPT_UNKNOWN_FUNCTION_STRING,
+	/*0x85*/ "ShowMovie",
 	/*0x86*/ "SetVideoMode",
 	/*0x87*/ "SetQuitStr",
 	/*0x88*/ "DbugStr"


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