ScummVM API documentation
gui_options.h
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 modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (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, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef COMMON_GUI_OPTIONS_H
23#define COMMON_GUI_OPTIONS_H
24
25#include "common/platform.h"
26
27// This is an equivalent of an enum. Feel free to renumerate them
28// They are used only internally for making lookups cheaper and for
29// possibility to concatenate them as codes to the detection tables
30// See the GUIOnn() macros below
31// This is encoded like UTF-8 does with either 1 byte or 2 bytes codepoints
32// 3 and 4 bytes one may be added later
33
34// All simple options are expected to lie in the 0x01-0x7f range
35// The prefixed values lie in the 0x80-0xbf range
36// The options using a 2nd byte suffix lie in the 0xc0-0xdf range
37// The range 0xe0-0xff is reserved for future use
38
39#define GUIO_NONE "\x00"
40#define GUIO_NOSUBTITLES "\x01"
41#define GUIO_NOMUSIC "\x02"
42// GUIO_NOSPEECH is a combination of GUIO_NOSPEECHVOLUME and GUIO_NOSUBTITLES
43#define GUIO_NOSPEECH "\x03"
44#define GUIO_NOSFX "\x04"
45#define GUIO_NOMIDI "\x05"
46#define GUIO_NOLAUNCHLOAD "\x06"
47
48#define GUIO_NOASPECT "\x07"
49
50#define GUIO_LINKSPEECHTOSFX "\x08"
51#define GUIO_LINKMUSICTOSFX "\x09"
52#define GUIO_NOSPEECHVOLUME "\x0a"
53
54#define GUIO_NOLANG "\x0b"
55
56// GUIO flags in range "\x80" - "\xbf" are reserved for prefixed lists of options
57
58// Helper macros to get string for the platform
59// Extra level of indirection required to force macro expansion on some compilers
60#define GET_PLAT_STR_IMPL(val, hex) hex
61#define GET_PLAT_STR_EXPAND(x) GET_PLAT_STR_IMPL x
62#define GET_PLAT_STR(name) GET_PLAT_STR_EXPAND((name))
63
64// Here starts 2 bytes GUIO flags
65// They are made of a category specific prefix in the range 0xc0-0xdf followed by a byte between 0x80-0xbf
66
67#define GUIO_PLATFORM_PREFIX "\xc0"
68
69// Get hex string literal for the given platform
70#define GUIO_PLATFORM(p) GUIO_PLATFORM_PREFIX GET_PLAT_STR(p##_VAL)
71
72#define GUIO_RENDER_PREFIX "\xc1"
73#define GUIO_RENDERHERCGREEN "\xc1\x80"
74#define GUIO_RENDERHERCAMBER "\xc1\x81"
75#define GUIO_RENDERCGA "\xc1\x82"
76#define GUIO_RENDEREGA "\xc1\x83"
77#define GUIO_RENDERVGA "\xc1\x84"
78#define GUIO_RENDERAMIGA "\xc1\x85"
79#define GUIO_RENDERFMTOWNS "\xc1\x86"
80#define GUIO_RENDERPC98_256C "\xc1\x87"
81#define GUIO_RENDERPC98_16C "\xc1\x88"
82#define GUIO_RENDERAPPLE2GS "\xc1\x89"
83#define GUIO_RENDERATARIST "\xc1\x8a"
84#define GUIO_RENDERMACINTOSH "\xc1\x8b"
85#define GUIO_RENDERMACINTOSHBW "\xc1\x8c"
86#define GUIO_RENDERCGACOMP "\xc1\x8d"
87#define GUIO_RENDERCGABW "\xc1\x8e"
88#define GUIO_RENDERCPC "\xc1\x8f"
89#define GUIO_RENDERZX "\xc1\x90"
90#define GUIO_RENDERC64 "\xc1\x91"
91#define GUIO_RENDERVGAGREY "\xc1\x92"
92#define GUIO_RENDERPC98_8C "\xc1\x93"
93#define GUIO_RENDERWIN_256C "\xc1\x94"
94#define GUIO_RENDERWIN_16C "\xc1\x95"
95
96#define GUIO_MIDI_PREFIX "\xc2"
97#define GUIO_MIDIPCSPK "\xc2\x80"
98#define GUIO_MIDICMS "\xc2\x81"
99#define GUIO_MIDIPCJR "\xc2\x82"
100#define GUIO_MIDIADLIB "\xc2\x83"
101#define GUIO_MIDIC64 "\xc2\x84"
102#define GUIO_MIDIAMIGA "\xc2\x85"
103#define GUIO_MIDIAPPLEIIGS "\xc2\x86"
104#define GUIO_MIDITOWNS "\xc2\x87"
105#define GUIO_MIDIPC98 "\xc2\x88"
106#define GUIO_MIDISEGACD "\xc2\x89"
107#define GUIO_MIDIMT32 "\xc2\x8a"
108#define GUIO_MIDIGM "\xc2\x8b"
109#define GUIO_MIDIMAC "\xc2\x8c"
110
111// Special GUIO flags for the AdvancedDetector's caching of game specific
112// options.
113// Putting them to the end of the range so less renumerations required
114#define GUIO_GAME_PREFIX "\xdf"
115#define GUIO_GAMEOPTIONS1 "\xdf\x80"
116#define GUIO_GAMEOPTIONS2 "\xdf\x81"
117#define GUIO_GAMEOPTIONS3 "\xdf\x82"
118#define GUIO_GAMEOPTIONS4 "\xdf\x83"
119#define GUIO_GAMEOPTIONS5 "\xdf\x84"
120#define GUIO_GAMEOPTIONS6 "\xdf\x85"
121#define GUIO_GAMEOPTIONS7 "\xdf\x86"
122#define GUIO_GAMEOPTIONS8 "\xdf\x87"
123#define GUIO_GAMEOPTIONS9 "\xdf\x88"
124#define GUIO_GAMEOPTIONS10 "\xdf\x89"
125#define GUIO_GAMEOPTIONS11 "\xdf\x8a"
126#define GUIO_GAMEOPTIONS12 "\xdf\x8b"
127#define GUIO_GAMEOPTIONS13 "\xdf\x8c"
128#define GUIO_GAMEOPTIONS14 "\xdf\x8d"
129#define GUIO_GAMEOPTIONS15 "\xdf\x8e"
130#define GUIO_GAMEOPTIONS16 "\xdf\x8f"
131#define GUIO_GAMEOPTIONS17 "\xdf\x90"
132#define GUIO_GAMEOPTIONS18 "\xdf\x91"
133#define GUIO_GAMEOPTIONS19 "\xdf\x92"
134#define GUIO_GAMEOPTIONS20 "\xdf\x93"
135#define GUIO_GAMEOPTIONS21 "\xdf\x94"
136#define GUIO_GAMEOPTIONS22 "\xdf\x95"
137#define GUIO_GAMEOPTIONS23 "\xdf\x96"
138#define GUIO_GAMEOPTIONS24 "\xdf\x97"
139#define GUIO_GAMEOPTIONS25 "\xdf\x98"
140#define GUIO_GAMEOPTIONS26 "\xdf\x99"
141#define GUIO_GAMEOPTIONS27 "\xdf\x9a"
142#define GUIO_GAMEOPTIONS28 "\xdf\x9b"
143#define GUIO_GAMEOPTIONS29 "\xdf\x9c"
144#define GUIO_GAMEOPTIONS30 "\xdf\x9d"
145#define GUIO_GAMEOPTIONS31 "\xdf\x9e"
146#define GUIO_GAMEOPTIONS32 "\xdf\x9f"
147
148#define GUIO0() (GUIO_NONE)
149#define GUIO1(a) (a)
150#define GUIO2(a,b) (a b)
151#define GUIO3(a,b,c) (a b c)
152#define GUIO4(a,b,c,d) (a b c d)
153#define GUIO5(a,b,c,d,e) (a b c d e)
154#define GUIO6(a,b,c,d,e,f) (a b c d e f)
155#define GUIO7(a,b,c,d,e,f,g) (a b c d e f g)
156#define GUIO8(a,b,c,d,e,f,g,h) (a b c d e f g h)
157#define GUIO9(a,b,c,d,e,f,g,h,i) (a b c d e f g h i)
158#define GUIO10(a,b,c,d,e,f,g,h,i,j) (a b c d e f g h i j)
159#define GUIO11(a,b,c,d,e,f,g,h,i,j,k) (a b c d e f g h i j k)
160#define GUIO12(a,b,c,d,e,f,g,h,i,j,k,l) (a b c d e f g h i j k l)
161
162namespace Common {
163
173class String;
174
178bool checkGameGUIOption(const String &option, const String &str);
179
184
189
195void updateGameGUIOptions(const String &options, const String &langOption, const String &platOption);
196
199} // End of namespace Common
200
201#endif
Definition: str.h:59
void updateGameGUIOptions(const String &options, const String &langOption, const String &platOption)
String parseGameGUIOptions(const String &str)
bool checkGameGUIOption(const String &option, const String &str)
const String getGameGUIOptionsDescription(const String &options)
Definition: algorithm.h:29