[Scummvm-cvs-logs] CVS: scummvm/saga saveload.cpp,1.29,1.30

Eugene Sandulenko sev at users.sourceforge.net
Sun Oct 16 10:22:54 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10635

Modified Files:
	saveload.cpp 
Log Message:
Store game title in savefile. Lets us not guess which game save is made for
as it is not possible to tell that by md5. Bumbed savegame version.


Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saveload.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- saveload.cpp	11 Oct 2005 17:39:31 -0000	1.29
+++ saveload.cpp	16 Oct 2005 17:19:52 -0000	1.30
@@ -39,7 +39,7 @@
 #include "saga/scene.h"
 #include "saga/script.h"
 
-#define CURRENT_SAGA_VER 4
+#define CURRENT_SAGA_VER 5
 
 namespace Saga {
 
@@ -158,8 +158,10 @@
 }
 
 
+#define TITLESIZE 80
 void SagaEngine::save(const char *fileName, const char *saveName) {
 	Common::OutSaveFile *out;
+	char title[TITLESIZE];
 
 	if (!(out = _saveFileMan->openForSaving(fileName))) {
 		return;
@@ -172,6 +174,11 @@
 
 	out->write(&_saveHeader, sizeof(_saveHeader));
 
+	// Original game title
+	memset(title, 0, TITLESIZE);
+	strncpy(title, getGameDescription()->title, TITLESIZE);
+	out->write(title, TITLESIZE);
+
 	// Surrounding scene
 	out->writeSint32LE(_scene->getOutsetSceneNumber());
 
@@ -203,6 +210,7 @@
 	int commonBufferSize;
 	int sceneNumber, insetSceneNumber;
 	int mapx, mapy;
+	char title[TITLESIZE];
 
 	if (!(in = _saveFileMan->openForLoading(fileName))) {
 		return;
@@ -220,6 +228,11 @@
 		error("SagaEngine::load wrong format");
 	}
 
+	if (_saveHeader.version > 4) {
+		in->read(title, TITLESIZE);
+		debug(2, "Save is for: %s", title);
+	}
+
 	// Surrounding scene
 	sceneNumber = in->readSint32LE();
 





More information about the Scummvm-git-logs mailing list