Open main menu

Difference between revisions of "Advanced Detector"

144 bytes added ,  15:03, 25 October 2018
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (Text replacement - "</source>" to "</syntaxhighlight>")
Tags: Mobile edit Mobile web edit
(One intermediate revision by the same user not shown)
Line 29: Line 29:


When you look into your .scummvmrc or scummvm.ini (depending on the platform), you will find that generally it has following structure
When you look into your .scummvmrc or scummvm.ini (depending on the platform), you will find that generally it has following structure
<source lang="INI">
<syntaxhighlight lang="INI">
[scummvm]
[scummvm]
globalkey1=foo
globalkey1=foo
Line 41: Line 41:
language=en
language=en
platform=pc
platform=pc
</source>
</syntaxhighlight>


What you see here is several sections designated by identifiers in square brackets and set of key/value pairs belonging to each such section.
What you see here is several sections designated by identifiers in square brackets and set of key/value pairs belonging to each such section.
Line 79: Line 79:
== PlainGameDescriptor table ==
== PlainGameDescriptor table ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct PlainGameDescriptor {
struct PlainGameDescriptor {
const char *gameid;
const char *gameid;
const char *description;
const char *description;
};
};
</source>
</syntaxhighlight>


This table contains all gameids which are known by the engine. Also each gameid contains a full human-readable description, which is used to provide the '''description''' field in the ScummVM configuration file.
This table contains all gameids which are known by the engine. Also each gameid contains a full human-readable description, which is used to provide the '''description''' field in the ScummVM configuration file.
Line 92: Line 92:
Typical PlainGameDescriptor table:
Typical PlainGameDescriptor table:


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const PlainGameDescriptor cineGames[] = {
static const PlainGameDescriptor cineGames[] = {
{"cine", "Cinematique evo.1 engine game"},
{"cine", "Cinematique evo.1 engine game"},
Line 99: Line 99:
{0, 0}
{0, 0}
};
};
</source>
</syntaxhighlight>


Please note that it is NULL-terminated, and also contains the generic gameid ''cine'' which is used by fallback detection.
Please note that it is NULL-terminated, and also contains the generic gameid ''cine'' which is used by fallback detection.
Line 107: Line 107:
ADGameDescription table has the following structure:
ADGameDescription table has the following structure:


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct ADGameDescription {
struct ADGameDescription {
const char *gameid;
const char *gameid;
Line 117: Line 117:
const char *guioptions;
const char *guioptions;
};
};
</source>
</syntaxhighlight>


'''gameid''' -- This is the gameid. Mainly it is used for taking the game description from the ''PlainGameDescriptor'' table.
'''gameid''' -- This is the gameid. Mainly it is used for taking the game description from the ''PlainGameDescriptor'' table.
Line 136: Line 136:
Typical ADGameDescription table will look as follows:
Typical ADGameDescription table will look as follows:


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const ADGameDescription gameDescriptions[] = {
static const ADGameDescription gameDescriptions[] = {
{
{
Line 149: Line 149:
{ AD_TABLE_END_MARKER, 0, 0 }
{ AD_TABLE_END_MARKER, 0, 0 }
};
};
</source>
</syntaxhighlight>


== ADGameFileDescription structure ==
== ADGameFileDescription structure ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
struct ADGameFileDescription {
struct ADGameFileDescription {
const char *fileName; ///< Name of described file.
const char *fileName; ///< Name of described file.
Line 160: Line 160:
int32 fileSize;  ///< Size of the described file. Set to -1 to ignore.
int32 fileSize;  ///< Size of the described file. Set to -1 to ignore.
};
};
</source>
</syntaxhighlight>


'''fileName''' -- name of the file. It is case insensitive, but historically we use lowercase names.
'''fileName''' -- name of the file. It is case insensitive, but historically we use lowercase names.
Line 202: Line 202:
== Upgrading obsolete gameids ==
== Upgrading obsolete gameids ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
         {"simon1acorn", "simon1", Common::kPlatformAcorn},
         {"simon1acorn", "simon1", Common::kPlatformAcorn},
Line 211: Line 211:
         {0, 0, Common::kPlatformUnknown}
         {0, 0, Common::kPlatformUnknown}
};
};
</source>
</syntaxhighlight>


= AdvancedMetaEngine =
= AdvancedMetaEngine =
Line 219: Line 219:
== Engine constructor ==
== Engine constructor ==


<source lang="cpp">
<syntaxhighlight lang="cpp">
AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids);
AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids);
</source>
</syntaxhighlight>


'''descs''' must point to a list of ''ADGameDescription'' structures, or their supersets.
'''descs''' must point to a list of ''ADGameDescription'' structures, or their supersets.
TrustedUser
2,147

edits