ScummVM API documentation
AdvancedMetaEngine Class Referenceabstract

#include <advancedDetector.h>

Inheritance diagram for AdvancedMetaEngine:
MetaEngine

Public Types

typedef Common::HashMap< Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo > FileMap
 
- Public Types inherited from MetaEngine
enum  MetaEngineFeature {
  kSupportsListSaves, kSupportsLoadingDuringStartup, kSupportsDeleteSave, kSavesSupportMetaInfo,
  kSavesSupportThumbnail, kSavesSupportCreationDate, kSavesSupportPlayTime, kSimpleSavesNames,
  kSavesUseExtendedFormat
}
 

Public Member Functions

virtual Common::Error createInstance (OSystem *syst, Engine **engine) const override
 
virtual bool createInstance (OSystem *syst, Engine **engine, const ADGameDescription *desc) const =0
 
virtual const char * getName () const override=0
 
virtual ADDetectedGame fallbackDetectExtern (uint md5Bytes, const FileMap &allFiles, const Common::FSList &fslist) const
 
bool getFilePropertiesExtern (uint md5Bytes, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const
 
- Public Member Functions inherited from MetaEngine
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
 

Additional Inherited Members

- Static Public Member Functions inherited from MetaEngine
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)
 

Detailed Description

A MetaEngine implementation of AdvancedMetaEngine.

Member Typedef Documentation

◆ FileMap

typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> AdvancedMetaEngine::FileMap

A hashmap of files and their MD5 checksums.

Member Function Documentation

◆ createInstance() [1/2]

virtual Common::Error AdvancedMetaEngine::createInstance ( OSystem *  syst,
Engine **  engine 
) const
overridevirtual

Base createInstance for AdvancedMetaEngine.

The AdvancedMetaEngine provides a default createInstance that is called first, so this should be invoked first. By the time this is called, it is assumed that there is only one plugin engine loaded in memory.

Implements MetaEngine.

◆ createInstance() [2/2]

virtual bool AdvancedMetaEngine::createInstance ( OSystem *  syst,
Engine **  engine,
const ADGameDescription desc 
) const
pure virtual

A createInstance implementation for subclasses. To be called after the base createInstance function above is called.

◆ getName()

virtual const char* AdvancedMetaEngine::getName ( ) const
overridepure virtual

Return the name of the engine plugin based on the engineID.

The the engineID must match the one from MetaEngine.

See also
MetaEngineConnect::getName().

Implements MetaEngine.

◆ fallbackDetectExtern()

virtual ADDetectedGame AdvancedMetaEngine::fallbackDetectExtern ( uint  md5Bytes,
const FileMap allFiles,
const Common::FSList &  fslist 
) const
inlinevirtual

An (optional) generic fallback detection function that is invoked if the regular MD5-based detection failed to detect anything.

Note
This is only meant to be used if fallback detection heavily depends on engine resources.

To use this, implement the intended fallbackDetectExtern inside the relevant MetaEngineConnect class. Then, override the method "fallbackDetect" inside your MetaEngine class. Finally, provide a "hook" to fetch the relevant MetaEngineConnect class and then use the original detection method.

An example of how this is implemented can be found in the Wintermute Engine.

◆ getFilePropertiesExtern()

bool AdvancedMetaEngine::getFilePropertiesExtern ( uint  md5Bytes,
const FileMap allFiles,
const ADGameDescription game,
const Common::String  fname,
FileProperties fileProps 
) const

Get the properties (size and MD5) of this file.

Based on MetaEngine::getFileProperties.


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