ScummVM API documentation
AdvancedMetaEngine Class Referenceabstract

#include <advancedDetector.h>

Inheritance diagram for AdvancedMetaEngine:
MetaEngine PluginObject AGSMetaEngine CrabMetaEngine Hpl1MetaEngine ImmortalMetaEngine M4MetaEngine TetraedgeMetaEngine TwpMetaEngine UltimaMetaEngine

Public Types

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

Public Member Functions

Common::Error createInstance (OSystem *syst, Engine **engine) override
 
virtual Common::Error createInstance (OSystem *syst, Engine **engine, const ADGameDescription *desc) const =0
 
const char * getName () const override=0
 
virtual ADDetectedGame fallbackDetectExtern (uint md5Bytes, const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra=nullptr) const
 
bool getFilePropertiesExtern (uint md5Bytes, const FileMap &allFiles, MD5Properties md5prop, const Common::Path &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 void registerDefaultSettings (const Common::String &target) const
 
virtual GUI::OptionsContainerWidgetbuildEngineOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
 
virtual Common::AchievementsPlatform getAchievementsPlatform (const Common::String &target) const
 
virtual const Common::AchievementsInfo getAchievementsInfo (const Common::String &target) const
 
virtual const Common::AchievementDescriptionListgetAchievementDescriptionList () const
 
virtual bool hasFeature (MetaEngineFeature f) const
 
void appendExtendedSave (Common::OutSaveFile *saveFile, uint32 playtime, Common::String desc, bool isAutosave)
 
void appendExtendedSaveToStream (Common::WriteStream *saveFile, uint32 playtime, Common::String desc, bool isAutosave, uint32 offset=0)
 
bool copySaveFileToFreeSlot (const char *target, int slot)
 

Protected Member Functions

const ExtraGuiOptions getExtraGuiOptions (const Common::String &target) const override final
 
virtual const ADExtraGuiOptionsMapgetAdvancedExtraGuiOptions () const
 
bool checkExtendedSaves (MetaEngineFeature f) const
 
- Protected Member Functions inherited from MetaEngine
virtual void getSavegameThumbnail (Graphics::Surface &thumb)
 
int findEmptySaveSlot (const char *target)
 

Additional Inherited Members

- Static Public Member Functions inherited from MetaEngine
static void parseSavegameHeader (ExtendedSavegameHeader *header, SaveStateDescriptor *desc)
 
static void fillDummyHeader (ExtendedSavegameHeader *header)
 
static void decodeSavegameDate (const ExtendedSavegameHeader *header, uint16 &outYear, uint8 &outMonth, uint8 &outDay)
 
static void decodeSavegameTime (const ExtendedSavegameHeader *header, uint8 &outHour, uint8 &outMinute)
 
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

Member Function Documentation

◆ createInstance() [1/2]

Common::Error AdvancedMetaEngine::createInstance ( OSystem syst,
Engine **  engine 
)
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 Common::Error 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.

Implemented in M4MetaEngine, UltimaMetaEngine, TetraedgeMetaEngine, ImmortalMetaEngine, AGSMetaEngine, CrabMetaEngine, Hpl1MetaEngine, and TwpMetaEngine.

◆ getName()

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

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

The engineID must match the one from MetaEngine.

See also
MetaEngine::getName().

Implements MetaEngine.

Implemented in M4MetaEngine, UltimaMetaEngine, TetraedgeMetaEngine, ImmortalMetaEngine, AGSMetaEngine, CrabMetaEngine, Hpl1MetaEngine, and TwpMetaEngine.

◆ fallbackDetectExtern()

virtual ADDetectedGame AdvancedMetaEngine::fallbackDetectExtern ( uint  md5Bytes,
const FileMap allFiles,
const Common::FSList fslist,
ADDetectedGameExtraInfo **  extra = nullptr 
) 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 MetaEngine class. Then, override the method "fallbackDetect" inside your MetaEngine class. Finally, provide a "hook" to fetch the relevant MetaEngine 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,
MD5Properties  md5prop,
const Common::Path fname,
FileProperties fileProps 
) const

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

Based on MetaEngine::getFileProperties.

◆ getExtraGuiOptions()

const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions ( const Common::String target) const
finaloverrideprotectedvirtual

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 from MetaEngine.

◆ getAdvancedExtraGuiOptions()

virtual const ADExtraGuiOptionsMap* AdvancedMetaEngine::getAdvancedExtraGuiOptions ( ) const
inlineprotectedvirtual

Returns a map containing all the extra game GUI options the engine supports.

Reimplemented in M4MetaEngine, CrabMetaEngine, TetraedgeMetaEngine, and UltimaMetaEngine.

◆ checkExtendedSaves()

bool AdvancedMetaEngine::checkExtendedSaves ( MetaEngineFeature  f) const
protected

Returns the set of features that need to be enabled for the extended save format to work


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