[Scummvm-cvs-logs] scummvm master -> 3977a7ffa15d1db55d787b450307ef1c62fcda26

bluegr bluegr at gmail.com
Sun Dec 27 22:23:33 CET 2015


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

Summary:
3977a7ffa1 LAB: Add support for saving and loading games from the GMM


Commit: 3977a7ffa15d1db55d787b450307ef1c62fcda26
    https://github.com/scummvm/scummvm/commit/3977a7ffa15d1db55d787b450307ef1c62fcda26
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-27T23:22:54+02:00

Commit Message:
LAB: Add support for saving and loading games from the GMM

Changed paths:
    engines/lab/anim.h
    engines/lab/detection.cpp
    engines/lab/engine.cpp
    engines/lab/lab.cpp
    engines/lab/lab.h



diff --git a/engines/lab/anim.h b/engines/lab/anim.h
index 0118403..bdb02e3 100644
--- a/engines/lab/anim.h
+++ b/engines/lab/anim.h
@@ -96,6 +96,8 @@ public:
 	void stopDiffEnd();
 
 	uint16 getDIFFHeight();
+
+	bool isPlaying() const { return _isPlaying;  }
 };
 
 } // End of namespace Lab
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index 5850dc6..c262312 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -155,9 +155,10 @@ bool LabMetaEngine::hasFeature(MetaEngineFeature f) const {
 }
 
 bool Lab::LabEngine::hasFeature(EngineFeature f) const {
-	return (f == kSupportsRTL);
-	//(f == kSupportsLoadingDuringRuntime) ||
-	//(f == kSupportsSavingDuringRuntime);
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsLoadingDuringRuntime) ||
+		(f == kSupportsSavingDuringRuntime);
 }
 
 SaveStateList LabMetaEngine::listSaves(const char *target) const {
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 20f38ef..cf6ae71 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -1036,9 +1036,11 @@ void LabEngine::go() {
 	// If the user has requested to load a game from the launcher, skip the intro
 	if (!ConfMan.hasKey("save_slot")) {
 		_event->mouseHide();
+		_introPlaying = true;
 		Intro *intro = new Intro(this);
 		intro->play();
 		delete intro;
+		_introPlaying = false;
 		_event->mouseShow();
 	}
 
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
index e439aa1..70af5e8 100644
--- a/engines/lab/lab.cpp
+++ b/engines/lab/lab.cpp
@@ -128,12 +128,7 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc)
 	_monitorButtonHeight = 1;
 	for (int i = 0; i < 20; i++)
 		_highPalette[i] = 0;
-
-	//const Common::FSNode gameDataDir(ConfMan.get("path"));
-	//SearchMan.addSubDirectoryMatching(gameDataDir, "game");
-	//SearchMan.addSubDirectoryMatching(gameDataDir, "game/pict");
-	//SearchMan.addSubDirectoryMatching(gameDataDir, "game/spict");
-	//SearchMan.addSubDirectoryMatching(gameDataDir, "music");
+	_introPlaying = false;
 }
 
 LabEngine::~LabEngine() {
@@ -248,4 +243,22 @@ void LabEngine::updateEvents() {
 	_event->updateMouse();
 }
 
+Common::Error LabEngine::loadGameState(int slot) {
+	bool result = loadGame(slot);
+	return (result) ? Common::kNoError : Common::kUserCanceled;
+}
+
+Common::Error LabEngine::saveGameState(int slot, const Common::String &desc) {
+	bool result = saveGame(slot, desc);
+	return (result) ? Common::kNoError : Common::kUserCanceled;
+}
+
+bool LabEngine::canLoadGameStateCurrently() {
+	return !_anim->isPlaying() && !_introPlaying;
+}
+
+bool LabEngine::canSaveGameStateCurrently() {
+	return !_anim->isPlaying() && !_introPlaying;
+}
+
 } // End of namespace Lab
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 1933f3a..af80c90 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -160,6 +160,7 @@ private:
 	Image *_monitorButton;
 	Image *_journalBackImage;
 	TextFont *_journalFont;
+	bool _introPlaying;
 
 public:
 	bool _alternate;
@@ -225,6 +226,11 @@ public:
 	void updateEvents();
 	void waitTOF();
 
+	Common::Error loadGameState(int slot);
+	Common::Error saveGameState(int slot, const Common::String &desc);
+	bool canLoadGameStateCurrently();
+	bool canSaveGameStateCurrently();
+
 private:
 	/**
 	 * Checks whether all the conditions in a condition list are met.






More information about the Scummvm-git-logs mailing list