Skip to content

Commit

Permalink
GRIFFON: Added support for extended saves
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Nov 12, 2019
1 parent 7b97437 commit 392feb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 11 additions & 1 deletion engines/griffon/detection.cpp
Expand Up @@ -59,6 +59,8 @@ class GriffonMetaEngine: public AdvancedMetaEngine {
return "Griffon Engine";
}

virtual int getMaximumSaveSlot() const { return 3; }

virtual const char *getOriginalCopyright() const {
return "The Griffon Legend (c) 2005 Syn9 (Daniel Kennedy)";
}
Expand All @@ -68,7 +70,15 @@ class GriffonMetaEngine: public AdvancedMetaEngine {
};

bool GriffonMetaEngine::hasFeature(MetaEngineFeature f) const {
return false;
return
(f == kSupportsListSaves) ||
(f == kSupportsDeleteSave) ||
(f == kSavesSupportMetaInfo) ||
(f == kSavesSupportThumbnail) ||
(f == kSavesSupportCreationDate) ||
(f == kSavesSupportPlayTime) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSavesUseExtendedFormat);
}

bool GriffonMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
Expand Down
9 changes: 8 additions & 1 deletion engines/griffon/saveload.cpp
Expand Up @@ -37,6 +37,7 @@
#include "griffon/griffon.h"

#include "common/savefile.h"
#include "engines/metaengine.h"

namespace Griffon {

Expand All @@ -55,7 +56,7 @@ namespace Griffon {
} while(0)

Common::String GriffonEngine::makeSaveGameName(int slot) {
return (_targetName + Common::String::format(".%02d", slot));
return (_targetName + Common::String::format(".s%02d", slot));
}

int GriffonEngine::loadState(int slotnum) {
Expand Down Expand Up @@ -248,6 +249,12 @@ int GriffonEngine::saveState(int slotnum) {
PRINT("%f", _player.spellStrength);
}

drawView();

Common::String desc = Common::String::format("Level: %d Map: %d", _player.level, _curMap);

MetaEngine::appendExtendedSave(file, (_secStart + _secsInGame) * 1000, desc);

file->finalize();

return 1; // success
Expand Down

0 comments on commit 392feb9

Please sign in to comment.