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

sev- sev at scummvm.org
Tue Sep 27 19:10:34 CEST 2016


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

Summary:
37f4b36f7f FULLPIPE: Add support for loading from launcher
b783f0b528 FULLPIPE: Mark that the engine has simple save names
a687ae3daf FULLPIPE: Add support loading/saving from GMM


Commit: 37f4b36f7f0f855103962c169d9753df988c1c82
    https://github.com/scummvm/scummvm/commit/37f4b36f7f0f855103962c169d9753df988c1c82
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-27T18:29:05+02:00

Commit Message:
FULLPIPE: Add support for loading from launcher

Changed paths:
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/stateloader.cpp



diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index c2d4106..37c7699 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -275,9 +275,16 @@ Common::Error FullpipeEngine::run() {
 	if (ConfMan.hasKey("boot_param"))
 		scene = convertScene(ConfMan.getInt("boot_param"));
 
+	if (ConfMan.hasKey("save_slot"))
+		scene = -1;
+
 	if (!loadGam("fullpipe.gam", scene))
 		return Common::kNoGameDataFoundError;
 
+	if (ConfMan.hasKey("save_slot")) {
+		_gameLoader->readSavegame(getSavegameFile(ConfMan.getInt("save_slot")));
+	}
+
 #if 0
 	loadAllScenes();
 #endif
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 30c7bc8..78674d1 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -317,6 +317,9 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) {
 
 	setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));
 
+	if (scene == -1)
+		return true;
+
 	if (scene) {
 		_gameLoader->loadScene(726);
 		_gameLoader->gotoScene(726, TrubaLeft);


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

Commit Message:
FULLPIPE: Mark that the engine has simple save names

Changed paths:
    engines/fullpipe/detection.cpp



diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp
index 6f92f19..31645dd 100644
--- a/engines/fullpipe/detection.cpp
+++ b/engines/fullpipe/detection.cpp
@@ -102,7 +102,8 @@ bool FullpipeMetaEngine::hasFeature(MetaEngineFeature f) const {
 		(f == kSavesSupportMetaInfo) ||
 		(f == kSavesSupportThumbnail) ||
 		(f == kSavesSupportCreationDate) ||
-		(f == kSupportsLoadingDuringStartup);
+		(f == kSupportsLoadingDuringStartup) ||
+		(f == kSimpleSavesNames);
 }
 
 SaveStateList FullpipeMetaEngine::listSaves(const char *target) const {


Commit: a687ae3daf3210c9fb66a1981288caa387ff995a
    https://github.com/scummvm/scummvm/commit/a687ae3daf3210c9fb66a1981288caa387ff995a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-27T19:10:07+02:00

Commit Message:
FULLPIPE: Add support loading/saving from GMM

Changed paths:
    engines/fullpipe/detection.cpp
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/gameloader.h
    engines/fullpipe/stateloader.cpp
    engines/fullpipe/statesaver.cpp



diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp
index 31645dd..af2b0ca 100644
--- a/engines/fullpipe/detection.cpp
+++ b/engines/fullpipe/detection.cpp
@@ -106,6 +106,13 @@ bool FullpipeMetaEngine::hasFeature(MetaEngineFeature f) const {
 		(f == kSimpleSavesNames);
 }
 
+bool Fullpipe::FullpipeEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsLoadingDuringRuntime) ||
+		(f == kSupportsSavingDuringRuntime);
+}
+
 SaveStateList FullpipeMetaEngine::listSaves(const char *target) const {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 	Common::StringArray filenames;
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 37c7699..2c6fded 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -256,6 +256,20 @@ void FullpipeEngine::restartGame() {
 	}
 }
 
+Common::Error FullpipeEngine::loadGameState(int slot) {
+	if (_gameLoader->readSavegame(getSavegameFile(slot)))
+		return Common::kNoError;
+	else
+		return Common::kUnknownError;
+}
+Common::Error FullpipeEngine::saveGameState(int slot, const Common::String &description) {
+	if (_gameLoader->writeSavegame(_currentScene, getSavegameFile(slot)))
+		return Common::kNoError;
+	else
+		return Common::kUnknownError;
+}
+
+
 Common::Error FullpipeEngine::run() {
 	const Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0);
 	// Initialize backend
