[Scummvm-cvs-logs] SF.net SVN: scummvm:[33292] scummvm/branches/gsoc2008-rtl/engines/ parallaction

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Fri Jul 25 23:24:09 CEST 2008


Revision: 33292
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33292&view=rev
Author:   cpage88
Date:     2008-07-25 21:24:09 +0000 (Fri, 25 Jul 2008)

Log Message:
-----------
Added --list-saves support for PARALLACTION, and -x support for NipponSafes

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h
    scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp	2008-07-25 19:41:17 UTC (rev 33291)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp	2008-07-25 21:24:09 UTC (rev 33292)
@@ -212,6 +212,7 @@
 	}
 
 	virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
+	virtual SaveStateList listSaves(const char *target) const;
 };
 
 bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
@@ -233,6 +234,34 @@
 	return res;
 }
 
+SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringList filenames;
+	char saveDesc[200];
+	Common::String pattern = target;
+	pattern += ".0??";
+
+	filenames = saveFileMan->listSavefiles(pattern.c_str());
+	sort(filenames.begin(), filenames.end());	// Sort (hopefully ensuring we are sorted numerically..)
+
+	SaveStateList saveList;
+	for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+		// Obtain the last 2 digits of the filename, since they correspond to the save slot
+		int slotNum = atoi(file->c_str() + file->size() - 2);
+		
+		if (slotNum >= 0 && slotNum <= 99) {
+			Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
+			if (in) {
+				in->readLine(saveDesc, 199);
+				saveList.push_back(SaveStateDescriptor(slotNum, saveDesc, *file));
+				delete in;
+			}
+		}
+	}
+
+	return saveList;
+}
+
 #if PLUGIN_ENABLED_DYNAMIC(PARALLACTION)
 	REGISTER_PLUGIN_DYNAMIC(PARALLACTION, PLUGIN_TYPE_ENGINE, ParallactionMetaEngine);
 #else

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp	2008-07-25 19:41:17 UTC (rev 33291)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.cpp	2008-07-25 21:24:09 UTC (rev 33292)
@@ -114,6 +114,7 @@
 	_location._hasSound = false;
 	_baseTime = 0;
 	_numLocations = 0;
+	_gameToLoad = -1;
 	_location._startPosition.x = -1000;
 	_location._startPosition.y = -1000;
 	_location._startFrame = 0;

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h	2008-07-25 19:41:17 UTC (rev 33291)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction.h	2008-07-25 21:24:09 UTC (rev 33292)
@@ -345,6 +345,7 @@
 	uint32		_baseTime;
 	char		_characterName1[50];	// only used in changeCharacter
 
+	int		_gameToLoad;
 	Common::String	_saveFileName;
 
 

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp	2008-07-25 19:41:17 UTC (rev 33291)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/parallaction_ns.cpp	2008-07-25 21:24:09 UTC (rev 33292)
@@ -240,8 +240,22 @@
 
 	_globalTable = _disk->loadTable("global");
 
-	guiStart();
+	// If requested, load a savegame instead of showing the intro
+	if (ConfMan.hasKey("save_slot")) {
+		_gameToLoad = ConfMan.getInt("save_slot");
+		if (_gameToLoad < 0 || _gameToLoad > 99)
+			_gameToLoad = -1;
+	}
+	if (_gameToLoad == -1) {
+		guiStart();
+	} else { 
+		_disk->selectArchive((getFeatures() & GF_DEMO) ? "disk0" : "disk1");
+		_language = guiChooseLanguage();
+		_disk->setLanguage(_language);
+		doLoadGame(_gameToLoad);
+	}
 
+
 	if (quit())
 		return _eventMan->shouldRTL();
 


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