-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetection.cpp
112 lines (93 loc) · 3.41 KB
/
detection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*
*/
#include "engines/express/express.h"
namespace Express {
// Titles of the games
static const PlainGameDescriptor ExpressGameTitles[] = {
{"express", "The Last Express"},
{0, 0}
};
// Game descriptions
static const ADGameDescription ExpressGameDescriptions[] = {
// The Last Express - English Demo
{"express", "Demo", {
{"demo.hpf", 0, "baf3b1f64155d34872896e61c3d3cb78", 58191872},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, Common::GUIO_NONE},
// The Last Express - Spanish (from jvprat)
{"express", "", {
{"hd.hpf", 0, "46bed8832f06cf7160883a2aae2d667f", 29657088},
{NULL, 0, NULL, 0}}, Common::ES_ESP, Common::kPlatformPC, 0, Common::GUIO_NONE},
AD_TABLE_END_MARKER
};
// Generic entries for fallback detection
static const ADGameDescription ExpressGameGeneric[] = {
{"express", 0, {{NULL, 0, NULL, 0}}, Common::UNK_LANG, Common::kPlatformUnknown, 0, Common::GUIO_NONE},
AD_TABLE_END_MARKER
};
// File based fallback detection
static const ADFileBasedFallback ExpressFileBasedFallback[] = {
{&ExpressGameGeneric[0], {"hd.hpf", NULL}},
{NULL, {NULL}}
};
static const ADParams detectionParams = {
// Pointer to ADGameDescription or its superset structure
(const byte *)ExpressGameDescriptions,
// Size of that superset structure
sizeof(ADGameDescription),
// Number of bytes to compute MD5 sum for
5000,
// List of all engine targets
ExpressGameTitles,
// Structure for autoupgrading obsolete targets
0,
// Name of single gameid (optional)
"express",
// List of files for file-based fallback detection (optional)
ExpressFileBasedFallback,
// Flags
0,
// GUI Options
Common::GUIO_NOSUBTITLES | Common::GUIO_NOMIDI
//GUIO_NOLAUNCHLOAD?
};
class ExpressMetaEngine : public AdvancedMetaEngine {
public:
ExpressMetaEngine() : AdvancedMetaEngine(detectionParams) {}
const char *getName() const {
return "The Last Express Engine";
}
const char *getOriginalCopyright() const {
return "1997 (C) Smoking Car Productions";
}
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
};
bool ExpressMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
*engine = new Express::ExpressEngine(syst, gd);
return (*engine != NULL);
}
} // End of namespace Express
#if PLUGIN_ENABLED_DYNAMIC(EXPRESS)
REGISTER_PLUGIN_DYNAMIC(EXPRESS, PLUGIN_TYPE_ENGINE, Express::ExpressMetaEngine);
#else
REGISTER_PLUGIN_STATIC(EXPRESS, PLUGIN_TYPE_ENGINE, Express::ExpressMetaEngine);
#endif