diff options
52 files changed, 172 insertions, 27 deletions
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp index 368753f117..435f0d1118 100644 --- a/engines/access/detection.cpp +++ b/engines/access/detection.cpp @@ -100,6 +100,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -171,6 +172,8 @@ SaveStateList AccessMetaEngine::listSaves(const char *target) const { return saveList; } +bool AccessMetaEngine::simpleSaveNames() const { return true; } + int AccessMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES; } diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp index 4bdb722af3..7031a58ec4 100644 --- a/engines/adl/detection.cpp +++ b/engines/adl/detection.cpp @@ -175,6 +175,7 @@ public: SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; int getMaximumSaveSlot() const { return 'O' - 'A'; } SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; void removeSaveState(const char *target, int slot) const; bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const; @@ -289,6 +290,8 @@ SaveStateList AdlMetaEngine::listSaves(const char *target) const { return saveList; } +bool AdlMetaEngine::simpleSaveNames() const { return true; } + void AdlMetaEngine::removeSaveState(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.s%02d", target, slot); g_system->getSavefileManager()->removeSavefile(fileName); diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 9f66d78d80..dc0dbbdddf 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -216,6 +216,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -323,6 +324,8 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const { return saveList; } +bool AgiMetaEngine::simpleSaveNames() const { return true; } + int AgiMetaEngine::getMaximumSaveSlot() const { return 999; } void AgiMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 2c89522089..dc96eb6ef6 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -120,6 +120,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; }; @@ -207,6 +208,8 @@ SaveStateList AgosMetaEngine::listSaves(const char *target) const { return saveList; } +bool AgosMetaEngine::simpleSaveNames() const { return true; } + int AgosMetaEngine::getMaximumSaveSlot() const { return 999; } #if PLUGIN_ENABLED_DYNAMIC(AGOS) diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp index e35c5d2cac..392d0a027f 100644 --- a/engines/avalanche/detection.cpp +++ b/engines/avalanche/detection.cpp @@ -83,6 +83,7 @@ public: int getMaximumSaveSlot() const { return 99; } SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; }; @@ -156,6 +157,8 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const { return saveList; } +bool AvalancheMetaEngine::simpleSaveNames() const { return true; } + void AvalancheMetaEngine::removeSaveState(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); g_system->getSavefileManager()->removeSavefile(fileName); diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp index 7c0045ee73..9aca719648 100644 --- a/engines/bbvs/detection.cpp +++ b/engines/bbvs/detection.cpp @@ -86,6 +86,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -135,6 +136,8 @@ SaveStateList BbvsMetaEngine::listSaves(const char *target) const { return saveList; } +bool BbvsMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor BbvsMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String filename = Bbvs::BbvsEngine::getSavegameFilename(target, slot); Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str()); diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index 0c79be51d9..eb88b6cd79 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -131,7 +131,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; - virtual Common::String getSavefilesPattern(Common::String &target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -240,9 +240,7 @@ SaveStateList CGEMetaEngine::listSaves(const char *target) const { return saveList; } -Common::String CGEMetaEngine::getSavefilesPattern(Common::String &target) const { - return target + ".###"; -} +bool CGEMetaEngine::simpleSaveNames() const { return true; } SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp index 2b84d167c7..d980f82b0d 100644 --- a/engines/cge2/detection.cpp +++ b/engines/cge2/detection.cpp @@ -127,6 +127,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -239,6 +240,8 @@ SaveStateList CGE2MetaEngine::listSaves(const char *target) const { return saveList; } +bool CGE2MetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor CGE2MetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index ec01e8734d..2d10b81473 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -104,6 +104,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -173,6 +174,8 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const { return saveList; } +bool CineMetaEngine::simpleSaveNames() const { return false; } + int CineMetaEngine::getMaximumSaveSlot() const { return 9; } void CineMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 6f5d236173..9e3ebb5dd5 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -211,6 +211,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const { return 99; } virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual void removeSaveState(const char *target, int slot) const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; @@ -254,6 +255,8 @@ SaveStateList CruiseMetaEngine::listSaves(const char *target) const { return saveList; } +bool CruiseMetaEngine::simpleSaveNames() const { return false; } + void CruiseMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(Cruise::CruiseEngine::getSavegameFile(slot)); } diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 65427bd8cd..8a67981696 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -98,6 +98,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const { return 99; } virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual void removeSaveState(const char *target, int slot) const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; @@ -147,6 +148,8 @@ SaveStateList DraciMetaEngine::listSaves(const char *target) const { return saveList; } +bool DraciMetaEngine::simpleSaveNames() const { return false; } + void DraciMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(Draci::DraciEngine::getSavegameFile(slot)); } diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index ffec393a0a..863ea98786 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -326,6 +326,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -382,6 +383,8 @@ SaveStateList DrasculaMetaEngine::listSaves(const char *target) const { return saveList; } +bool DrasculaMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor DrasculaMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 8e24c44702..abe1198233 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -86,6 +86,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -151,6 +152,8 @@ SaveStateList DreamWebMetaEngine::listSaves(const char *target) const { return saveList; } +bool DreamWebMetaEngine::simpleSaveNames() const { return false; } + int DreamWebMetaEngine::getMaximumSaveSlot() const { return 99; } void DreamWebMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp index 6f92f19f24..a183be8a83 100644 --- a/engines/fullpipe/detection.cpp +++ b/engines/fullpipe/detection.cpp @@ -90,6 +90,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const { return 8; } virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual void removeSaveState(const char *target, int slot) const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; @@ -134,6 +135,8 @@ SaveStateList FullpipeMetaEngine::listSaves(const char *target) const { return saveList; } +bool FullpipeMetaEngine::simpleSaveNames() const { return false; } + void FullpipeMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(Fullpipe::getSavegameFile(slot)); } diff --git a/engines/gnap/detection.cpp b/engines/gnap/detection.cpp index 7e4ab56d1f..523a8b6d1c 100644 --- a/engines/gnap/detection.cpp +++ b/engines/gnap/detection.cpp @@ -78,6 +78,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -141,6 +142,8 @@ SaveStateList GnapMetaEngine::listSaves(const char *target) const { return saveList; } +bool GnapMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor GnapMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index b12e264a57..22ced10b8a 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -352,6 +352,7 @@ public: bool hasFeature(MetaEngineFeature f) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -376,6 +377,8 @@ SaveStateList GroovieMetaEngine::listSaves(const char *target) const { return SaveLoad::listValidSaves(target); } +bool GroovieMetaEngine::simpleSaveNames() const { return false; } + int GroovieMetaEngine::getMaximumSaveSlot() const { return SaveLoad::getMaximumSlot(); } diff --git a/engines/hopkins/detection.cpp b/engines/hopkins/detection.cpp index cfdbf8030c..84af4fcdf3 100644 --- a/engines/hopkins/detection.cpp +++ b/engines/hopkins/detection.cpp @@ -117,6 +117,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -182,6 +183,8 @@ SaveStateList HopkinsMetaEngine::listSaves(const char *target) const { return saveList; } +bool HopkinsMetaEngine::simpleSaveNames() const { return true; } + int HopkinsMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES; } diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 4e4746c002..ed67eae416 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -149,6 +149,7 @@ public: int getMaximumSaveSlot() const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; void removeSaveState(const char *target, int slot) const; }; @@ -221,6 +222,8 @@ SaveStateList HugoMetaEngine::listSaves(const char *target) const { return saveList; } +bool HugoMetaEngine::simpleSaveNames() const { return false; } + SaveStateDescriptor HugoMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot); Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 989a45b420..1dcfd08435 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -162,6 +162,7 @@ public: bool hasFeature(MetaEngineFeature f) const; bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -273,6 +274,8 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const { return saveList; } +bool KyraMetaEngine::simpleSaveNames() const { return true; } + int KyraMetaEngine::getMaximumSaveSlot() const { return 999; } diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp index 30890b5acf..2b2e57df22 100644 --- a/engines/lab/detection.cpp +++ b/engines/lab/detection.cpp @@ -138,6 +138,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -191,6 +192,8 @@ SaveStateList LabMetaEngine::listSaves(const char *target) const { return saveList; } +bool LabMetaEngine::simpleSaveNames() const { return true; } + int LabMetaEngine::getMaximumSaveSlot() const { return 999; } diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 690a358bc3..808cea4422 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -212,6 +212,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -266,6 +267,8 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const { return saveList; } +bool LureMetaEngine::simpleSaveNames() const { return false; } + int LureMetaEngine::getMaximumSaveSlot() const { return 999; } void LureMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp index 4736503a38..d5354c4883 100644 --- a/engines/mads/detection.cpp +++ b/engines/mads/detection.cpp @@ -155,6 +155,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -217,6 +218,8 @@ SaveStateList MADSMetaEngine::listSaves(const char *target) const { return saveList; } +bool MADSMetaEngine::simpleSaveNames() const { return true; } + int MADSMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES; } diff --git a/engines/metaengine.h b/engines/metaengine.h index 913f61d280..6afb122580 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -116,14 +116,18 @@ public: } /** - * Return a common pattern which all engine's save filenames should match. + * Return whether engine's saves could be detected with + * "<target>.###" pattern and "###" corresponds to slot + * number. * - * @param target name of a config manager target - * @return a pattern for filenames + * If that's not true or engine is using some unusual way + * of detecting saves and slot numbers, this should return + * false. In that case Save/Load dialog would be unavailable + * during cloud saves sync. + * + * @return true, if "<target>.###" is OK for this engine */ - virtual Common::String getSavefilesPattern(Common::String &target) const { - return target + ".s##"; - } + virtual bool simpleSaveNames() const { return false; } /** * Return a list of extra GUI options for the specified target. diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index 246d3ec3c1..d3c44a8944 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -200,6 +200,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; SaveStateList listSavesForPrefix(const char *prefix, const char *extension) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const { return 999; } virtual void removeSaveState(const char *target, int slot) const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -272,6 +273,8 @@ SaveStateList MohawkMetaEngine::listSaves(const char *target) const { return saveList; } +bool MohawkMetaEngine::simpleSaveNames() const { return false; } + void MohawkMetaEngine::removeSaveState(const char *target, int slot) const { // Removing saved games is only supported in Myst/Riven currently. diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp index 6791707dd5..2f5a790486 100644 --- a/engines/mortevielle/detection.cpp +++ b/engines/mortevielle/detection.cpp @@ -72,6 +72,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; }; @@ -102,6 +103,8 @@ SaveStateList MortevielleMetaEngine::listSaves(const char *target) const { return Mortevielle::SavegameManager::listSaves(target); } +bool MortevielleMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor MortevielleMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String filename = Mortevielle::MortevielleEngine::generateSaveFilename(target, slot); return Mortevielle::SavegameManager::querySaveMetaInfos(filename); diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp index 0f409a6435..903c4377e0 100644 --- a/engines/neverhood/detection.cpp +++ b/engines/neverhood/detection.cpp @@ -214,6 +214,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -283,6 +284,8 @@ SaveStateList NeverhoodMetaEngine::listSaves(const char *target) const { return saveList; } +bool NeverhoodMetaEngine::simpleSaveNames() const { return true; } + int NeverhoodMetaEngine::getMaximumSaveSlot() const { return 999; } diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 4c52990874..989fc9dfc8 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -234,6 +234,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -294,6 +295,8 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { return saveList; } +bool ParallactionMetaEngine::simpleSaveNames() const { return false; } + int ParallactionMetaEngine::getMaximumSaveSlot() const { return 99; } void ParallactionMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp index 161a133c8b..54cb4ca525 100644 --- a/engines/pegasus/detection.cpp +++ b/engines/pegasus/detection.cpp @@ -148,6 +148,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const { return 999; } virtual void removeSaveState(const char *target, int slot) const; }; @@ -178,6 +179,8 @@ SaveStateList PegasusMetaEngine::listSaves(const char *target) const { return saveList; } +bool PegasusMetaEngine::simpleSaveNames() const { return false; } + void PegasusMetaEngine::removeSaveState(const char *target, int slot) const { // See listSaves() for info on the pattern Common::StringArray fileNames = Pegasus::PegasusEngine::listSaveFiles(); diff --git a/engines/prince/detection.h b/engines/prince/detection.h index 3076253cf5..39cfdd96e7 100644 --- a/engines/prince/detection.h +++ b/engines/prince/detection.h @@ -121,6 +121,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; diff --git a/engines/prince/saveload.cpp b/engines/prince/saveload.cpp index d3360badd1..2855bdc4bd 100644 --- a/engines/prince/saveload.cpp +++ b/engines/prince/saveload.cpp @@ -105,6 +105,8 @@ SaveStateList PrinceMetaEngine::listSaves(const char *target) const { return saveList; } +bool PrinceMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor PrinceMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/queen/detection.cpp b/engines/queen/detection.cpp index aed8b7dcb1..3f8b97ed6a 100644 --- a/engines/queen/detection.cpp +++ b/engines/queen/detection.cpp @@ -444,6 +444,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const { return 99; } virtual void removeSaveState(const char *target, int slot) const; @@ -529,6 +530,8 @@ SaveStateList QueenMetaEngine::listSaves(const char *target) const { return saveList; } +bool QueenMetaEngine::simpleSaveNames() const { return false; } + void QueenMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = Common::String::format("queen.s%02d", slot); diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 0677e84d67..7f6e0a2485 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -144,6 +144,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -207,6 +208,8 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const { return saveList; } +bool SagaMetaEngine::simpleSaveNames() const { return true; } + int SagaMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES - 1; } void SagaMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index ad2b0f31a5..08794a0872 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -518,6 +518,7 @@ public: const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -790,6 +791,8 @@ SaveStateList SciMetaEngine::listSaves(const char *target) const { return saveList; } +bool SciMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int slotNr) const { Common::String fileName = Common::String::format("%s.%03d", target, slotNr); Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 4c9d1221aa..67344e8008 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -960,6 +960,7 @@ public: virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -1299,6 +1300,8 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { return saveList; } +bool ScummMetaEngine::simpleSaveNames() const { return true; } + void ScummMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename = ScummEngine::makeSavegameName(target, slot, false); g_system->getSavefileManager()->removeSavefile(filename); diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp index 5a94b3485f..f54c6db952 100644 --- a/engines/sherlock/detection.cpp +++ b/engines/sherlock/detection.cpp @@ -159,6 +159,8 @@ public: */ virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; + /** * Returns the maximum number of allowed save slots */ @@ -217,6 +219,8 @@ SaveStateList SherlockMetaEngine::listSaves(const char *target) const { return Sherlock::SaveManager::getSavegameList(target); } +bool SherlockMetaEngine::simpleSaveNames() const { return true; } + int SherlockMetaEngine::getMaximumSaveSlot() const { return MAX_SAVEGAME_SLOTS; } diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index 4b91f50a61..802687b461 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -78,12 +78,13 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual GameList getSupportedGames() const; virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; - virtual GameDescriptor findGame(const char *gameid) const; + virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const Common::FSList &fslist) const; virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -247,6 +248,8 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { return saveList; } +bool SkyMetaEngine::simpleSaveNames() const { return false; } + int SkyMetaEngine::getMaximumSaveSlot() const { return MAX_SAVE_GAMES; } void SkyMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 0edf856125..d9cc3cda7f 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -91,6 +91,7 @@ public: virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const Common::FSList &fslist) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -263,6 +264,8 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const { return saveList; } +bool SwordMetaEngine::simpleSaveNames() const { return false; } + int SwordMetaEngine::getMaximumSaveSlot() const { return 999; } void SwordMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 44371bf6cf..3213a26e4c 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -97,6 +97,7 @@ public: virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const Common::FSList &fslist) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; @@ -256,6 +257,8 @@ SaveStateList Sword2MetaEngine::listSaves(const char *target) const { return saveList; } +bool Sword2MetaEngine::simpleSaveNames() const { return true; } + int Sword2MetaEngine::getMaximumSaveSlot() const { return 999; } void Sword2MetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index c5f55b5a26..1c4544c76a 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -69,6 +69,7 @@ public: virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; virtual int getMaximumSaveSlot() const { return Sword25::PersistenceService::getSlotCount(); } virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; }; bool Sword25MetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { @@ -109,6 +110,8 @@ SaveStateList Sword25MetaEngine::listSaves(const char *target) const { return saveList; } +bool Sword25MetaEngine::simpleSaveNames() const { return false; } + #if PLUGIN_ENABLED_DYNAMIC(SWORD25) REGISTER_PLUGIN_DYNAMIC(SWORD25, PLUGIN_TYPE_ENGINE, Sword25MetaEngine); #else diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index caa7bdbec9..a8d32e89d4 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -149,6 +149,8 @@ public: return saveList; } + virtual bool simpleSaveNames() const { return false; } + virtual int getMaximumSaveSlot() const { return MAX_SAVES - 1; } diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index c44f1f4ef3..7d8b54e5db 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -101,6 +101,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -164,6 +165,8 @@ SaveStateList TinselMetaEngine::listSaves(const char *target) const { return saveList; } +bool TinselMetaEngine::simpleSaveNames() const { return true; } + bool TinselMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { const Tinsel::TinselGameDescription *gd = (const Tinsel::TinselGameDescription *)desc; if (gd) { diff --git a/engines/toltecs/detection.cpp b/engines/toltecs/detection.cpp index 7c707895e6..8da9106931 100644 --- a/engines/toltecs/detection.cpp +++ b/engines/toltecs/detection.cpp @@ -221,6 +221,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -288,6 +289,8 @@ SaveStateList ToltecsMetaEngine::listSaves(const char *target) const { return saveList; } +bool ToltecsMetaEngine::simpleSaveNames() const { return true; } + int ToltecsMetaEngine::getMaximumSaveSlot() const { return 999; } diff --git a/engines/tony/detection.cpp b/engines/tony/detection.cpp index ec0b3e186b..5dda4c7caf 100644 --- a/engines/tony/detection.cpp +++ b/engines/tony/detection.cpp @@ -82,6 +82,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -141,6 +142,8 @@ SaveStateList TonyMetaEngine::listSaves(const char *target) const { return saveList; } +bool TonyMetaEngine::simpleSaveNames() const { return false; } + int TonyMetaEngine::getMaximumSaveSlot() const { return 99; } diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index 5d2e0a9bca..eac91a5595 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -148,6 +148,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual int getMaximumSaveSlot() const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -212,6 +213,8 @@ SaveStateList ToonMetaEngine::listSaves(const char *target) const { return saveList; } +bool ToonMetaEngine::simpleSaveNames() const { return true; } + SaveStateDescriptor ToonMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName); diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index dcb58ffae6..e2737d4f2c 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -155,6 +155,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -210,6 +211,8 @@ SaveStateList ToucheMetaEngine::listSaves(const char *target) const { return saveList; } +bool ToucheMetaEngine::simpleSaveNames() const { return false; } + int ToucheMetaEngine::getMaximumSaveSlot() const { return Touche::kMaxSaveStates - 1; } diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 584ad87742..716ac4af53 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -145,6 +145,8 @@ public: return saveList; } + virtual bool simpleSaveNames() const { return true; } + virtual int getMaximumSaveSlot() const { return MAX_SAVES - 1; } diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 2447e15d6b..227924cd28 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -187,6 +187,8 @@ public: return saveList; } + virtual bool simpleSaveNames() const { return false; } + virtual int getMaximumSaveSlot() const { return Tucker::kLastSaveSlot; } diff --git a/engines/voyeur/detection.cpp b/engines/voyeur/detection.cpp index 7b9fa6722e..76668eb370 100644 --- a/engines/voyeur/detection.cpp +++ b/engines/voyeur/detection.cpp @@ -81,6 +81,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -143,6 +144,8 @@ SaveStateList VoyeurMetaEngine::listSaves(const char *target) const { return saveList; } +bool VoyeurMetaEngine::simpleSaveNames() const { return true; } + int VoyeurMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES; } diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp index a27bfd7fde..1069d740f6 100644 --- a/engines/wage/detection.cpp +++ b/engines/wage/detection.cpp @@ -70,6 +70,7 @@ public: virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; }; @@ -136,6 +137,8 @@ SaveStateList WageMetaEngine::listSaves(const char *target) const { return saveList; } +bool WageMetaEngine::simpleSaveNames() const { return true; } + int WageMetaEngine::getMaximumSaveSlot() const { return 999; } void WageMetaEngine::removeSaveState(const char *target, int slot) const { diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp index 4e8eab505f..f225cd3930 100644 --- a/engines/wintermute/detection.cpp +++ b/engines/wintermute/detection.cpp @@ -164,6 +164,8 @@ public: return saves; } + virtual bool simpleSaveNames() const { return false; } + int getMaximumSaveSlot() const { return 100; } diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp index cc967070d9..05dfb8b8d0 100644 --- a/engines/zvision/detection.cpp +++ b/engines/zvision/detection.cpp @@ -75,6 +75,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; SaveStateList listSaves(const char *target) const; + virtual bool simpleSaveNames() const; virtual int getMaximumSaveSlot() const; void removeSaveState(const char *target, int slot) const; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; @@ -159,6 +160,8 @@ SaveStateList ZVisionMetaEngine::listSaves(const char *target) const { return saveList; } +bool ZVisionMetaEngine::simpleSaveNames() const { return true; } + int ZVisionMetaEngine::getMaximumSaveSlot() const { return 999; } diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 1ba1793ef4..0dde1a4060 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -266,25 +266,27 @@ void SaveLoadChooserDialog::listSaves() { if (!_metaEngine) return; //very strange _saveList = _metaEngine->listSaves(_target.c_str()); - Common::String pattern = _metaEngine->getSavefilesPattern(_target); - Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing - for (uint32 i = 0; i < files.size(); ++i) { - if (!files[i].matchString(pattern, true)) continue; - - //make up some slot number - int slotNum = 0; - for (uint32 j = (files[i].size() > 3 ? files[i].size() - 3 : 0); j < files[i].size(); ++j) { //3 last chars - char c = files[i][j]; - if (c < '0' || c > '9') continue; - slotNum = slotNum * 10 + (c - '0'); + if (_metaEngine->simpleSaveNames()) { + Common::String pattern = _target + ".###"; + Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing + for (uint32 i = 0; i < files.size(); ++i) { + if (!files[i].matchString(pattern, true)) continue; + + //make up some slot number + int slotNum = 0; + for (uint32 j = (files[i].size() > 3 ? files[i].size() - 3 : 0); j < files[i].size(); ++j) { //3 last chars + char c = files[i][j]; + if (c < '0' || c > '9') continue; + slotNum = slotNum * 10 + (c - '0'); + } + + SaveStateDescriptor slot(slotNum, files[i]); + slot.setLocked(true); + _saveList.push_back(slot); } - SaveStateDescriptor slot(slotNum, files[i]); - slot.setLocked(true); - _saveList.push_back(slot); + Common::sort(_saveList.begin(), _saveList.end(), SaveStateDescriptorSlotComparator()); } - - Common::sort(_saveList.begin(), _saveList.end(), SaveStateDescriptorSlotComparator()); } #ifndef DISABLE_SAVELOADCHOOSER_GRID |