[Scummvm-git-logs] scummvm master -> c9dfcea6800765dbde4d2db87212c5238b086310

sev- sev at scummvm.org
Fri Sep 16 18:10:17 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
58ec4473f1 FULLPIPE: Started game saving code
c9dfcea680 I18N: Regenerated translations.dat


Commit: 58ec4473f1a70e5b10f7e19465e083dc8f2976d3
    https://github.com/scummvm/scummvm/commit/58ec4473f1a70e5b10f7e19465e083dc8f2976d3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-16T18:09:00+02:00

Commit Message:
FULLPIPE: Started game saving code

Changed paths:
    engines/fullpipe/gameloader.cpp



diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index e49e56d..0c5fe92 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -602,8 +602,102 @@ void GameLoader::readSavegame(const char *fname) {
 	warning("STUB: readSavegame(%s)", fname);
 }
 
+struct SaveHeader {
+	int32 saveSize;
+	char magic[32];
+	int32 updateCounter;
+	int32 unkField;
+	int32 encSize;
+};
+
 void GameLoader::writeSavegame(Scene *sc, const char *fname) {
-	warning("STUB: writeSavegame(sc, %s)", fname);
+	GameVar *v = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
+
+	if (!v) {
+//		v = _gameVar->getSubVarByName("OBJSTATES")->getSubVarAsInt("SAVEGAME", 0);
+
+		if (!v) {
+			warning("No state to save");
+			return;
+		}
+	}
+
+	SaveHeader header;
+
+	v->setSubVarAsInt("Scene", sc->_sceneId);
+
+#if 0
+	saveScenePicAniInfos(this, sc->_sceneId);
+	memset(&header, 0, sizeof(header));
+
+	header.saveSize = 48;
+	strcpy(header.magic, "FullPipe Savegame");
+	header.updateCounter = _updateCounter;
+	header.unkField = 1;
+
+	// open save for reading
+	v = _gameVar->getSubVarByName("OBJSTATES");
+
+	MfcArchive archive;
+
+	sca = 0;
+	filenamea = 0;
+	if (v) {
+		v12 = v11->_nextVarObj;
+		v13 = (char *)v11->prevVarObj;
+		v9 = v11->parentVarObj;
+		v11->parentVarObj = 0;
+		sca = (Scene *)v12;
+		v11->_nextVarObj = 0;
+		filenamea = v13;
+		v11->prevVarObj = 0;
+	}
+
+	carchive->writeObject(v);
+	if (v11) {
+		v11->parentVarObj = v9;
+		v11->_nextVarObj = (GameVar *)sca;
+		v11->prevVarObj = (GameVar *)filenamea;
+	}
+	v14 = getGameLoaderInventory();
+	Inventory2_SerializePartially(v14, &carchive);
+	v15 = this->_sc2array.objs.m_nSize;
+	if  (unsigned int)(carchive.m_lpBufCur + 4) > carchive.m_lpBufMax)
+		CArchive::Flush(&carchive);
+	*(_DWORD *)carchive.m_lpBufCur = v15;
+	v16 = 0;
+	carchive.m_lpBufCur += 4;
+	while (1) {
+		scb = (Scene *)v16;
+		if ( v16 >= this->_sc2array.objs.m_nSize )
+			break;
+		v17 = v16;
+		v18 = this->_sc2array.objs.m_pData[v16].picAniInfosCount;
+		if ( (unsigned int)(carchive.m_lpBufCur + 4) > carchive.m_lpBufMax ) {
+			CArchive::Flush(&carchive);
+			v16 = (int)scb;
+		}
+		*(_DWORD *)carchive.m_lpBufCur = v18;
+		v19 = &this->_sc2array.objs.m_pData[v17];
+		carchive.m_lpBufCur += 4;
+		v20 = v19->picAniInfosCount;
+		if ( v20 > 0 ) {
+			CArchive::Write(&carchive, v19->picAniInfos, 44 * v20);
+			v16 = (int)scb;
+		}
+		++v16;
+	}
+	CArchive::Close(&carchive);
+	header.encSize = GameLoader_encryptSavegame((GameLoader *)header.unkField, (int)&cmemfile);
+	CFile::Write((int)&cfile, (int)&header, header.saveSize);
+	v21 = (void *)CMemFile::Detach(&cmemfile);
+	CFile::Write((int)&cfile, (int)v21, header.encSize);
+	free(v21);
+	v22 = (void (__fastcall *)(char *, signed int))this->_readSavegameCallback;
+	if ( v22 )
+		v22(&cfile, 1);
+	CFile::Close(&cfile);
+#endif
 }
 
 Sc2::Sc2() {


Commit: c9dfcea6800765dbde4d2db87212c5238b086310
    https://github.com/scummvm/scummvm/commit/c9dfcea6800765dbde4d2db87212c5238b086310
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-16T18:09:52+02:00

Commit Message:
I18N: Regenerated translations.dat

Changed paths:
    gui/themes/translations.dat



diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 49e03a0..55c01c0 100644
Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ





More information about the Scummvm-git-logs mailing list