Ticket #7060: detection.h

File detection.h, 3.3 KB (added by jamie-marchant, 8 years ago)

My 'detection.h' file to make sure we are on the same page.

Line 
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef SCUMM_DETECTION_H
24#define SCUMM_DETECTION_H
25
26#include "common/language.h"
27#include "common/platform.h"
28
29namespace Scumm {
30
31/**
32 * Descriptor of a specific SCUMM game. Used internally to store
33 * information about the tons of game variants that exist.
34 */
35struct GameSettings {
36 /**
37 * The gameid of this game.
38 */
39 const char *gameid;
40
41 /**
42 * An identifier which can be used to distinguish game variants.
43 * This string is also used to augment the description string
44 * generated by the detector, and to search the gameFilenamesTable.
45 * It is also used to search the MD5 table (it matches the "extra"
46 * data in scumm-md5.txt).
47 *
48 * Equal to 0 (zero) *if and only if* the game has precisely one
49 * variant. Failing to obey this rule can lead to odd bugs.
50 */
51 const char *variant;
52
53 /**
54 * An optional string that will be added to the 'preferredtarget'
55 * computed by the detector.
56 */
57 const char *preferredTag;
58
59 /**
60 * The numerical gameid of this game.
61 * This is not in one-to-one correspondence with the gameid above.
62 * But if two games settings have the same id (except for GID_HEGAME),
63 * then they also have the same gameid ; the converse does not hold
64 * in general.
65 */
66 byte id;
67
68 /** The SCUMM version. */
69 byte version;
70
71 /** The HE subversion. */
72 byte heversion;
73
74 /** MidiDriverFlags values */
75 int midi;
76
77 /**
78 * Bitmask obtained by ORing various GameFeatures enums, and used
79 * to en-/disable certain features of this game variant.
80 */
81 uint32 features;
82
83 /**
84 * Platform indicator, this is set to a value different from
85 * kPlatformUnknown if this game variant only existed for this
86 * specific platform.
87 */
88 Common::Platform platform;
89
90 /**
91 * Game GUI options. Used to enable/disable certain GUI widgets
92 */
93 const char *guioptions;
94};
95
96enum FilenameGenMethod {
97 kGenDiskNum,
98 kGenDiskNumSteam,
99 kGenRoomNum,
100 kGenRoomNumSteam,
101 kGenHEMac,
102 kGenHEMacNoParens,
103 kGenHEPC,
104 kGenHEIOS,
105 kGenUnchanged
106};
107
108struct FilenamePattern {
109 const char *pattern;
110 FilenameGenMethod genMethod;
111};
112
113struct GameFilenamePattern {
114 const char *gameid;
115 const char *pattern;
116 FilenameGenMethod genMethod;
117 Common::Language language;
118 Common::Platform platform;
119 const char *variant;
120};
121
122struct DetectorResult {
123 FilenamePattern fp;
124 GameSettings game;
125 Common::Language language;
126 Common::String md5;
127 const char *extra;
128};
129
130} // End of namespace Scumm
131
132
133#endif