aboutsummaryrefslogtreecommitdiff
path: root/engines/griffon
diff options
context:
space:
mode:
authorEugene Sandulenko2019-11-13 00:52:00 +0100
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commit06909eb32098662a77cadd6b6ec3f19282ee8762 (patch)
treec2dc44aa5472d6f794e5d2caca44e9300e58812d /engines/griffon
parent50f964770c17880993aff1af9342f5111d75bc07 (diff)
downloadscummvm-rg350-06909eb32098662a77cadd6b6ec3f19282ee8762.tar.gz
scummvm-rg350-06909eb32098662a77cadd6b6ec3f19282ee8762.tar.bz2
scummvm-rg350-06909eb32098662a77cadd6b6ec3f19282ee8762.zip
GRIFFON: Implemented loading from launcher
Diffstat (limited to 'engines/griffon')
-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;