#include <metaengine.h>
Public Member Functions | |
virtual const char * | getName () const =0 |
virtual Common::Error | createInstance (OSystem *syst, Engine **engine) const =0 |
virtual SaveStateList | listSaves (const char *target) const |
SaveStateList | listSaves (const char *target, bool saveMode) const |
virtual int | getAutosaveSlot () const |
virtual int | getMaximumSaveSlot () const |
virtual void | removeSaveState (const char *target, int slot) const |
virtual SaveStateDescriptor | querySaveMetaInfos (const char *target, int slot) const |
virtual Common::String | getSavegameFile (int saveGameIdx, const char *target=nullptr) const |
Common::String | getSavegameFilePattern (const char *target=nullptr) const |
virtual Common::Array< Common::Keymap * > | initKeymaps (const char *target) const |
virtual const ExtraGuiOptions | getExtraGuiOptions (const Common::String &target) const |
virtual GUI::OptionsContainerWidget * | buildEngineOptionsWidgetDynamic (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const |
virtual const Common::AchievementsInfo | getAchievementsInfo (const Common::String &target) const |
virtual bool | hasFeature (MetaEngineFeature f) const |
Static Public Member Functions | |
static void | appendExtendedSave (Common::OutSaveFile *saveFile, uint32 playtime, Common::String desc, bool isAutosave) |
static void | parseSavegameHeader (ExtendedSavegameHeader *header, SaveStateDescriptor *desc) |
static void | fillDummyHeader (ExtendedSavegameHeader *header) |
static WARN_UNUSED_RESULT bool | readSavegameHeader (Common::InSaveFile *in, ExtendedSavegameHeader *header, bool skipThumbnail=true) |
A MetaEngine is another factory for Engine instances, and is very similar to meta engines.
This class, however, is made of of bridged functionalities that can be used to connect an actual Engine with a MetaEngine. Every engine "plugin" provides a hook to get an instance of the MetaEngine subclass for that "engine plugin.". For example, SCUMM provides a ScummMetaEngine. This is then in turn used for things like instantiating engine objects, listing savefiles, querying save metadata, etc.
Since engine plugins can use external runtime libraries, these can live and build inside the engine, while a MetaEngine will always build into the executable to be able to detect code.
MetaEngine feature flags.
A feature in this context means an ability of the engine that can be either available or not.
Enumerator | |
---|---|
kSupportsListSaves | List all save states for a given target that is supported. For the target to be supported, the listSaves() and getMaximumSaveSlot methods must be implemented. Used for –list-saves support, as well as the GMM load dialog. |
kSupportsLoadingDuringStartup | Load from the launcher or command line (-x). |
kSupportsDeleteSave | Delete saves from the launcher. This means that the engine implements the removeSaveState() method. |
kSavesSupportMetaInfo | Feature meta information for save states. This means that the engine implements the querySaveMetaInfos method properly. Engines implementing meta information always must provide the following entries in the save state descriptor queried by querySaveMetaInfos:
|
kSavesSupportThumbnail | Feature a thumbnail in savegames. This means that the engine includes a thumbnail in save states returned via querySaveMetaInfo. This flag can only be set when kSavesSupportMetaInfo is set. |
kSavesSupportCreationDate | Feature These values indicate the date and time when the savegame was created. This flag can only be set when kSavesSupportMetaInfo is set. |
kSavesSupportPlayTime | Feature This indicates how long the user played the game until the save. This flag can only be set when kSavesSupportMetaInfo is set. |
kSimpleSavesNames | This feature is available if the engine's saves can be detected with: <target>.### where ### corresponds to slot number. If that is not true, or if the engine uses some unusual way of detecting saves and slot numbers, this should be unavailable. In that case Save/Load dialog for the engine's games is locked during cloud saves sync. |
kSavesUseExtendedFormat | Use the default implementation of save header and thumbnail appended to the save. This flag requires the following flags to be set:
|
|
pure virtual |
Name of the engine plugin.
Classes inheriting a MetaEngineConnect must provide an engineID here, which can then be used to match an Engine with MetaEngine.
For example, ScummMetaEngine inherits MetaEngine and provides a engineID of "Scumm". ScummMetaEngineConnect inherits MetaEngineConnect and provides the name "Scumm". This way, an Engine can be easily matched with a MetaEngine.
Implemented in AdvancedMetaEngine.
|
pure virtual |
Instantiate an engine instance based on the settings of the currently active ConfMan target.
The MetaEngine queries the ConfMan singleton for data like the target, gameid, path etc.
syst | Pointer to the global OSystem object. |
engine | Pointer to a pointer that the MetaEngine sets to the newly created Engine, or 0 in case of an error. |
Implemented in AdvancedMetaEngine.
|
virtual |
Return a list of all save states associated with the given target.
The returned list is guaranteed to be sorted by slot numbers. That means smaller slot numbers are always stored before bigger slot numbers.
The caller must ensure that this (Meta)Engine is responsible for the specified target. This is done by using findGame on it respectively on the associated gameid from the relevant ConfMan entry, if present.
The default implementation returns an empty list.
target | Name of a config manager target. |
SaveStateList MetaEngine::listSaves | ( | const char * | target, |
bool | saveMode | ||
) | const |
Return a list of all save states associated with the given target.
This is a wrapper around the basic listSaves virtual method, but it has some extra logic for autosave handling.
target | Name of a config manager target. |
saveMode | If true, get the list for a save dialog. |
|
inlinevirtual |
Return the slot number that is used for autosaves.
|
inlinevirtual |
Return the maximum number of save slots that the engine supports.
The default implementation limits the save slots to zero (0).
|
virtual |
Remove the specified save state.
For most engines, this just means calling _saveFileMan->removeSaveFile(). Engines that keep an index file will also update it accordingly.
target | Name of a config manager target. |
slot | Slot number of the save state to be removed. |
|
virtual |
Return meta information from the specified save state.
Depending on the MetaEngineFeatures set, this can include thumbnails, save date and time, play time.
target | Name of a config manager target. |
slot | Slot number of the save state. |
|
virtual |
Return the name of the save file for the given slot and optional target, or a pattern for matching filenames against.
saveGameIdx | Index of the save, or kSavegameFilePattern for returning a filename pattern. |
target | Game target. If omitted, then the engine ID is used. |
|
inline |
Return the pattern for save files.
target | Game target. If omitted, then the engine ID is used. |
|
virtual |
Return the keymap used by the target.
|
inlinevirtual |
Return the extra GUI options used by the target.
|
virtual |
Return a GUI widget container for configuring the specified target options.
Engines can build custom option dialogs from here, but by default a simple widget allowing to configure the extra GUI options is used.
The engine that builds the Engines tab in the Edit Game dialog uses a MetaEngine. The engine that specifies a custom dialog when a game is running uses a MetaEngineConnect.
Engines are not supposed to have an Engine tab in the Edit Game dialog can return nullptr.
boss | The widget or dialog that the returned widget is a child of. |
name | The name that the returned widget must use. |
target | Name of a config manager target. |
|
inlinevirtual |
Return a list of achievement descriptions for the specified target.
The default implementation returns an empty list.
target | Name of a config manager target. |
|
virtual |
Determine whether the engine supports the specified MetaEngine feature.
Used by e.g. the launcher to determine whether to enable the Load button.
|
static |
|
static |
|
static |
|
static |