@@ -282,7 +296,7 @@ Common::Error FullpipeEngine::run() {
 		return Common::kNoGameDataFoundError;
 
 	if (ConfMan.hasKey("save_slot")) {
-		_gameLoader->readSavegame(getSavegameFile(ConfMan.getInt("save_slot")));
+		loadGameState(ConfMan.getInt("save_slot"));
 	}
 
 #if 0
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 09c9559..1b6e222 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -332,8 +332,12 @@ public:
 
 	bool _isSaveAllowed;
 
-	bool canLoadGameStateCurrently() { return _isSaveAllowed; }
-	bool canSaveGameStateCurrently() { return _isSaveAllowed; }
+	Common::Error loadGameState(int slot);
+	Common::Error saveGameState(int slot, const Common::String &description);
+
+	virtual bool canLoadGameStateCurrently() { return true; }
+	virtual bool canSaveGameStateCurrently() { return _isSaveAllowed; }
+	virtual bool hasFeature(EngineFeature f) const;
 
 };
 
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 9f99cb1..6c41e1b 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -112,8 +112,8 @@ class GameLoader : public CObject {
 	void saveScenePicAniInfos(int sceneId);
 	PicAniInfo **savePicAniInfos(Scene *sc, int flag1, int flag2, int *picAniInfoCount);
 
-	void readSavegame(const char *fname);
-	void writeSavegame(Scene *sc, const char *fname);
+	bool readSavegame(const char *fname);
+	bool writeSavegame(Scene *sc, const char *fname);
 
 	void addVar(GameVar *var, GameVar *subvar);
 
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 78674d1..f48d636 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -40,13 +40,13 @@
 
 namespace Fullpipe {
 
-void GameLoader::readSavegame(const char *fname) {
+bool GameLoader::readSavegame(const char *fname) {
 	SaveHeader header;
 	Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(fname);
 
 	if (!saveFile) {
 		warning("Cannot open save %s for loading", fname);
-		return;
+		return false;
 	}
 
 	header.version = saveFile->readUint32LE();
@@ -59,7 +59,7 @@ void GameLoader::readSavegame(const char *fname) {
 			header.version, header.magic, header.updateCounter, header.unkField, header.encSize, saveFile->pos());
 
 	if (header.version != 48)
-		return;
+		return false;
 
 	_updateCounter = header.updateCounter;
 
@@ -92,7 +92,7 @@ void GameLoader::readSavegame(const char *fname) {
 		if (!v) {
 			warning("No state to save");
 			delete archive;
-			return;
+			return false;
 		}
 	}
 
@@ -141,7 +141,7 @@ void GameLoader::readSavegame(const char *fname) {
 
 		if (_preloadCallback) {
 			if (!_preloadCallback(preloadItem, 0))
-				return;
+				return false;
 		}
 
 		clearGlobalMessageQueueList1();
@@ -165,6 +165,8 @@ void GameLoader::readSavegame(const char *fname) {
 
 		ex->postMessage();
 	}
+
+	return true;
 }
 
 void parseSavegameHeader(Fullpipe::FullpipeSavegameHeader &header, SaveStateDescriptor &desc) {
diff --git a/engines/fullpipe/statesaver.cpp b/engines/fullpipe/statesaver.cpp
index fb9163d..130ab62 100644
--- a/engines/fullpipe/statesaver.cpp
+++ b/engines/fullpipe/statesaver.cpp
@@ -31,7 +31,7 @@
 
 namespace Fullpipe {
 
-void GameLoader::writeSavegame(Scene *sc, const char *fname) {
+bool GameLoader::writeSavegame(Scene *sc, const char *fname) {
 	GameVar *v = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
 
 	if (!v) {
@@ -39,7 +39,7 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
 
 		if (!v) {
 			warning("No state to save");
-			return;
+			return false;
 		}
 	}
 
@@ -112,7 +112,7 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
 
 	if (!saveFile) {
 		warning("Cannot open file for writing: %s", fname);
-		return;
+		return false;
 	}
 
 	saveFile->writeUint32LE(header.version);
@@ -154,6 +154,8 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
 
 	delete saveFile;
 	delete archive;
+
+	return true;
 }
 
 





More information about the Scummvm-git-logs mailing list