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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Dec 19 22:52:36 CET 2006


Revision: 24892
          http://scummvm.svn.sourceforge.net/scummvm/?rev=24892&view=rev
Author:   fingolfin
Date:     2006-12-19 13:52:29 -0800 (Tue, 19 Dec 2006)

Log Message:
-----------
Added a comment to ScummEngine_v5::saveVars (we need to implement it for IQ support in Indy3), and fixed a memory leak in o5_saveLoadGame

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

Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp	2006-12-19 16:54:57 UTC (rev 24891)
+++ scummvm/trunk/engines/scumm/script_v5.cpp	2006-12-19 21:52:29 UTC (rev 24892)
@@ -868,6 +868,15 @@
 void ScummEngine_v5::saveVars() {
 	int a, b;
 
+	// FIXME: This opcode is currently a stub. It is needed for at least two things:
+	// * storing save game names in Indy 3 (and maybe others)
+	// * storing the global IQ (Indy Quotient) in Indy 3
+	// The former is not so important as we have our own save system, but the
+	// latter one of course is a desirable feature.
+	// So implementing this would be nice indeed. Not sure what the filename
+	// should be -- either base it on the target name, or base it on the gameid.
+	// Both approaches have their merits, though.
+
 	while ((_opcode = fetchScriptByte()) != 0) {
 		switch (_opcode & 0x1F) {
 		case 0x01: // write a range of variables
@@ -899,6 +908,8 @@
 void ScummEngine_v5::loadVars() {
 	int a, b;
 
+	// FIXME: See ScummEngine_v5::saveVars
+
 //	Common::hexdump(_scriptPointer, 64);
 	while ((_opcode = fetchScriptByte()) != 0) {
 		switch (_opcode & 0x1F) {
@@ -1153,14 +1164,16 @@
 			result = 2; // failed to save
 		break;
 	case 0xC0: // test if save exists
+		Common::InSaveFile *file;
 		bool avail_saves[100];
 		char filename[256];
 
 		listSavegames(avail_saves, ARRAYSIZE(avail_saves));
 		makeSavegameName(filename, slot, false);
-		if (avail_saves[slot] && (_saveFileMan->openForLoading(filename)))
+		if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename))) {
 			result = 6; // save file exists
-		else
+			delete file;
+		} else
 			result = 7; // save file does not exist
 		break;
 	default:


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