Project: ScummVM
Revision: 34738
Author: fingolfin
Date: 04 Oct 2008 09:09:01
Changes: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
Files:modified: /scummvm/trunk/gui/launcher.cpp (
try)
modified: /scummvm/trunk/engines/metaengine.h (
try)
modified: /scummvm/trunk/engines/scumm/detection.cpp (
try)
modified: /scummvm/trunk/engines/kyra/detection.cpp (
try)
modified: /scummvm/trunk/engines/engine.h (
try)
Diff:
| ... | ...@@ -554,10 +554,10 @@ |
| 554 | 554 | _plugin = plugin; |
| 555 | 555 | _target = target; |
| 556 | 556 | _delSupport = (*_plugin)->hasFeature(MetaEngine::kSupportsDeleteSave); |
| 557 | | _metaInfoSupport = (*_plugin)->hasFeature(MetaEngine::kSupportsMetaInfos); |
| 558 | | _thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsThumbnails); |
| 559 | | _saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsSaveDate); |
| 560 | | _playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSupportsSavePlayTime); |
| 557 | _metaInfoSupport = (*_plugin)->hasFeature(MetaEngine::kSavesSupportMetaInfo); |
| 558 | _thumbnailSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportThumbnail); |
| 559 | _saveDateSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportCreationDate); |
| 560 | _playTimeSupport = _metaInfoSupport && (*_plugin)->hasFeature(MetaEngine::kSavesSupportPlayTime); |
| 561 | 561 | reflowLayout(); |
| 562 | 562 | updateSaveList(); |
| 563 | 563 | |
| ... | ...@@ -88,6 +88,9 @@ |
| 88 | 88 | * |
| 89 | 89 | * The default implementation returns an empty list. |
| 90 | 90 | * |
| 91 | * @note MetaEngines must indicate that this function has been implemented |
| 92 | * via the kSupportsListSaves feature flag. |
| 93 | * |
| 91 | 94 | * @param target name of a config manager target |
| 92 | 95 | * @return a list of save state descriptors |
| 93 | 96 | */ |
| ... | ...@@ -101,6 +104,9 @@ |
| 101 | 104 | * For most engines this just amounts to calling _saveFileMan->removeSaveFile(). |
| 102 | 105 | * Engines which keep an index file will also update it accordingly. |
| 103 | 106 | * |
| 107 | * @note MetaEngines must indicate that this function has been implemented |
| 108 | * via the kSupportsDeleteSave feature flag. |
| 109 | * |
| 104 | 110 | * @param target name of a config manager target |
| 105 | 111 | * @param slot slot number of the save state to be removed |
| 106 | 112 | */ |
| ... | ...@@ -127,52 +133,57 @@ |
| 127 | 133 | * either available or not. |
| 128 | 134 | */ |
| 129 | 135 | enum MetaEngineFeature { |
| 130 | | /** 'Return to launcher' feature (i.e. EVENT_RTL is handled) */ |
| 131 | | kSupportsRTL = 0, |
| 136 | /** |
| 137 | * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled- |
| 138 | */ |
| 139 | kSupportsRTL, |
| 132 | 140 | |
| 133 | 141 | /** |
| 134 | | * Listing Save States (i.e. implements the listSaves() method; |
| 135 | | * used for --list-saves support) |
| 142 | * Listing all Save States for a given target is supported, i.e., |
| 143 | * the listSaves() method is implemented. |
| 144 | * Used for --list-saves support, as well as the GMM load dialog. |
| 136 | 145 | */ |
| 137 | | kSupportsListSaves = 1, |
| 146 | kSupportsListSaves, |
| 138 | 147 | |
| 139 | | /** Loading from the Launcher / command line (-x) */ |
| 140 | | kSupportsDirectLoad = 2, |
| 148 | /** |
| 149 | * Loading from the Launcher / command line (-x) |
| 150 | */ |
| 151 | kSupportsDirectLoad, |
| 141 | 152 | |
| 142 | 153 | /** |
| 143 | 154 | * Deleting Saves from the Launcher (i.e. implements the |
| 144 | 155 | * removeSaveState() method) |
| 145 | 156 | */ |
| 146 | | kSupportsDeleteSave = 3, |
| 157 | kSupportsDeleteSave, |
| 147 | 158 | |
| 148 | 159 | /** |
| 149 | 160 | * Features meta infos for savestates (i.e. implements the |
| 150 | 161 | * querySaveMetaInfos method properly) |
| 151 | 162 | */ |
| 152 | | kSupportsMetaInfos = 4, |
| 163 | kSavesSupportMetaInfo, |
| 153 | 164 | |
| 154 | 165 | /** |
| 155 | 166 | * Features a thumbnail in savegames (i.e. includes a thumbnail |
| 156 | 167 | * in savestates returned via querySaveMetaInfo). |
| 157 | | * This flag may only be set when 'kSupportsMetaInfos' is set. |
| 168 | * This flag may only be set when 'kSavesSupportMetaInfo' is set. |
| 158 | 169 | */ |
| 159 | | kSupportsThumbnails = 5, |
| 170 | kSavesSupportThumbnail, |
| 160 | 171 | |
| 161 | 172 | /** |
| 162 | 173 | * Features 'save_date' and 'save_time' entries in the |
| 163 | 174 | * savestate returned by querySaveMetaInfo. Those values |
| 164 | 175 | * indicate the date/time the savegame was created. |
| 165 | | * This flag may only be set when 'kSupportsMetaInfos' is set. |
| 176 | * This flag may only be set when 'kSavesSupportMetaInfo' is set. |
| 166 | 177 | */ |
| 167 | | kSupportsSaveDate = 6, |
| 178 | kSavesSupportCreationDate, |
| 168 | 179 | |
| 169 | 180 | /** |
| 170 | 181 | * Features 'play_time' entry in the savestate returned by |
| 171 | 182 | * querySaveMetaInfo. It indicates how long the user played |
| 172 | 183 | * the game till the save. |
| 173 | | * This flag may only be set when 'kSupportsMetaInfos' is set. |
| 184 | * This flag may only be set when 'kSavesSupportMetaInfo' is set. |
| 174 | 185 | */ |
| 175 | | kSupportsSavePlayTime = 7 |
| 186 | kSavesSupportPlayTime |
| 176 | 187 | }; |
| 177 | 188 | |
| 178 | 189 | /** |
| ... | ...@@ -695,10 +695,10 @@ |
| 695 | 695 | (f == kSupportsListSaves) || |
| 696 | 696 | (f == kSupportsDirectLoad) || |
| 697 | 697 | (f == kSupportsDeleteSave) || |
| 698 | | (f == kSupportsMetaInfos) || |
| 699 | | (f == kSupportsThumbnails) || |
| 700 | | (f == kSupportsSaveDate) || |
| 701 | | (f == kSupportsSavePlayTime); |
| 698 | (f == kSavesSupportMetaInfo) || |
| 699 | (f == kSavesSupportThumbnail) || |
| 700 | (f == kSavesSupportCreationDate) || |
| 701 | (f == kSavesSupportPlayTime); |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | GameList ScummMetaEngine::getSupportedGames() const { |
| ... | ...@@ -1077,8 +1077,8 @@ |
| 1077 | 1077 | (f == kSupportsListSaves) || |
| 1078 | 1078 | (f == kSupportsDirectLoad) || |
| 1079 | 1079 | (f == kSupportsDeleteSave) || |
| 1080 | | (f == kSupportsMetaInfos) || |
| 1081 | | (f == kSupportsThumbnails); |
| 1080 | (f == kSavesSupportMetaInfo) || |
| 1081 | (f == kSavesSupportThumbnail); |
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | 1084 | bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const { |
| ... | ...@@ -178,6 +178,10 @@ |
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | 180 | * Determine whether the engine supports the specified MetaEngine feature. |
| 181 | * |
| 182 | * FIXME: This should not call through to the MetaEngine, but rather should support |
| 183 | * its own list of features. In particular, kSupportsRTL should be an EngineFeature, |
| 184 | * not a MetaEngineFeature. |
| 181 | 185 | */ |
| 182 | 186 | bool hasFeature(MetaEngine::MetaEngineFeature f); |
| 183 | 187 | |
To list