From b41cd58cee80ae682d6806fc448ca6772fd8ef61 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 4 Oct 2008 13:09:01 +0000 Subject: Renamed some MetaEngine feature flags; removed explicit numbers from this feature flag list (nothing should rely on their specific values, anyway); added a note that Engine::hasFeature should become independant of MetaEngine::hasFeature svn-id: r34738 --- engines/engine.h | 4 ++++ engines/kyra/detection.cpp | 4 ++-- engines/metaengine.h | 41 ++++++++++++++++++++++++++--------------- engines/scumm/detection.cpp | 8 ++++---- gui/launcher.cpp | 8 ++++---- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/engines/engine.h b/engines/engine.h index 148e4f24c6..2bc44ab415 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -178,6 +178,10 @@ public: /** * Determine whether the engine supports the specified MetaEngine feature. + * + * FIXME: This should not call through to the MetaEngine, but rather should support + * its own list of features. In particular, kSupportsRTL should be an EngineFeature, + * not a MetaEngineFeature. */ bool hasFeature(MetaEngine::MetaEngineFeature f); diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 7a377471c1..f39570367b 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -1077,8 +1077,8 @@ bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const { (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave) || - (f == kSupportsMetaInfos) || - (f == kSupportsThumbnails); + (f == kSavesSupportMetaInfo) || + (f == kSavesSupportThumbnail); } bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const { diff --git a/engines/metaengine.h b/engines/metaengine.h index fc75344f00..542cee683b 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -88,6 +88,9 @@ public: * * The default implementation returns an empty list. * + * @note MetaEngines must indicate that this function has been implemented + * via the kSupportsListSaves feature flag. + * * @param target name of a config manager target * @return a list of save state descriptors */ @@ -101,6 +104,9 @@ public: * For most engines this just amounts to calling _saveFileMan->removeSaveFile(). * Engines which keep an index file will also update it accordingly. * + * @note MetaEngines must indicate that this function has been implemented + * via the kSupportsDeleteSave feature flag. + * * @param target name of a config manager target * @param slot slot number of the save state to be removed */ @@ -127,52 +133,57 @@ public: * either available or not. */ enum MetaEngineFeature { - /** 'Return to launcher' feature (i.e. EVENT_RTL is handled) */ - kSupportsRTL = 0, + /** + * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled- + */ + kSupportsRTL, /** - * Listing Save States (i.e. implements the listSaves() method; - * used for --list-saves support) + * Listing all Save States for a given target is supported, i.e., + * the listSaves() method is implemented. + * Used for --list-saves support, as well as the GMM load dialog. */ - kSupportsListSaves = 1, + kSupportsListSaves, - /** Loading from the Launcher / command line (-x) */ - kSupportsDirectLoad = 2, + /** + * Loading from the Launcher / command line (-x) + */ + kSupportsDirectLoad, /** * Deleting Saves from the Launcher (i.e. implements the * removeSaveState() method) */ - kSupportsDeleteSave = 3, + kSupportsDeleteSave, /** * Features meta infos for savestates (i.e. implements the * querySaveMetaInfos method properly) */ - kSupportsMetaInfos = 4, + kSavesSupportMetaInfo, /** * Features a thumbnail in savegames (i.e. includes a thumbnail * in savestates returned via querySaveMetaInfo). - * This flag may only be set when 'kSupportsMetaInfos' is set. + * This flag may only be set when 'kSavesSupportMetaInfo' is set. */ - kSupportsThumbnails = 5, + kSavesSupportThumbnail, /** * Features 'save_date' and 'save_time' entries in the * savestate returned by querySaveMetaInfo. Those values * indicate the date/time the savegame was created. - * This flag may only be set when 'kSupportsMetaInfos' is set. + * This flag may only be set when 'kSavesSupportMetaInfo' is set. */ - kSupportsSaveDate = 6, + kSavesSupportCreationDate, /** * Features 'play_time' entry in the savestate returned by * querySaveMetaInfo. It indicates how long the user played * the game till the save. - * This flag may only be set when 'kSupportsMetaInfos' is set. + * This flag may only be set when 'kSavesSupportMetaInfo' is set. */ - kSupportsSavePlayTime = 7 + kSavesSupportPlayTime }; /** diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 0a54f2d29b..3059fc1033 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -695,10 +695,10 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave) || - (f == kSupportsMetaInfos) || - (f == kSupportsThumbnails) || - (f == kSupportsSaveDate) || - (f == kSupportsSavePlayTime); + (f == kSavesSupportMetaInfo) || + (f == kSavesSupportThumbnail) || + (f == kSavesSupportCreationDate) || + (f == kSavesSupportPlayTime); } GameList ScummMetaEngine::getSupportedGames() const { diff --git a/gui/launcher.cpp b/gui/launcher.cpp index c37a412440..c4b0a9bd6a 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -554,10 +554,10 @@ int SaveLoadChooser::runModal(const EnginePlugin *plugin, const String &target) _plugin = plugin; _target = target; _delSupport = (*_plugin)->hasFeature(MetaEngine::kSupportsDeleteSave); - _metaInfoSupport = (*_plugin)->hasFeature(MetaEngine::kSupportsMetaInfos); - _thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsThumbnails); - _saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsSaveDate); - _playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsSavePlayTime); + _metaInfoSupport = (*_plugin)->hasFeature(MetaEngine::kSavesSupportMetaInfo); + _thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportThumbnail); + _saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportCreationDate); + _playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportPlayTime); reflowLayout(); updateSaveList(); -- cgit v1.2.3