#include <advancedDetector.h>
|
typedef Common::HashMap< Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo > | FileMap |
|
|
virtual ADDetectedGame | fallbackDetect (const FileMap &allFiles, const Common::FSList &fslist) const |
|
virtual ADDetectedGames | detectGame (const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const |
|
ADDetectedGame | detectGameFilebased (const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const |
|
void | composeFileHashMap (FileMap &allFiles, const Common::FSList &fslist, int depth, const Common::String &parentName=Common::String()) const |
|
bool | getFileProperties (const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const |
|
virtual DetectedGame | toDetectedGame (const ADDetectedGame &adGame) const |
|
A MetaEngineDetection implementation based on the Advanced Detector code.
◆ FileMap
A hashmap of files and their MD5 checksums.
◆ AdvancedMetaEngineDetection()
◆ getSupportedGames()
PlainGameList AdvancedMetaEngineDetection::getSupportedGames |
( |
| ) |
const |
|
overridevirtual |
Return a list of targets supported by the engine.
Distinguishes engines with a single ID.
Implements MetaEngineDetection.
◆ findGame()
◆ detectGames()
DetectedGames AdvancedMetaEngineDetection::detectGames |
( |
const Common::FSList & |
fslist | ) |
const |
|
overridevirtual |
Run the engine's game detector on the given list of files, and return a (possibly empty) list of games supported by the engine that were found among the given files.
Implements MetaEngineDetection.
◆ createInstance()
Common::Error AdvancedMetaEngineDetection::createInstance |
( |
OSystem * |
syst, |
|
|
Engine ** |
engine |
|
) |
| const |
A generic createInstance.
For instantiating engine objects, this method is called first, and then the subclass implemented createInstance is called from within.
◆ getExtraGuiOptions()
virtual const ExtraGuiOptions AdvancedMetaEngineDetection::getExtraGuiOptions |
( |
const Common::String & |
target | ) |
const |
|
overridevirtual |
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
-
target | Name of a config manager target. |
- Returns
- A list of extra GUI options for an engine plugin and target.
Reimplemented from MetaEngineDetection.
◆ fallbackDetect()
virtual ADDetectedGame AdvancedMetaEngineDetection::fallbackDetect |
( |
const FileMap & |
allFiles, |
|
|
const Common::FSList & |
fslist |
|
) |
| const |
|
inlineprotectedvirtual |
An (optional) generic fallback detection function that is invoked if the regular MD5-based detection failed to detect anything.
◆ detectGame()
virtual ADDetectedGames AdvancedMetaEngineDetection::detectGame |
( |
const Common::FSNode & |
parent, |
|
|
const FileMap & |
allFiles, |
|
|
Common::Language |
language, |
|
|
Common::Platform |
platform, |
|
|
const Common::String & |
extra |
|
) |
| const |
|
protectedvirtual |
Detect games in the specified directory.
Parameters language
and platform
are used to pass the values specified by the user. This is used to restrict search scope.
- Parameters
-
parent | Parent node of this file node. |
allFiles | List of all present files, as computed by the composeFileHashMap. |
language | Restrict results to the specified language. |
platform | Restrict results to the specified platform. |
extra | Restrict results to the specified extra string (only if kADFlagUseExtraAsHint is set). |
- Returns
- A list of ADGameDescription pointers corresponding to the matched games.
◆ detectGameFilebased()
Iterate over all ADFileBasedFallback records inside fileBasedFallback
and return the record (or rather, the ADGameDescription contained in it) for which all files described by it are present, and among those the one with the maximal number of matching files.
In case of a tie, the entry coming first in the list is chosen.
- Parameters
-
allFiles | Map describing all present files |
fileBasedFallback | List of ADFileBasedFallback records, zero-terminated. |
◆ composeFileHashMap()
void AdvancedMetaEngineDetection::composeFileHashMap |
( |
FileMap & |
allFiles, |
|
|
const Common::FSList & |
fslist, |
|
|
int |
depth, |
|
|
const Common::String & |
parentName = Common::String() |
|
) |
| const |
|
protected |
Compose a hashmap of all files in fslist
.
Removes trailing dots and ignores case in the process.
◆ getFileProperties()
Get the properties (size and MD5) of this file.
◆ toDetectedGame()
Convert an AD game description into the shared game description format.
◆ FileMapArchive
friend class FileMapArchive |
|
friend |
◆ _gameDescriptors
const byte* AdvancedMetaEngineDetection::_gameDescriptors |
|
protected |
◆ _descItemSize
const uint AdvancedMetaEngineDetection::_descItemSize |
|
protected |
The size of a single entry of the above descriptions array.
Always must be >= sizeof(ADGameDescription).
◆ _gameIds
A list of all gameids (and their corresponding descriptions) supported by this engine.
◆ _extraGuiOptions
A map containing all the extra game GUI options the engine supports.
◆ _md5Bytes
uint AdvancedMetaEngineDetection::_md5Bytes |
|
protected |
The number of bytes to compute the MD5 checksum for.
The Advanced Detector is primarily based on computing and matching MD5 checksums of files. Since doing that for large files can be slow, it can be restricted to a subset of all files. Typically this will be set to something between 5 and 50 kilobytes, but arbitrary non-zero values are possible. The default is 5000.
◆ _flags
uint32 AdvancedMetaEngineDetection::_flags |
|
protected |
A bitmask of flags which can be used to configure the behavior of the Advanced Detector.
See ADFlags for a list of flags that can be ORed together and passed here.
◆ _guiOptions
Common::String AdvancedMetaEngineDetection::_guiOptions |
|
protected |
A list of game GUI options which will be added to each entry in addition to per-game options.
Refer to GameGUIOption enum for the list.
◆ _maxScanDepth
uint32 AdvancedMetaEngineDetection::_maxScanDepth |
|
protected |
Maximum depth of directories to look up.
If set to 0, the depth is 1 level.
◆ _directoryGlobs
const char* const* AdvancedMetaEngineDetection::_directoryGlobs |
|
protected |
Case-insensitive list of directory globs that can be used for going deeper into the directory structure.
See String::matchString() method for format description.
- Note
- The last item must be 0.
◆ _matchFullPaths
bool AdvancedMetaEngineDetection::_matchFullPaths |
|
protected |
If true, filenames will be matched against the entire path, relative to the root detection directory.
For example: "foo/bar.000" for a file at "<root>/foo/bar.000"). Otherwise, filenames only match the base name (e.g. "bar.000" for the same file).
- Note
_maxScanDepth
and _directoryGlobs
must still be configured to allow the detector to find files inside subdirectories.
◆ _maxAutogenLength
int AdvancedMetaEngineDetection::_maxAutogenLength |
|
protected |
If ADGF_AUTOGENTARGET is used, then this specifies the max length of the autogenerated name. The default is 15.
The documentation for this class was generated from the following file: