ScummVM
MetaEngine Class Referenceabstract

A meta engine is essentially a factory for Engine instances with the added ability of listing and detecting supported games. More...

#include <metaengine.h>

Inheritance diagram for MetaEngine:
Collaboration diagram for MetaEngine:

Public Member Functions

virtual ~MetaEngine ()
 
virtual const char * getEngineId () const =0
 Get the engine ID. More...
 
virtual const char * getOriginalCopyright () const =0
 Returns some copyright information about the original engine. More...
 
virtual PlainGameList getSupportedGames () const =0
 Returns a list of games supported by this engine. More...
 
virtual PlainGameDescriptor findGame (const char *gameId) const =0
 Query the engine for a PlainGameDescriptor for the specified gameid, if any. More...
 
virtual DetectedGames detectGames (const Common::FSList &fslist) const =0
 Runs the engine's game detector on the given list of files, and returns a (possibly empty) list of games supported by the engine which it was able to detect amongst the given files. More...
 
virtual Common::Error createInstance (OSystem *syst, Engine **engine) const =0
 Tries to instantiate an engine instance based on the settings of the currently active ConfMan target. More...
 
virtual SaveStateList listSaves (const char *target) const
 Return a list of all save states associated with the given target. More...
 
virtual const ExtraGuiOptions getExtraGuiOptions (const Common::String &target) const
 Return a list of extra GUI options for the specified target. More...
 
virtual int getMaximumSaveSlot () const
 Return the maximum save slot that the engine supports. More...
 
virtual void removeSaveState (const char *target, int slot) const
 Remove the specified save state. More...
 
virtual SaveStateDescriptor querySaveMetaInfos (const char *target, int slot) const
 Returns meta infos from the specified save state. More...
 
- Public Member Functions inherited from PluginObject
virtual ~PluginObject ()
 
virtual const char * getName () const =0
 Returns the name of the plugin. More...
 

MetaEngineFeature flags

enum  MetaEngineFeature {
  kSupportsListSaves, kSupportsLoadingDuringStartup, kSupportsDeleteSave, kSavesSupportMetaInfo,
  kSavesSupportThumbnail, kSavesSupportCreationDate, kSavesSupportPlayTime, kSimpleSavesNames
}
 A feature in this context means an ability of the engine which can be either available or not. More...
 
virtual bool hasFeature (MetaEngineFeature f) const
 Determine whether the engine supports the specified MetaEngine feature. More...
 

Detailed Description

A meta engine is essentially a factory for Engine instances with the added ability of listing and detecting supported games.

Every engine "plugin" provides a hook to get an instance of a MetaEngine subclass for that "engine plugin". E.g. SCUMM povides ScummMetaEngine. This is then in turn used by the frontend code to detect games, and instantiate actual Engine objects.

Definition at line 64 of file metaengine.h.

Member Enumeration Documentation

◆ MetaEngineFeature

A feature in this context means an ability of the engine which can be either available or not.

Enumerator
kSupportsListSaves 

Listing all Save States for a given target is supported, i.e., the listSaves() and getMaximumSaveSlot methods are implemented.

Used for –list-saves support, as well as the GMM load dialog.

kSupportsLoadingDuringStartup 

Loading from the Launcher / command line (-x)

kSupportsDeleteSave 

Deleting Saves from the Launcher (i.e.

implements the removeSaveState() method)

kSavesSupportMetaInfo 

Features meta infos for savestates (i.e.

implements the querySaveMetaInfos method properly).

Engines implementing meta infos always have to provide the following entries in the save state descriptor queried by querySaveMetaInfos:

  • 'is_deletable', which indicates if a given save is safe for deletion
  • 'is_write_protected', which indicates if a given save can be overwritten by the user. (note: of course you do not have to set this, since it defaults to 'false')
kSavesSupportThumbnail 

Features a thumbnail in savegames (i.e.

includes a thumbnail in savestates returned via querySaveMetaInfo). This flag may only be set when 'kSavesSupportMetaInfo' is set.

kSavesSupportCreationDate 

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 'kSavesSupportMetaInfo' is set.

kSavesSupportPlayTime 

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 'kSavesSupportMetaInfo' is set.

kSimpleSavesNames 

Feature is available if engine's saves could be detected with "<target>.###" pattern and "###" corresponds to slot number.

If that's not true or engine is using some unusual way of detecting saves and slot numbers, this should be unavailable. In that case Save/Load dialog for engine's games is locked during cloud saves sync.

Definition at line 186 of file metaengine.h.

Constructor & Destructor Documentation

◆ ~MetaEngine()

virtual MetaEngine::~MetaEngine ( )
inlinevirtual

Definition at line 66 of file metaengine.h.

Member Function Documentation

◆ createInstance()

virtual Common::Error MetaEngine::createInstance ( OSystem syst,
Engine **  engine 
) const
pure virtual

Tries to instantiate an engine instance based on the settings of the currently active ConfMan target.

That is, the MetaEngine should query the ConfMan singleton for the target, gameid, path etc. data.

Parameters
systPointer to the global OSystem object
enginePointer to a pointer which the MetaEngine sets to the newly create Engine, or 0 in case of an error
Returns
a Common::Error describing the error which occurred, or kNoError

Implemented in ScummMetaEngine, AdvancedMetaEngine, SagaMetaEngine, AgosMetaEngine, Sword2MetaEngine, SwordMetaEngine, CineMetaEngine, SkyMetaEngine, GlkMetaEngine, and GobMetaEngine.

◆ detectGames()

virtual DetectedGames MetaEngine::detectGames ( const Common::FSList fslist) const
pure virtual

Runs the engine's game detector on the given list of files, and returns a (possibly empty) list of games supported by the engine which it was able to detect amongst the given files.

Implemented in ScummMetaEngine, AdvancedMetaEngine, Sword2MetaEngine, SwordMetaEngine, SkyMetaEngine, and GlkMetaEngine.

◆ findGame()

virtual PlainGameDescriptor MetaEngine::findGame ( const char *  gameId) const
pure virtual

Query the engine for a PlainGameDescriptor for the specified gameid, if any.

Implemented in ScummMetaEngine, AdvancedMetaEngine, AgosMetaEngine, Sword2MetaEngine, SwordMetaEngine, SkyMetaEngine, and GlkMetaEngine.

◆ getEngineId()

virtual const char* MetaEngine::getEngineId ( ) const
pure virtual

◆ getExtraGuiOptions()

virtual const ExtraGuiOptions MetaEngine::getExtraGuiOptions ( const Common::String target) const
inlinevirtual

Return a list of extra GUI options for the specified target.

If no target is specified, all of the available custom GUI options are Returned for the plugin (used to set default values).

Currently, this only supports options with checkboxes.

The default implementation returns an empty list.

Parameters
targetname of a config manager target
Returns
a list of extra GUI options for an engine plugin and target

Reimplemented in ScummMetaEngine, Drascula::DrasculaMetaEngine, AdvancedMetaEngine, ToltecsMetaEngine, NeverhoodMetaEngine, Sword2MetaEngine, SkyMetaEngine, and Sword25MetaEngine.

Definition at line 134 of file metaengine.h.

◆ getMaximumSaveSlot()

virtual int MetaEngine::getMaximumSaveSlot ( ) const
inlinevirtual

Return the maximum save slot that the engine supports.

Note
MetaEngines must indicate that this function has been implemented via the kSupportsListSaves feature flag.

The default implementation limits the save slots to zero (0).

Returns
maximum save slot number supported

Reimplemented in ScummMetaEngine, Sci::SciMetaEngine, QueenMetaEngine, ComposerMetaEngine, Adl::AdlMetaEngine, Groovie::GroovieMetaEngine, Drascula::DrasculaMetaEngine, StarTrekMetaEngine, ToltecsMetaEngine, ParallactionMetaEngine, LureMetaEngine, AgiMetaEngine, MohawkMetaEngine, NeverhoodMetaEngine, CruiseMetaEngine, TuckerMetaEngine, Wintermute::WintermuteMetaEngine, HDBMetaEngine, KyraMetaEngine, PrinceMetaEngine, SherlockMetaEngine, ToonMetaEngine, MADSMetaEngine, PegasusMetaEngine, TeenAgentMetaEngine, Hugo::HugoMetaEngine, ToucheMetaEngine, FullpipeMetaEngine, TSageMetaEngine, CryOmni3D::CryOmni3DMetaEngine, Lilliput::LilliputMetaEngine, LabMetaEngine, CGE2::CGE2MetaEngine, XeenMetaEngine, CGE::CGEMetaEngine, ChewyMetaEngine, IllusionsMetaEngine, SagaMetaEngine, DM::DMMetaEngine, AgosMetaEngine, HopkinsMetaEngine, MutationOfJBMetaEngine, SupernovaMetaEngine, AccessMetaEngine, TinselMetaEngine, Sword2MetaEngine, DraciMetaEngine, GnapMetaEngine, SwordMetaEngine, CineMetaEngine, Avalanche::AvalancheMetaEngine, BladeRunnerMetaEngine, DreamWebMetaEngine, SkyMetaEngine, BbvsMetaEngine, TonyMetaEngine, VoyeurMetaEngine, MacVenture::MacVentureMetaEngine, ZVisionMetaEngine, TitanicMetaEngine, MortevielleMetaEngine, WageMetaEngine, Sword25MetaEngine, PinkMetaEngine, and GlkMetaEngine.

Definition at line 148 of file metaengine.h.

◆ getOriginalCopyright()

virtual const char* MetaEngine::getOriginalCopyright ( ) const
pure virtual

Returns some copyright information about the original engine.

Implemented in ScummMetaEngine, Sci::SciMetaEngine, QueenMetaEngine, ComposerMetaEngine, Adl::AdlMetaEngine, Groovie::GroovieMetaEngine, Drascula::DrasculaMetaEngine, StarTrekMetaEngine, LastExpress::LastExpressMetaEngine, ParallactionMetaEngine, ToltecsMetaEngine, LureMetaEngine, AgiMetaEngine, MohawkMetaEngine, NeverhoodMetaEngine, CruiseMetaEngine, HDBMetaEngine, KyraMetaEngine, PrinceMetaEngine, ToonMetaEngine, MADSMetaEngine, PegasusMetaEngine, Hugo::HugoMetaEngine, SherlockMetaEngine, ToucheMetaEngine, CryoMetaEngine, FullpipeMetaEngine, CryOmni3D::CryOmni3DMetaEngine, TuckerMetaEngine, Lilliput::LilliputMetaEngine, CGE2::CGE2MetaEngine, LabMetaEngine, XeenMetaEngine, IllusionsMetaEngine, CGE::CGEMetaEngine, ChewyMetaEngine, SagaMetaEngine, HopkinsMetaEngine, AgosMetaEngine, DirectorMetaEngine, SupernovaMetaEngine, DM::DMMetaEngine, Wintermute::WintermuteMetaEngine, MutationOfJBMetaEngine, TeenAgentMetaEngine, AccessMetaEngine, DraciMetaEngine, TinselMetaEngine, Sword2MetaEngine, SludgeMetaEngine, BladeRunnerMetaEngine, GnapMetaEngine, Avalanche::AvalancheMetaEngine, SwordMetaEngine, TSageMetaEngine, CineMetaEngine, PlumbersMetaEngine, DreamWebMetaEngine, BbvsMetaEngine, TonyMetaEngine, VoyeurMetaEngine, SkyMetaEngine, MacVenture::MacVentureMetaEngine, ZVisionMetaEngine, TitanicMetaEngine, MortevielleMetaEngine, WageMetaEngine, MadeMetaEngine, Sword25MetaEngine, PinkMetaEngine, TestbedMetaEngine, GlkMetaEngine, and GobMetaEngine.

◆ getSupportedGames()

virtual PlainGameList MetaEngine::getSupportedGames ( ) const
pure virtual

Returns a list of games supported by this engine.

Implemented in ScummMetaEngine, AdvancedMetaEngine, Sword2MetaEngine, SwordMetaEngine, SkyMetaEngine, and GlkMetaEngine.

◆ hasFeature()

virtual bool MetaEngine::hasFeature ( MetaEngineFeature  f) const
inlinevirtual

Determine whether the engine supports the specified MetaEngine feature.

Used by e.g. the launcher to determine whether to enable the "Load" button.

Reimplemented in ScummMetaEngine, Sci::SciMetaEngine, ComposerMetaEngine, QueenMetaEngine, Adl::AdlMetaEngine, Groovie::GroovieMetaEngine, Drascula::DrasculaMetaEngine, StarTrekMetaEngine, ParallactionMetaEngine, ToltecsMetaEngine, LureMetaEngine, AgiMetaEngine, MohawkMetaEngine, NeverhoodMetaEngine, CruiseMetaEngine, HDBMetaEngine, KyraMetaEngine, PrinceMetaEngine, ToonMetaEngine, SherlockMetaEngine, MADSMetaEngine, Wintermute::WintermuteMetaEngine, Hugo::HugoMetaEngine, PegasusMetaEngine, ToucheMetaEngine, CryoMetaEngine, FullpipeMetaEngine, CryOmni3D::CryOmni3DMetaEngine, Lilliput::LilliputMetaEngine, TuckerMetaEngine, LabMetaEngine, CGE2::CGE2MetaEngine, XeenMetaEngine, CGE::CGEMetaEngine, IllusionsMetaEngine, ChewyMetaEngine, SagaMetaEngine, DM::DMMetaEngine, HopkinsMetaEngine, AgosMetaEngine, SupernovaMetaEngine, MutationOfJBMetaEngine, TeenAgentMetaEngine, TinselMetaEngine, AccessMetaEngine, DraciMetaEngine, Sword2MetaEngine, GnapMetaEngine, CineMetaEngine, Avalanche::AvalancheMetaEngine, BladeRunnerMetaEngine, SwordMetaEngine, TSageMetaEngine, DreamWebMetaEngine, PlumbersMetaEngine, BbvsMetaEngine, TonyMetaEngine, VoyeurMetaEngine, SkyMetaEngine, MacVenture::MacVentureMetaEngine, ZVisionMetaEngine, TitanicMetaEngine, MortevielleMetaEngine, WageMetaEngine, MadeMetaEngine, Sword25MetaEngine, PinkMetaEngine, GlkMetaEngine, and GobMetaEngine.

Definition at line 261 of file metaengine.h.

◆ listSaves()

virtual SaveStateList MetaEngine::listSaves ( const char *  target) const
inlinevirtual

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 has to ensure that this (Meta)Engine is responsible for the specified target (by using findGame on it respectively on the associated gameid from the relevant ConfMan entry, if present).

The default implementation returns an empty list.

Note
MetaEngines must indicate that this function has been implemented via the kSupportsListSaves feature flag.
Parameters
targetname of a config manager target
Returns
a list of save state descriptors

Reimplemented in ScummMetaEngine, Sci::SciMetaEngine, ComposerMetaEngine, QueenMetaEngine, Adl::AdlMetaEngine, Groovie::GroovieMetaEngine, Drascula::DrasculaMetaEngine, StarTrekMetaEngine, ToltecsMetaEngine, ParallactionMetaEngine, LureMetaEngine, AgiMetaEngine, MohawkMetaEngine, NeverhoodMetaEngine, CruiseMetaEngine, HDBMetaEngine, KyraMetaEngine, TuckerMetaEngine, Wintermute::WintermuteMetaEngine, PrinceMetaEngine, SherlockMetaEngine, ToonMetaEngine, MADSMetaEngine, Hugo::HugoMetaEngine, PegasusMetaEngine, ToucheMetaEngine, FullpipeMetaEngine, CryOmni3D::CryOmni3DMetaEngine, Lilliput::LilliputMetaEngine, CGE2::CGE2MetaEngine, LabMetaEngine, XeenMetaEngine, CGE::CGEMetaEngine, IllusionsMetaEngine, ChewyMetaEngine, SagaMetaEngine, DM::DMMetaEngine, TeenAgentMetaEngine, AgosMetaEngine, MutationOfJBMetaEngine, HopkinsMetaEngine, SupernovaMetaEngine, TSageMetaEngine, AccessMetaEngine, TinselMetaEngine, DraciMetaEngine, Sword2MetaEngine, GnapMetaEngine, Avalanche::AvalancheMetaEngine, SwordMetaEngine, CineMetaEngine, BladeRunnerMetaEngine, BbvsMetaEngine, DreamWebMetaEngine, SkyMetaEngine, TonyMetaEngine, VoyeurMetaEngine, MacVenture::MacVentureMetaEngine, ZVisionMetaEngine, TitanicMetaEngine, MortevielleMetaEngine, Sword25MetaEngine, WageMetaEngine, PinkMetaEngine, and GlkMetaEngine.

Definition at line 117 of file metaengine.h.

◆ querySaveMetaInfos()

◆ removeSaveState()

virtual void MetaEngine::removeSaveState ( const char *  target,
int  slot 
) const
inlinevirtual

Remove the specified save state.

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.
Parameters
targetname of a config manager target
slotslot number of the save state to be removed

Reimplemented in ScummMetaEngine, Sci::SciMetaEngine, QueenMetaEngine, Adl::AdlMetaEngine, Groovie::GroovieMetaEngine, Drascula::DrasculaMetaEngine, StarTrekMetaEngine, ToltecsMetaEngine, ParallactionMetaEngine, LureMetaEngine, AgiMetaEngine, MohawkMetaEngine, NeverhoodMetaEngine, CruiseMetaEngine, TuckerMetaEngine, Wintermute::WintermuteMetaEngine, HDBMetaEngine, KyraMetaEngine, DM::DMMetaEngine, SherlockMetaEngine, PrinceMetaEngine, ToonMetaEngine, MADSMetaEngine, TeenAgentMetaEngine, Hugo::HugoMetaEngine, PegasusMetaEngine, ToucheMetaEngine, TSageMetaEngine, FullpipeMetaEngine, CryOmni3D::CryOmni3DMetaEngine, Lilliput::LilliputMetaEngine, CGE2::CGE2MetaEngine, LabMetaEngine, XeenMetaEngine, CGE::CGEMetaEngine, IllusionsMetaEngine, ChewyMetaEngine, SagaMetaEngine, HopkinsMetaEngine, SupernovaMetaEngine, TinselMetaEngine, AccessMetaEngine, Sword2MetaEngine, DraciMetaEngine, GnapMetaEngine, SwordMetaEngine, Avalanche::AvalancheMetaEngine, CineMetaEngine, BladeRunnerMetaEngine, BbvsMetaEngine, DreamWebMetaEngine, SkyMetaEngine, TonyMetaEngine, VoyeurMetaEngine, MacVenture::MacVentureMetaEngine, ZVisionMetaEngine, TitanicMetaEngine, WageMetaEngine, PinkMetaEngine, and GlkMetaEngine.

Definition at line 164 of file metaengine.h.


The documentation for this class was generated from the following file: