ScummVM API documentation
AdvancedMetaEngineBase Class Referenceabstract

#include <advancedDetector.h>

Inheritance diagram for AdvancedMetaEngineBase:
MetaEngine PluginObject AdvancedMetaEngine< Descriptor > AdvancedMetaEngine< ADGameDescription > AdvancedMetaEngine< AGS::AGSGameDescription > AdvancedMetaEngine< M4::M4GameDescription > AdvancedMetaEngine< Twp::TwpGameDescription > AdvancedMetaEngine< Ultima::UltimaGameDescription > BagelMetaEngine CrabMetaEngine DarkseedMetaEngine Hpl1MetaEngine ImmortalMetaEngine QDEngineMetaEngine TetraedgeMetaEngine AGSMetaEngine M4MetaEngine 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, const DetectedGame &gameDescriptor, const void *metaEngineDescriptor) override
 
virtual Common::Error createInstance (OSystem *syst, Engine **engine, const void *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 void deleteInstance (Engine *engine, const DetectedGame &gameDescriptor, const void *meDescriptor)
 
virtual SaveStateList listSaves (const char *target) const
 
SaveStateList listSaves (const char *target, bool saveMode) const
 
virtual int getAutosaveSlot () const
 
virtual int getMaximumSaveSlot () const
 
virtual bool 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 AdvancedMetaEngineBase::createInstance ( OSystem syst,
Engine **  engine,
const DetectedGame gameDescriptor,
const void *  metaEngineDescriptor 
)
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 AdvancedMetaEngineBase::createInstance ( OSystem syst,
Engine **  engine,
const void *  desc 
) const
pure virtual

◆ getName()

const char* AdvancedMetaEngineBase::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, BagelMetaEngine, TetraedgeMetaEngine, AGSMetaEngine, ImmortalMetaEngine, CrabMetaEngine, QDEngineMetaEngine, DarkseedMetaEngine, Hpl1MetaEngine, and TwpMetaEngine.

◆ fallbackDetectExtern()

virtual ADDetectedGame AdvancedMetaEngineBase::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 AdvancedMetaEngineBase::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 AdvancedMetaEngineBase::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* AdvancedMetaEngineBase::getAdvancedExtraGuiOptions ( ) const
inlineprotectedvirtual

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

Reimplemented in M4MetaEngine, BagelMetaEngine, CrabMetaEngine, DarkseedMetaEngine, TetraedgeMetaEngine, and UltimaMetaEngine.

◆ checkExtendedSaves()

bool AdvancedMetaEngineBase::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: