[Scummvm-cvs-logs] SF.net SVN: scummvm:[39436] scummvm/trunk/engines/scumm/script_v5.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Mar 16 04:55:09 CET 2009


Revision: 39436
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39436&view=rev
Author:   fingolfin
Date:     2009-03-16 03:55:09 +0000 (Mon, 16 Mar 2009)

Log Message:
-----------
SCUMM: Modified version of patch #2674880 (FOA: unique filename for IQ-points file)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/script_v5.cpp

Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp	2009-03-16 00:07:12 UTC (rev 39435)
+++ scummvm/trunk/engines/scumm/script_v5.cpp	2009-03-16 03:55:09 UTC (rev 39436)
@@ -2059,15 +2059,20 @@
 
 	case 13:	// SO_SAVE_STRING
 		{
-			Common::OutSaveFile *file;
-			char filename[256], *s;
+			Common::String filename;
+			char chr;
 
 			a = getVarOrDirectByte(PARAM_1);
-			s = filename;
-			while ((*s++ = fetchScriptByte()))
-				;
+			while ((chr = fetchScriptByte()))
+				filename += chr;
 
-			file = _saveFileMan->openForSaving(filename);
+			if (filename.hasPrefix("iq-")) {
+				filename = _targetName + ".iq";
+			} else {
+				error("SO_SAVE_STRING: Unsupported filename %s\n", filename.c_str());
+			}
+
+			Common::OutSaveFile *file = _saveFileMan->openForSaving(filename.c_str());
 			if (file != NULL) {
 				byte *ptr;
 				ptr = getResourceAddress(rtString, a);
@@ -2079,15 +2084,20 @@
 		}
 	case 14:	// SO_LOAD_STRING
 		{
-			Common::InSaveFile *file;
-			char filename[256], *s;
+			Common::String filename;
+			char chr;
 
 			a = getVarOrDirectByte(PARAM_1);
-			s = filename;
-			while ((*s++ = fetchScriptByte()))
-				;
+			while ((chr = fetchScriptByte()))
+				filename += chr;
 
-			file = _saveFileMan->openForLoading(filename);
+			if (filename.hasPrefix("iq-")) {
+				filename = _targetName + ".iq";
+			} else {
+				error("SO_SAVE_STRING: Unsupported filename %s\n", filename.c_str());
+			}
+
+			Common::InSaveFile *file = _saveFileMan->openForLoading(filename.c_str());
 			if (file != NULL) {
 				byte *ptr;
 				int len = 256, cnt = 0;


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