aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/griffon/detection.cpp7
-rw-r--r--engines/griffon/griffon.cpp13
-rw-r--r--engines/griffon/griffon.h12
3 files changed, 29 insertions, 3 deletions
diff --git a/engines/griffon/detection.cpp b/engines/griffon/detection.cpp
index e19530ba9a..dae37f201c 100644
--- a/engines/griffon/detection.cpp
+++ b/engines/griffon/detection.cpp
@@ -81,6 +81,13 @@ bool GriffonMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSavesUseExtendedFormat);
}
+bool Griffon::GriffonEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL) ||
+ (f == kSupportsLoadingDuringRuntime) ||
+ (f == kSupportsSavingDuringRuntime);
+}
+
bool GriffonMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc)
*engine = new Griffon::GriffonEngine(syst);
diff --git a/engines/griffon/griffon.cpp b/engines/griffon/griffon.cpp
index 7632623e49..879b0ef1cd 100644
--- a/engines/griffon/griffon.cpp
+++ b/engines/griffon/griffon.cpp
@@ -132,13 +132,20 @@ Common::Error GriffonEngine::run() {
_console = new Console();
initialize();
- showLogos();
+
+ if (ConfMan.hasKey("save_slot")) {
+ _saveSlot = ConfMan.getInt("save_slot");
+ loadGameState(_saveSlot);
+
+ _gameMode = kGameModeLoadGame;
+ } else {
+ showLogos();
+ _gameMode = kGameModeIntro;
+ }
if (_shouldQuit)
return Common::kNoError;
- _gameMode = kGameModeIntro;
-
while (!_shouldQuit) {
switch (_gameMode) {
case kGameModeIntro:
diff --git a/engines/griffon/griffon.h b/engines/griffon/griffon.h
index f2e397e233..40d7de8948 100644
--- a/engines/griffon/griffon.h
+++ b/engines/griffon/griffon.h
@@ -37,6 +37,7 @@
#define GRIFFON_GRIFFON_H
#include "common/scummsys.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/random.h"
#include "engines/engine.h"
@@ -428,6 +429,17 @@ private:
void setupAudio();
void updateMusic();
+ Common::Error loadGameState(int slot) {
+ return loadPlayer(slot) ? Common::kNoError : Common::kUnknownError;
+ }
+ Common::Error saveGameState(int slot, const Common::String &description) {
+ return saveState(slot) ? Common::kNoError : Common::kUnknownError;
+ }
+
+ virtual bool canLoadGameStateCurrently() { return true; }
+ virtual bool canSaveGameStateCurrently() { return _gameMode == kGameModePlay; }
+ virtual bool hasFeature(EngineFeature f) const;
+
private:
Graphics::TransparentSurface *_video, *_videoBuffer, *_videoBuffer2, *_videoBuffer3;