aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-27 23:22:54 +0200
committerFilippos Karapetis2015-12-27 23:22:54 +0200
commit3977a7ffa15d1db55d787b450307ef1c62fcda26 (patch)
tree07d3c968aaafe2920e55a161bea7d6f87e336a81 /engines
parent4548cbddb5b0490effe402242e08001859c7266c (diff)
downloadscummvm-rg350-3977a7ffa15d1db55d787b450307ef1c62fcda26.tar.gz
scummvm-rg350-3977a7ffa15d1db55d787b450307ef1c62fcda26.tar.bz2
scummvm-rg350-3977a7ffa15d1db55d787b450307ef1c62fcda26.zip
LAB: Add support for saving and loading games from the GMM
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/anim.h2
-rw-r--r--engines/lab/detection.cpp7
-rw-r--r--engines/lab/engine.cpp2
-rw-r--r--engines/lab/lab.cpp25
-rw-r--r--engines/lab/lab.h6
5 files changed, 33 insertions, 9 deletions
diff --git a/engines/lab/anim.h b/engines/lab/anim.h
index 0118403842..bdb02e3f02 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 5850dc69ae..c26231292b 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 20f38ef884..cf6ae71563 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 e439aa15a7..70af5e8605 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 1933f3aec5..af80c904d1 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.