1autogen definitions prefs;
2/*------------------------------------------------------------------------.
3| Copyright 2001  Alexandre Duret-Lutz <duret_g@epita.fr>                 |
4|                                                                         |
5| This file is part of Heroes.                                            |
6|                                                                         |
7| Heroes is free software; you can redistribute it and/or modify it under |
8| the terms of the GNU General Public License as published by the Free    |
9| Software Foundation; either version 2 of the License, or (at your       |
10| option) any later version.                                              |
11|                                                                         |
12| Heroes is distributed in the hope that it will be useful, but WITHOUT   |
13| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or   |
14| FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   |
15| for more details.                                                       |
16|                                                                         |
17| You should have received a copy of the GNU General Public License along |
18| with this program; if not, write to the Free Software Foundation, Inc., |
19| 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                   |
20`------------------------------------------------------------------------*/
21
22/*
23** This file describes the preference settings of Heroes.  It is used
24** to generate the preferences saving and loading code.
25**
26** Externally, the preferences are saved as text lines of the form:
27**   name: value
28** and can be arranged into groups (and subgroups, to any depth):
29**  heroes.screen.gamma: 10
30**
31** Internally, the preferences are stored in a flat structure
32** called opt.  So for the user preferences seems to be organized as
33** a tree but it's not actually the case in the code.
34**
35** Group attributes:
36** -----------------
37**  name:     name of the group
38**  verbatim: any verbatim declaration
39**
40** Pref attributes:
41** ----------------
42**  name:    name of the preference
43**  attrib:  name of the corresponding attribute in the struct
44**  array:   size of the array, if this is an array
45**  nodec:   don't declare the attribute in the struct (because
46**           it has been declared with `verbatim', for instance)
47**  type:    the C type for the attribute (types `bool', `a_u8',
48**           `a_u16', `a_u32', are recognized for max and min)
49**  default: default value(s) for attrib
50**  max:     maximum value for attribute (the default depends on `type')
51**  min:     minimum value for attribute (the default depends on `type')
52**  doc:     documentation for this preference
53*/
54
55group = {
56	name = heroes;
57
58	group = {
59		name = screen;
60
61		pref = {
62			name = display_radar;
63			attrib = radar_map;
64			type = bool;
65			default = true;
66			doc = "Whether the radar must be drawn.";
67		};
68		pref = {
69			name = display_infos;
70			attrib = display_infos;
71			type = bool;
72			default = true;
73			doc = "Whether game counters must be drawn.";
74		};
75		pref = {
76			name = gamma;
77			attrib = luminance; /* FIXME: rename to gamma.  */
78			type = a_u8;
79			max = 12;
80			default = 6;
81			doc = "Gamma setting.";
82		};
83		pref = {
84			name = inertia;
85			attrib = inertia;
86			type = bool;
87			default = true;
88			doc = "Whether the camera moves with inertia.";
89		};
90	}; /* screen */
91
92	group = {
93		name = sound;
94
95		pref = {
96			name = music_enable;
97			attrib = music;
98			type = bool;
99			default = true;
100			doc = "Whether music is enabled.";
101		};
102		pref = {
103			name = music_volume;
104			attrib = music_volume;
105			type = a_u8;
106			max = 12;
107			default = 6;
108			doc = "Music volume.";
109		};
110		pref = {
111			name = sfx_enable;
112			attrib = sfx;
113			type = bool;
114			default = true;
115			doc = "Whether sound effects are enabled.";
116		};
117		pref = {
118			name = sfx_volume;
119			attrib = sfx_volume;
120			type = a_u8;
121			max = 12;
122			default = 6;
123			doc = "Sound effects volume.";
124		};
125	}; /* sound */
126
127	group = {
128		name = control;
129
130		pref = {
131			name = player1;
132			attrib = ctrl_one;
133			type = a_u8;
134			default = 0;
135			max = 1;
136			doc = "Control type for player one (0=key, 1=joy).";
137		};
138		pref = {
139			name = autopilot1;
140			attrib = autopilot_one;
141			type = bool;
142			default = true;
143			doc = "Whether player one wants autopilot.";
144		};
145		pref = {
146			name = player2;
147			attrib = ctrl_two;
148			type = a_u8;
149			default = 0;
150			max = 1;
151			doc = "Control type for player two (0=key, 1=joy).";
152		};
153		pref = {
154			name = autopilot2;
155			attrib = autopilot_two;
156			type = bool;
157			default = true;
158			doc = "Whether player two wants autopilot.";
159		};
160	}; /* control */
161
162	group = {
163		name = game;
164
165		pref = {
166			name = speed;
167			attrib = speed;
168			type = a_u8;
169			default = 0;
170			max = 2;
171			doc = "Speed of the game.";
172		};
173		pref = {
174			name = gamerounds;
175			attrib = gamerounds;
176			type = a_u8;
177			default = 4;
178			max = 15;
179			doc = "Index of the number of rounds (not the number"
180			      " itself).";
181		};
182		pref = {
183			name = player_colors;
184			attrib = "player_color";
185			array = 4;
186			type = a_u8;
187			default = 0, 1, 2, 3;
188			max = 4;
189			doc = "Color for players.";
190		};
191	}; /* game */
192
193	group = {
194		name = extras;
195
196		pref = {
197			name = mode;
198			attrib = extras;
199			type = a_u8;
200			default = 0;
201			max = 2;
202			doc = "How extras levels are included.";
203		};
204	}; /* extras */
205
206	group = {
207		name = 'keys_pref_group ()';
208		nameraw;
209		verbatim = "a_keycode            player_keys[2][6];";
210		pref = {
211			name = player1_keys;
212			attrib = "player_keys[0]";
213			array = 6;
214			nodec;
215			type = a_keycode;
216			default = HK_Up, HK_Left, HK_Down, HK_Right,
217			          HK_CtrlR, HK_ShiftR;
218			doc = "Keycodes for player one.";
219		};
220		pref = {
221			name = player2_keys;
222			attrib = "player_keys[1]";
223			array = 6;
224			nodec;
225			type = a_keycode;
226			default = HK_E, HK_S, HK_D, HK_F, HK_CtrlL, HK_ShiftL;
227			doc = "Keycodes for player two.";
228		};
229	}; /* ggi | sdl */
230}; /* heroes */
231