rnd-20051216-2-src
[rocksndiamonds.git] / src / main.h
1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back!               *
3 *----------------------------------------------------------*
4 * (c) 1995-2002 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * main.h                                                   *
12 ***********************************************************/
13
14 #ifndef MAIN_H
15 #define MAIN_H
16
17 #include <time.h>
18 #include <sys/time.h>
19 #include <sys/types.h>
20 #include <sys/stat.h>
21 #include <errno.h>
22 #include <unistd.h>
23 #include <fcntl.h>
24
25 #include "libgame/libgame.h"
26 #include "game_em/game_em.h"
27
28 #include "conf_gfx.h"   /* include auto-generated data structure definitions */
29 #include "conf_snd.h"   /* include auto-generated data structure definitions */
30 #include "conf_mus.h"   /* include auto-generated data structure definitions */
31
32 #define IMG_UNDEFINED                   (-1)
33 #define IMG_EMPTY                       IMG_EMPTY_SPACE
34 #define IMG_SP_EMPTY                    IMG_SP_EMPTY_SPACE
35 #define IMG_EXPLOSION                   IMG_DEFAULT_EXPLODING
36 #define IMG_CHAR_START                  IMG_CHAR_SPACE
37 #define IMG_CUSTOM_START                IMG_CUSTOM_1
38
39 #define SND_UNDEFINED                   (-1)
40 #define MUS_UNDEFINED                   (-1)
41
42 #define WIN_XSIZE                       672
43 #define WIN_YSIZE                       560
44
45 #define SCR_FIELDX                      17
46 #define SCR_FIELDY                      17
47 #define MAX_BUF_XSIZE                   (SCR_FIELDX + 2)
48 #define MAX_BUF_YSIZE                   (SCR_FIELDY + 2)
49 #define MIN_LEV_FIELDX                  3
50 #define MIN_LEV_FIELDY                  3
51 #define STD_LEV_FIELDX                  64
52 #define STD_LEV_FIELDY                  32
53 #define MAX_LEV_FIELDX                  128
54 #define MAX_LEV_FIELDY                  128
55
56 #define SCREENX(a)                      ((a) - scroll_x)
57 #define SCREENY(a)                      ((a) - scroll_y)
58 #define LEVELX(a)                       ((a) + scroll_x)
59 #define LEVELY(a)                       ((a) + scroll_y)
60 #define IN_VIS_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
61 #define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
62 #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
63
64 /* values for configurable properties (custom elem's only, else pre-defined) */
65 #define EP_DIGGABLE                     0
66 #define EP_COLLECTIBLE_ONLY             1
67 #define EP_DONT_RUN_INTO                2
68 #define EP_DONT_COLLIDE_WITH            3
69 #define EP_DONT_TOUCH                   4
70 #define EP_INDESTRUCTIBLE               5
71 #define EP_SLIPPERY                     6
72 #define EP_CAN_CHANGE                   7
73 #define EP_CAN_MOVE                     8
74 #define EP_CAN_FALL                     9
75 #define EP_CAN_SMASH_PLAYER             10
76 #define EP_CAN_SMASH_ENEMIES            11
77 #define EP_CAN_SMASH_EVERYTHING         12
78 #define EP_EXPLODES_BY_FIRE             13
79 #define EP_EXPLODES_SMASHED             14
80 #define EP_EXPLODES_IMPACT              15
81 #define EP_WALKABLE_OVER                16
82 #define EP_WALKABLE_INSIDE              17
83 #define EP_WALKABLE_UNDER               18
84 #define EP_PASSABLE_OVER                19
85 #define EP_PASSABLE_INSIDE              20
86 #define EP_PASSABLE_UNDER               21
87 #define EP_DROPPABLE                    22
88 #define EP_EXPLODES_1X1_OLD             23
89 #define EP_PUSHABLE                     24
90 #define EP_EXPLODES_CROSS_OLD           25
91 #define EP_PROTECTED                    26
92 #define EP_CAN_MOVE_INTO_ACID           27
93 #define EP_THROWABLE                    28
94 #define EP_CAN_EXPLODE                  29
95 #define EP_GRAVITY_REACHABLE            30
96
97 /* values for pre-defined properties */
98 #define EP_PLAYER                       32
99 #define EP_CAN_PASS_MAGIC_WALL          33
100 #define EP_SWITCHABLE                   34
101 #define EP_BD_ELEMENT                   35
102 #define EP_SP_ELEMENT                   36
103 #define EP_SB_ELEMENT                   37
104 #define EP_GEM                          38
105 #define EP_FOOD_DARK_YAMYAM             39
106 #define EP_FOOD_PENGUIN                 40
107 #define EP_FOOD_PIG                     41
108 #define EP_HISTORIC_WALL                42
109 #define EP_HISTORIC_SOLID               43
110 #define EP_CLASSIC_ENEMY                44
111 #define EP_BELT                         45
112 #define EP_BELT_ACTIVE                  46
113 #define EP_BELT_SWITCH                  47
114 #define EP_TUBE                         48
115 #define EP_KEYGATE                      49
116 #define EP_AMOEBOID                     50
117 #define EP_AMOEBALIVE                   51
118 #define EP_HAS_CONTENT                  52
119 #define EP_CAN_TURN_EACH_MOVE           53
120 #define EP_CAN_GROW                     54
121 #define EP_ACTIVE_BOMB                  55
122 #define EP_INACTIVE                     56
123
124 /* values for special configurable properties (depending on level settings) */
125 #define EP_EM_SLIPPERY_WALL             57
126
127 /* values for special graphics properties (no effect on game engine) */
128 #define EP_GFX_CRUMBLED                 58
129
130 /* values for derived properties (determined from properties above) */
131 #define EP_ACCESSIBLE_OVER              59
132 #define EP_ACCESSIBLE_INSIDE            60
133 #define EP_ACCESSIBLE_UNDER             61
134 #define EP_WALKABLE                     62
135 #define EP_PASSABLE                     63
136 #define EP_ACCESSIBLE                   64
137 #define EP_COLLECTIBLE                  65
138 #define EP_SNAPPABLE                    66
139 #define EP_WALL                         67
140 #define EP_SOLID_FOR_PUSHING            68
141 #define EP_DRAGONFIRE_PROOF             69
142 #define EP_EXPLOSION_PROOF              70
143 #define EP_CAN_SMASH                    71
144 #define EP_EXPLODES_3X3_OLD             72
145 #define EP_CAN_EXPLODE_BY_FIRE          73
146 #define EP_CAN_EXPLODE_SMASHED          74
147 #define EP_CAN_EXPLODE_IMPACT           75
148 #define EP_SP_PORT                      76
149 #define EP_CAN_EXPLODE_BY_DRAGONFIRE    77
150 #define EP_CAN_EXPLODE_BY_EXPLOSION     78
151 #define EP_COULD_MOVE_INTO_ACID         79
152 #define EP_MAYBE_DONT_COLLIDE_WITH      80
153
154 /* values for internal purpose only (level editor) */
155 #define EP_WALK_TO_OBJECT               81
156 #define EP_DEADLY                       82
157
158 /* values for internal purpose only (game engine) */
159 #define EP_HAS_ACTION                   83
160 #define EP_CAN_CHANGE_OR_HAS_ACTION     84
161
162 #define NUM_ELEMENT_PROPERTIES          85
163
164 #define NUM_EP_BITFIELDS                ((NUM_ELEMENT_PROPERTIES + 31) / 32)
165 #define EP_BITFIELD_BASE                0
166
167 #define EP_BITMASK_DEFAULT              0
168
169 #define PROPERTY_BIT(p)                 (1 << ((p) % 32))
170 #define PROPERTY_VAR(e,p)               (Properties[e][(p) / 32])
171 #define HAS_PROPERTY(e,p)       ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0)
172 #define SET_PROPERTY(e,p,v)     ((v) ?                                     \
173                                  (PROPERTY_VAR(e,p) |=  PROPERTY_BIT(p)) : \
174                                  (PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p)))
175
176
177 /* values for change events for custom elements (stored in level file) */
178 #define CE_DELAY                        0
179 #define CE_TOUCHED_BY_PLAYER            1
180 #define CE_PRESSED_BY_PLAYER            2
181 #define CE_PUSHED_BY_PLAYER             3
182 #define CE_DROPPED_BY_PLAYER            4
183 #define CE_HITTING_SOMETHING            5
184 #define CE_IMPACT                       6
185 #define CE_SMASHED                      7
186 #define CE_TOUCHING_X                   8
187 #define CE_CHANGE_OF_X                  9
188 #define CE_EXPLOSION_OF_X               10
189 #define CE_PLAYER_TOUCHES_X             11
190 #define CE_PLAYER_PRESSES_X             12
191 #define CE_PLAYER_PUSHES_X              13
192 #define CE_PLAYER_COLLECTS_X            14
193 #define CE_PLAYER_DROPS_X               15
194 #define CE_VALUE_GETS_ZERO              16
195 #define CE_VALUE_GETS_ZERO_OF_X         17
196 #define CE_BY_OTHER_ACTION              18
197 #define CE_BY_DIRECT_ACTION             19
198 #define CE_PLAYER_DIGS_X                20
199 #define CE_ENTERED_BY_PLAYER            21
200 #define CE_LEFT_BY_PLAYER               22
201 #define CE_PLAYER_ENTERS_X              23
202 #define CE_PLAYER_LEAVES_X              24
203 #define CE_SWITCHED                     25
204 #define CE_SWITCH_OF_X                  26
205 #define CE_HIT_BY_SOMETHING             27
206 #define CE_HITTING_X                    28
207 #define CE_HIT_BY_X                     29
208 #define CE_BLOCKED                      30
209
210 #define NUM_CHANGE_EVENTS               31
211
212 #define CE_BITMASK_DEFAULT              0
213
214 #define CH_EVENT_VAR(e,c)               (element_info[e].change->has_event[c])
215 #define CH_ANY_EVENT_VAR(e,c)           (element_info[e].has_change_event[c])
216
217 #define PAGE_HAS_CHANGE_EVENT(p,c)      ((p)->has_event[c])
218 #define HAS_CHANGE_EVENT(e,c)           (IS_CUSTOM_ELEMENT(e) &&        \
219                                          CH_EVENT_VAR(e,c))
220 #define HAS_ANY_CHANGE_EVENT(e,c)       (IS_CUSTOM_ELEMENT(e) &&        \
221                                          CH_ANY_EVENT_VAR(e,c))
222
223 #define SET_CHANGE_EVENT(e,c,v)         (IS_CUSTOM_ELEMENT(e) ?         \
224                                          CH_EVENT_VAR(e,c) = (v) : 0)
225 #define SET_ANY_CHANGE_EVENT(e,c,v)     (IS_CUSTOM_ELEMENT(e) ?         \
226                                          CH_ANY_EVENT_VAR(e,c) = (v) : 0)
227
228 /* values for player bitmasks */
229 #define PLAYER_BITS_NONE                0
230 #define PLAYER_BITS_1                   (1 << 0)
231 #define PLAYER_BITS_2                   (1 << 1)
232 #define PLAYER_BITS_3                   (1 << 2)
233 #define PLAYER_BITS_4                   (1 << 3)
234 #define PLAYER_BITS_ANY                 (PLAYER_BITS_1 | \
235                                          PLAYER_BITS_2 | \
236                                          PLAYER_BITS_3 | \
237                                          PLAYER_BITS_4)
238 #define PLAYER_BITS_TRIGGER             (1 << 4)
239
240 /* values for change side for custom elements */
241 #define CH_SIDE_NONE                    MV_NONE
242 #define CH_SIDE_LEFT                    MV_LEFT
243 #define CH_SIDE_RIGHT                   MV_RIGHT
244 #define CH_SIDE_TOP                     MV_UP
245 #define CH_SIDE_BOTTOM                  MV_DOWN
246 #define CH_SIDE_LEFT_RIGHT              MV_HORIZONTAL
247 #define CH_SIDE_TOP_BOTTOM              MV_VERTICAL
248 #define CH_SIDE_ANY                     MV_ANY_DIRECTION
249
250 /* values for change player for custom elements */
251 #define CH_PLAYER_NONE                  PLAYER_BITS_NONE
252 #define CH_PLAYER_1                     PLAYER_BITS_1
253 #define CH_PLAYER_2                     PLAYER_BITS_2
254 #define CH_PLAYER_3                     PLAYER_BITS_3
255 #define CH_PLAYER_4                     PLAYER_BITS_4
256 #define CH_PLAYER_ANY                   PLAYER_BITS_ANY
257
258 /* values for change page for custom elements */
259 #define CH_PAGE_ANY_FILE                (0xff)
260 #define CH_PAGE_ANY                     (0xffffffff)
261
262 /* values for change power for custom elements */
263 #define CP_WHEN_EMPTY                   0
264 #define CP_WHEN_DIGGABLE                1
265 #define CP_WHEN_DESTRUCTIBLE            2
266 #define CP_WHEN_COLLECTIBLE             3
267 #define CP_WHEN_REMOVABLE               4
268 #define CP_WHEN_WALKABLE                5
269
270 /* values for change actions for custom elements */
271 #define CA_NO_ACTION                    0
272 #define CA_EXIT_PLAYER                  1
273 #define CA_KILL_PLAYER                  2
274 #define CA_RESTART_LEVEL                3
275 #define CA_SHOW_ENVELOPE                4
276 #define CA_ADD_KEY                      5
277 #define CA_REMOVE_KEY                   6
278 #define CA_SET_PLAYER_SPEED             7
279 #define CA_SET_PLAYER_GRAVITY           8
280 #define CA_SET_WIND_DIRECTION           9
281 #define CA_SET_LEVEL_GEMS               10
282 #define CA_SET_LEVEL_TIME               11
283 #define CA_SET_LEVEL_SCORE              12
284 #define CA_SET_CE_SCORE                 13
285 #define CA_SET_CE_VALUE                 14
286 #if 0
287 #define CA_SET_DYNABOMB_NUMBER          15
288 #define CA_SET_DYNABOMB_SIZE            16
289 #define CA_SET_DYNABOMB_POWER           17
290 #endif
291
292 /* values for change action mode for custom elements */
293 #define CA_MODE_UNDEFINED               0
294 #define CA_MODE_SET                     1
295 #define CA_MODE_ADD                     2
296 #define CA_MODE_SUBTRACT                3
297 #define CA_MODE_MULTIPLY                4
298 #define CA_MODE_DIVIDE                  5
299 #define CA_MODE_MODULO                  6
300
301 /* values for change action parameters for custom elements */
302 #define CA_ARG_MIN                      0
303 #define CA_ARG_0                        0
304 #define CA_ARG_1                        1
305 #define CA_ARG_2                        2
306 #define CA_ARG_3                        3
307 #define CA_ARG_4                        4
308 #define CA_ARG_5                        5
309 #define CA_ARG_6                        6
310 #define CA_ARG_7                        7
311 #define CA_ARG_8                        8
312 #define CA_ARG_9                        9
313 #define CA_ARG_10                       10
314 #define CA_ARG_100                      100
315 #define CA_ARG_1000                     1000
316 #define CA_ARG_MAX                      9999
317 #define CA_ARG_PLAYER                   10000
318 #define CA_ARG_PLAYER_1                 (CA_ARG_PLAYER + PLAYER_BITS_1)
319 #define CA_ARG_PLAYER_2                 (CA_ARG_PLAYER + PLAYER_BITS_2)
320 #define CA_ARG_PLAYER_3                 (CA_ARG_PLAYER + PLAYER_BITS_3)
321 #define CA_ARG_PLAYER_4                 (CA_ARG_PLAYER + PLAYER_BITS_4)
322 #define CA_ARG_PLAYER_ANY               (CA_ARG_PLAYER + PLAYER_BITS_ANY)
323 #define CA_ARG_PLAYER_TRIGGER           (CA_ARG_PLAYER + PLAYER_BITS_TRIGGER)
324 #define CA_ARG_PLAYER_HEADLINE          (CA_ARG_PLAYER + 999)
325 #define CA_ARG_NUMBER                   11000
326 #define CA_ARG_NUMBER_MIN               (CA_ARG_NUMBER + 0)
327 #define CA_ARG_NUMBER_MAX               (CA_ARG_NUMBER + 1)
328 #define CA_ARG_NUMBER_RESET             (CA_ARG_NUMBER + 2)
329 #define CA_ARG_NUMBER_CE_SCORE          (CA_ARG_NUMBER + 3)
330 #define CA_ARG_NUMBER_CE_VALUE          (CA_ARG_NUMBER + 4)
331 #define CA_ARG_NUMBER_CE_DELAY          (CA_ARG_NUMBER + 5)
332 #define CA_ARG_NUMBER_HEADLINE          (CA_ARG_NUMBER + 999)
333 #define CA_ARG_ELEMENT                  12000
334 #define CA_ARG_ELEMENT_TARGET           (CA_ARG_ELEMENT + 0)
335 #define CA_ARG_ELEMENT_TRIGGER          (CA_ARG_ELEMENT + 1)
336 #define CA_ARG_ELEMENT_HEADLINE         (CA_ARG_ELEMENT + 999)
337 #define CA_ARG_SPEED                    13000
338 #define CA_ARG_SPEED_VERY_SLOW          (CA_ARG_SPEED + 1)
339 #define CA_ARG_SPEED_SLOW               (CA_ARG_SPEED + 2)
340 #define CA_ARG_SPEED_NORMAL             (CA_ARG_SPEED + 4)
341 #define CA_ARG_SPEED_FAST               (CA_ARG_SPEED + 8)
342 #define CA_ARG_SPEED_VERY_FAST          (CA_ARG_SPEED + 16)
343 #define CA_ARG_SPEED_EVEN_FASTER        (CA_ARG_SPEED + 32)
344 #define CA_ARG_SPEED_SLOWER             (CA_ARG_SPEED + 50)
345 #define CA_ARG_SPEED_FASTER             (CA_ARG_SPEED + 200)
346 #define CA_ARG_SPEED_RESET              (CA_ARG_SPEED + 0)
347 #define CA_ARG_SPEED_HEADLINE           (CA_ARG_SPEED + 999)
348 #define CA_ARG_GRAVITY                  14000
349 #define CA_ARG_GRAVITY_OFF              (CA_ARG_GRAVITY + 0)
350 #define CA_ARG_GRAVITY_ON               (CA_ARG_GRAVITY + 1)
351 #define CA_ARG_GRAVITY_TOGGLE           (CA_ARG_GRAVITY + 2)
352 #define CA_ARG_GRAVITY_HEADLINE         (CA_ARG_GRAVITY + 999)
353 #define CA_ARG_DIRECTION                15000
354 #define CA_ARG_DIRECTION_NONE           (CA_ARG_DIRECTION + MV_NONE)
355 #define CA_ARG_DIRECTION_LEFT           (CA_ARG_DIRECTION + MV_LEFT)
356 #define CA_ARG_DIRECTION_RIGHT          (CA_ARG_DIRECTION + MV_RIGHT)
357 #define CA_ARG_DIRECTION_UP             (CA_ARG_DIRECTION + MV_UP)
358 #define CA_ARG_DIRECTION_DOWN           (CA_ARG_DIRECTION + MV_DOWN)
359 #define CA_ARG_DIRECTION_TRIGGER        (CA_ARG_DIRECTION + MV_ANY_DIRECTION)
360 #define CA_ARG_DIRECTION_HEADLINE       (CA_ARG_DIRECTION + 999)
361 #define CA_ARG_UNDEFINED                19999
362
363 /* values for custom move patterns (bits 0 - 3: basic move directions) */
364 #define MV_BIT_TOWARDS_PLAYER           4
365 #define MV_BIT_AWAY_FROM_PLAYER         5
366 #define MV_BIT_ALONG_LEFT_SIDE          6
367 #define MV_BIT_ALONG_RIGHT_SIDE         7
368 #define MV_BIT_TURNING_LEFT             8
369 #define MV_BIT_TURNING_RIGHT            9
370 #define MV_BIT_WHEN_PUSHED              10
371 #define MV_BIT_MAZE_RUNNER              11
372 #define MV_BIT_MAZE_HUNTER              12
373 #define MV_BIT_WHEN_DROPPED             13
374 #define MV_BIT_TURNING_LEFT_RIGHT       14
375 #define MV_BIT_TURNING_RIGHT_LEFT       15
376 #define MV_BIT_TURNING_RANDOM           16
377 #define MV_BIT_WIND_DIRECTION           17
378
379 /* values for custom move patterns */
380 #define MV_TOWARDS_PLAYER               (1 << MV_BIT_TOWARDS_PLAYER)
381 #define MV_AWAY_FROM_PLAYER             (1 << MV_BIT_AWAY_FROM_PLAYER)
382 #define MV_ALONG_LEFT_SIDE              (1 << MV_BIT_ALONG_LEFT_SIDE)
383 #define MV_ALONG_RIGHT_SIDE             (1 << MV_BIT_ALONG_RIGHT_SIDE)
384 #define MV_TURNING_LEFT                 (1 << MV_BIT_TURNING_LEFT)
385 #define MV_TURNING_RIGHT                (1 << MV_BIT_TURNING_RIGHT)
386 #define MV_WHEN_PUSHED                  (1 << MV_BIT_WHEN_PUSHED)
387 #define MV_MAZE_RUNNER                  (1 << MV_BIT_MAZE_RUNNER)
388 #define MV_MAZE_HUNTER                  (1 << MV_BIT_MAZE_HUNTER)
389 #define MV_MAZE_RUNNER_STYLE            (MV_MAZE_RUNNER | MV_MAZE_HUNTER)
390 #define MV_WHEN_DROPPED                 (1 << MV_BIT_WHEN_DROPPED)
391 #define MV_TURNING_LEFT_RIGHT           (1 << MV_BIT_TURNING_LEFT_RIGHT)
392 #define MV_TURNING_RIGHT_LEFT           (1 << MV_BIT_TURNING_RIGHT_LEFT)
393 #define MV_TURNING_RANDOM               (1 << MV_BIT_TURNING_RANDOM)
394 #define MV_WIND_DIRECTION               (1 << MV_BIT_WIND_DIRECTION)
395
396 /* values for initial move direction (bits 0 - 3: basic move directions) */
397 #define MV_START_BIT_PREVIOUS           4
398
399 /* values for initial move direction */
400 #define MV_START_NONE                   (MV_NONE)
401 #define MV_START_AUTOMATIC              (MV_NONE)
402 #define MV_START_LEFT                   (MV_LEFT)
403 #define MV_START_RIGHT                  (MV_RIGHT)
404 #define MV_START_UP                     (MV_UP)
405 #define MV_START_DOWN                   (MV_DOWN)
406 #define MV_START_RANDOM                 (MV_ALL_DIRECTIONS)
407 #define MV_START_PREVIOUS               (1 << MV_START_BIT_PREVIOUS)
408
409 /* values for elements left behind by custom elements */
410 #define LEAVE_TYPE_UNLIMITED            0
411 #define LEAVE_TYPE_LIMITED              1
412
413 /* values for slippery property for custom elements */
414 #define SLIPPERY_ANY_RANDOM             0
415 #define SLIPPERY_ANY_LEFT_RIGHT         1
416 #define SLIPPERY_ANY_RIGHT_LEFT         2
417 #define SLIPPERY_ONLY_LEFT              3
418 #define SLIPPERY_ONLY_RIGHT             4
419
420 /* values for explosion type for custom elements */
421 #define EXPLODES_3X3                    0
422 #define EXPLODES_1X1                    1
423 #define EXPLODES_CROSS                  2
424
425 /* macros for configurable properties */
426 #define IS_DIGGABLE(e)          HAS_PROPERTY(e, EP_DIGGABLE)
427 #define IS_COLLECTIBLE_ONLY(e)  HAS_PROPERTY(e, EP_COLLECTIBLE_ONLY)
428 #define DONT_RUN_INTO(e)        HAS_PROPERTY(e, EP_DONT_RUN_INTO)
429 #define DONT_COLLIDE_WITH(e)    HAS_PROPERTY(e, EP_DONT_COLLIDE_WITH)
430 #define DONT_TOUCH(e)           HAS_PROPERTY(e, EP_DONT_TOUCH)
431 #define IS_INDESTRUCTIBLE(e)    HAS_PROPERTY(e, EP_INDESTRUCTIBLE)
432 #define IS_SLIPPERY(e)          HAS_PROPERTY(e, EP_SLIPPERY)
433 #define CAN_CHANGE(e)           HAS_PROPERTY(e, EP_CAN_CHANGE)
434 #define CAN_MOVE(e)             HAS_PROPERTY(e, EP_CAN_MOVE)
435 #define CAN_FALL(e)             HAS_PROPERTY(e, EP_CAN_FALL)
436 #define CAN_SMASH_PLAYER(e)     HAS_PROPERTY(e, EP_CAN_SMASH_PLAYER)
437 #define CAN_SMASH_ENEMIES(e)    HAS_PROPERTY(e, EP_CAN_SMASH_ENEMIES)
438 #define CAN_SMASH_EVERYTHING(e) HAS_PROPERTY(e, EP_CAN_SMASH_EVERYTHING)
439 #define EXPLODES_BY_FIRE(e)     HAS_PROPERTY(e, EP_EXPLODES_BY_FIRE)
440 #define EXPLODES_SMASHED(e)     HAS_PROPERTY(e, EP_EXPLODES_SMASHED)
441 #define EXPLODES_IMPACT(e)      HAS_PROPERTY(e, EP_EXPLODES_IMPACT)
442 #define IS_WALKABLE_OVER(e)     HAS_PROPERTY(e, EP_WALKABLE_OVER)
443 #define IS_WALKABLE_INSIDE(e)   HAS_PROPERTY(e, EP_WALKABLE_INSIDE)
444 #define IS_WALKABLE_UNDER(e)    HAS_PROPERTY(e, EP_WALKABLE_UNDER)
445 #define IS_PASSABLE_OVER(e)     HAS_PROPERTY(e, EP_PASSABLE_OVER)
446 #define IS_PASSABLE_INSIDE(e)   HAS_PROPERTY(e, EP_PASSABLE_INSIDE)
447 #define IS_PASSABLE_UNDER(e)    HAS_PROPERTY(e, EP_PASSABLE_UNDER)
448 #define IS_DROPPABLE(e)         HAS_PROPERTY(e, EP_DROPPABLE)
449 #define EXPLODES_1X1_OLD(e)     HAS_PROPERTY(e, EP_EXPLODES_1X1_OLD)
450 #define IS_PUSHABLE(e)          HAS_PROPERTY(e, EP_PUSHABLE)
451 #define EXPLODES_CROSS_OLD(e)   HAS_PROPERTY(e, EP_EXPLODES_CROSS_OLD)
452 #define IS_PROTECTED(e)         HAS_PROPERTY(e, EP_PROTECTED)
453 #define CAN_MOVE_INTO_ACID(e)   HAS_PROPERTY(e, EP_CAN_MOVE_INTO_ACID)
454 #define IS_THROWABLE(e)         HAS_PROPERTY(e, EP_THROWABLE)
455 #define CAN_EXPLODE(e)          HAS_PROPERTY(e, EP_CAN_EXPLODE)
456 #define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE)
457
458 /* macros for special configurable properties */
459 #define IS_EM_SLIPPERY_WALL(e)  HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL)
460
461 /* macros for special graphics properties */
462 #define GFX_CRUMBLED(e)         HAS_PROPERTY(GFX_ELEMENT(e), EP_GFX_CRUMBLED)
463
464 /* macros for pre-defined properties */
465 #define ELEM_IS_PLAYER(e)       HAS_PROPERTY(e, EP_PLAYER)
466 #define CAN_PASS_MAGIC_WALL(e)  HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL)
467 #define IS_SWITCHABLE(e)        HAS_PROPERTY(e, EP_SWITCHABLE)
468 #define IS_BD_ELEMENT(e)        HAS_PROPERTY(e, EP_BD_ELEMENT)
469 #define IS_SP_ELEMENT(e)        HAS_PROPERTY(e, EP_SP_ELEMENT)
470 #define IS_SB_ELEMENT(e)        HAS_PROPERTY(e, EP_SB_ELEMENT)
471 #define IS_GEM(e)               HAS_PROPERTY(e, EP_GEM)
472 #define IS_FOOD_DARK_YAMYAM(e)  HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM)
473 #define IS_FOOD_PENGUIN(e)      HAS_PROPERTY(e, EP_FOOD_PENGUIN)
474 #define IS_FOOD_PIG(e)          HAS_PROPERTY(e, EP_FOOD_PIG)
475 #define IS_HISTORIC_WALL(e)     HAS_PROPERTY(e, EP_HISTORIC_WALL)
476 #define IS_HISTORIC_SOLID(e)    HAS_PROPERTY(e, EP_HISTORIC_SOLID)
477 #define IS_CLASSIC_ENEMY(e)     HAS_PROPERTY(e, EP_CLASSIC_ENEMY)
478 #define IS_BELT(e)              HAS_PROPERTY(e, EP_BELT)
479 #define IS_BELT_ACTIVE(e)       HAS_PROPERTY(e, EP_BELT_ACTIVE)
480 #define IS_BELT_SWITCH(e)       HAS_PROPERTY(e, EP_BELT_SWITCH)
481 #define IS_TUBE(e)              HAS_PROPERTY(e, EP_TUBE)
482 #define IS_KEYGATE(e)           HAS_PROPERTY(e, EP_KEYGATE)
483 #define IS_AMOEBOID(e)          HAS_PROPERTY(e, EP_AMOEBOID)
484 #define IS_AMOEBALIVE(e)        HAS_PROPERTY(e, EP_AMOEBALIVE)
485 #define HAS_CONTENT(e)          HAS_PROPERTY(e, EP_HAS_CONTENT)
486 #define CAN_TURN_EACH_MOVE(e)   HAS_PROPERTY(e, EP_CAN_TURN_EACH_MOVE)
487 #define CAN_GROW(e)             HAS_PROPERTY(e, EP_CAN_GROW)
488 #define IS_ACTIVE_BOMB(e)       HAS_PROPERTY(e, EP_ACTIVE_BOMB)
489 #define IS_INACTIVE(e)          HAS_PROPERTY(e, EP_INACTIVE)
490
491 /* macros for derived properties */
492 #define IS_ACCESSIBLE_OVER(e)   HAS_PROPERTY(e, EP_ACCESSIBLE_OVER)
493 #define IS_ACCESSIBLE_INSIDE(e) HAS_PROPERTY(e, EP_ACCESSIBLE_INSIDE)
494 #define IS_ACCESSIBLE_UNDER(e)  HAS_PROPERTY(e, EP_ACCESSIBLE_UNDER)
495 #define IS_WALKABLE(e)          HAS_PROPERTY(e, EP_WALKABLE)
496 #define IS_PASSABLE(e)          HAS_PROPERTY(e, EP_PASSABLE)
497 #define IS_ACCESSIBLE(e)        HAS_PROPERTY(e, EP_ACCESSIBLE)
498 #define IS_COLLECTIBLE(e)       HAS_PROPERTY(e, EP_COLLECTIBLE)
499 #define IS_SNAPPABLE(e)         HAS_PROPERTY(e, EP_SNAPPABLE)
500 #define IS_WALL(e)              HAS_PROPERTY(e, EP_WALL)
501 #define IS_SOLID_FOR_PUSHING(e) HAS_PROPERTY(e, EP_SOLID_FOR_PUSHING)
502 #define IS_DRAGONFIRE_PROOF(e)  HAS_PROPERTY(e, EP_DRAGONFIRE_PROOF)
503 #define IS_EXPLOSION_PROOF(e)   HAS_PROPERTY(e, EP_EXPLOSION_PROOF)
504 #define CAN_SMASH(e)            HAS_PROPERTY(e, EP_CAN_SMASH)
505 #define EXPLODES_3X3_OLD(e)     HAS_PROPERTY(e, EP_EXPLODES_3X3_OLD)
506 #define CAN_EXPLODE_BY_FIRE(e)  HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE)
507 #define CAN_EXPLODE_SMASHED(e)  HAS_PROPERTY(e, EP_CAN_EXPLODE_SMASHED)
508 #define CAN_EXPLODE_IMPACT(e)   HAS_PROPERTY(e, EP_CAN_EXPLODE_IMPACT)
509 #define IS_SP_PORT(e)           HAS_PROPERTY(e, EP_SP_PORT)
510 #define CAN_EXPLODE_BY_DRAGONFIRE(e)    \
511                                 HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_DRAGONFIRE)
512 #define CAN_EXPLODE_BY_EXPLOSION(e)     \
513                                 HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION)
514 #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID)
515 #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH)
516 #define HAS_ACTION(e)           HAS_PROPERTY(e, EP_HAS_ACTION)
517 #define CAN_CHANGE_OR_HAS_ACTION(e)     \
518                                 HAS_PROPERTY(e, EP_CAN_CHANGE_OR_HAS_ACTION)
519
520 /* special macros used in game engine */
521 #define IS_CUSTOM_ELEMENT(e)    ((e) >= EL_CUSTOM_START &&              \
522                                  (e) <= EL_CUSTOM_END)
523
524 #define IS_GROUP_ELEMENT(e)     ((e) >= EL_GROUP_START &&               \
525                                  (e) <= EL_GROUP_END)
526
527 #define IS_CLIPBOARD_ELEMENT(e) ((e) >= EL_INTERNAL_CLIPBOARD_START &&  \
528                                  (e) <= EL_INTERNAL_CLIPBOARD_END)
529
530 #define IS_INTERNAL_ELEMENT(e)  ((e) >= EL_INTERNAL_START &&            \
531                                  (e) <= EL_INTERNAL_END)
532
533 #define IS_ENVELOPE(e)          ((e) >= EL_ENVELOPE_1 &&                \
534                                  (e) <= EL_ENVELOPE_4)
535
536 #define IS_RND_KEY(e)           ((e) >= EL_KEY_1 &&                     \
537                                  (e) <= EL_KEY_4)
538 #define IS_EM_KEY(e)            ((e) >= EL_EM_KEY_1 &&                  \
539                                  (e) <= EL_EM_KEY_4)
540 #define IS_EMC_KEY(e)           ((e) >= EL_EMC_KEY_5 &&                 \
541                                  (e) <= EL_EMC_KEY_8)
542 #define IS_KEY(e)               (IS_RND_KEY(e) ||                       \
543                                  IS_EM_KEY(e) ||                        \
544                                  IS_EMC_KEY(e))
545 #define RND_KEY_NR(e)           ((e) - EL_KEY_1)
546 #define EM_KEY_NR(e)            ((e) - EL_EM_KEY_1)
547 #define EMC_KEY_NR(e)           ((e) - EL_EMC_KEY_5 + 4)
548 #define KEY_NR(e)               (IS_RND_KEY(e) ? RND_KEY_NR(e) :        \
549                                  IS_EM_KEY(e) ?  EM_KEY_NR(e) :         \
550                                  IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
551
552 #define IS_RND_GATE(e)          ((e) >= EL_GATE_1 &&                    \
553                                  (e) <= EL_GATE_4)
554 #define IS_EM_GATE(e)           ((e) >= EL_EM_GATE_1 &&                 \
555                                  (e) <= EL_EM_GATE_4)
556 #define IS_EMC_GATE(e)          ((e) >= EL_EMC_GATE_5 &&                \
557                                  (e) <= EL_EMC_GATE_8)
558 #define IS_GATE(e)              (IS_RND_GATE(e) ||                      \
559                                  IS_EM_GATE(e) ||                       \
560                                  IS_EMC_GATE(e))
561 #define RND_GATE_NR(e)          ((e) - EL_GATE_1)
562 #define EM_GATE_NR(e)           ((e) - EL_EM_GATE_1)
563 #define EMC_GATE_NR(e)          ((e) - EL_EMC_GATE_5 + 4)
564 #define GATE_NR(e)              (IS_RND_GATE(e) ? RND_GATE_NR(e) :      \
565                                  IS_EM_GATE(e) ?  EM_GATE_NR(e) :       \
566                                  IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0)
567
568 #define IS_RND_GATE_GRAY(e)     ((e) >= EL_GATE_1_GRAY &&               \
569                                  (e) <= EL_GATE_4_GRAY)
570 #define IS_EM_GATE_GRAY(e)      ((e) >= EL_EM_GATE_1_GRAY &&            \
571                                  (e) <= EL_EM_GATE_4_GRAY)
572 #define IS_EMC_GATE_GRAY(e)     ((e) >= EL_EMC_GATE_5_GRAY &&           \
573                                  (e) <= EL_EMC_GATE_8_GRAY)
574 #define IS_GATE_GRAY(e)         (IS_RND_GATE_GRAY(e) ||                 \
575                                  IS_EM_GATE_GRAY(e) ||                  \
576                                  IS_EMC_GATE_GRAY(e))
577 #define RND_GATE_GRAY_NR(e)     ((e) - EL_GATE_1_GRAY)
578 #define EM_GATE_GRAY_NR(e)      ((e) - EL_EM_GATE_1_GRAY)
579 #define EMC_GATE_GRAY_NR(e)     ((e) - EL_EMC_GATE_5_GRAY + 4)
580 #define GATE_GRAY_NR(e)         (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) :  \
581                                  IS_EM_GATE_GRAY(e) ?  EM_GATE_GRAY_NR(e) :   \
582                                  IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0)
583
584 #define GFX_ELEMENT(e)          (element_info[e].use_gfx_element ?      \
585                                  element_info[e].gfx_element : e)
586
587 /* !!! "use sound" deactivated due to problems with level "bug machine" !!! */
588 /* (solution: add separate "use sound of element" to level file and editor) */
589 #if 0
590 #define SND_ELEMENT(e)          GFX_ELEMENT(e)
591 #else
592 #define SND_ELEMENT(e)          (e)
593 #endif
594
595 #define IS_PLAYER(x, y)         (ELEM_IS_PLAYER(StorePlayer[x][y]))
596
597 #define IS_FREE(x, y)           (Feld[x][y] == EL_EMPTY && !IS_PLAYER(x, y))
598 #define IS_FREE_OR_PLAYER(x, y) (Feld[x][y] == EL_EMPTY)
599
600 #define IS_MOVING(x,y)          (MovPos[x][y] != 0)
601 #define IS_FALLING(x,y)         (MovPos[x][y] != 0 && MovDir[x][y] == MV_DOWN)
602 #define IS_BLOCKED(x,y)         (Feld[x][y] == EL_BLOCKED)
603
604 #define EL_CHANGED(e)           ((e) == EL_ROCK           ? EL_EMERALD :    \
605                                  (e) == EL_BD_ROCK        ? EL_BD_DIAMOND : \
606                                  (e) == EL_EMERALD        ? EL_DIAMOND :    \
607                                  (e) == EL_EMERALD_YELLOW ? EL_DIAMOND :    \
608                                  (e) == EL_EMERALD_RED    ? EL_DIAMOND :    \
609                                  (e) == EL_EMERALD_PURPLE ? EL_DIAMOND :    \
610                                  EL_ROCK)
611 #define EL_CHANGED2(e)          ((e) == EL_ROCK           ? EL_BD_DIAMOND : \
612                                  (e) == EL_BD_ROCK        ? EL_BD_DIAMOND : \
613                                  EL_BD_ROCK)
614 #define IS_DRAWABLE(e)          ((e) < EL_BLOCKED)
615 #define IS_NOT_DRAWABLE(e)      ((e) >= EL_BLOCKED)
616 #define TAPE_IS_EMPTY(x)        ((x).length == 0)
617 #define TAPE_IS_STOPPED(x)      (!(x).recording && !(x).playing)
618
619 #define PLAYERINFO(x,y)         (&stored_player[StorePlayer[x][y]-EL_PLAYER_1])
620 #define SHIELD_ON(p)            ((p)->shield_normal_time_left > 0)
621
622 #define ENEMY_PROTECTED_FIELD(x,y)      (IS_PROTECTED(Feld[x][y]) ||       \
623                                          IS_PROTECTED(Back[x][y]))
624 #define EXPLOSION_PROTECTED_FIELD(x,y)  (IS_EXPLOSION_PROOF(Feld[x][y]))
625 #define PLAYER_ENEMY_PROTECTED(x,y)     (SHIELD_ON(PLAYERINFO(x, y)) ||    \
626                                          ENEMY_PROTECTED_FIELD(x, y))
627 #define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) ||    \
628                                          EXPLOSION_PROTECTED_FIELD(x, y))
629
630 #define PLAYER_SWITCHING(p,x,y) ((p)->is_switching &&                   \
631                                  (p)->switch_x == (x) && (p)->switch_y == (y))
632
633 #define PLAYER_DROPPING(p,x,y)  ((p)->is_dropping &&                    \
634                                  (p)->drop_x == (x) && (p)->drop_y == (y))
635
636 #define PLAYER_NR_GFX(g,i)      ((g) + i * (IMG_PLAYER_2 - IMG_PLAYER_1))
637
638 #define ANIM_FRAMES(g)          (graphic_info[g].anim_frames)
639 #define ANIM_DELAY(g)           (graphic_info[g].anim_delay)
640 #define ANIM_MODE(g)            (graphic_info[g].anim_mode)
641
642 #define IS_ANIMATED(g)          (ANIM_FRAMES(g) > 1)
643 #define IS_NEW_DELAY(f, g)      ((f) % ANIM_DELAY(g) == 0)
644 #define IS_NEW_FRAME(f, g)      (IS_ANIMATED(g) && IS_NEW_DELAY(f, g))
645 #define IS_NEXT_FRAME(f, g)     (IS_NEW_FRAME(f, g) && (f) > 0)
646
647 #define IS_LOOP_SOUND(s)        (sound_info[s].loop)
648
649
650 /* fundamental game speed values */
651 #define ONE_SECOND_DELAY        1000    /* delay value for one second */
652 #define GAME_FRAME_DELAY        20      /* frame delay in milliseconds */
653 #define FFWD_FRAME_DELAY        10      /* 200% speed for fast forward */
654 #define FRAMES_PER_SECOND       (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
655 #define MICROLEVEL_SCROLL_DELAY 50      /* delay for scrolling micro level */
656 #define MICROLEVEL_LABEL_DELAY  250     /* delay for micro level label */
657
658 /* boundaries of arrays etc. */
659 #define MAX_LEVEL_NAME_LEN      32
660 #define MAX_LEVEL_AUTHOR_LEN    32
661 #define MAX_ELEMENT_NAME_LEN    32
662 #define MAX_TAPE_LEN            (1000 * FRAMES_PER_SECOND) /* max.time x fps */
663 #define MAX_TAPES_PER_SET       1024
664 #define MAX_SCORE_ENTRIES       100
665 #define MAX_NUM_AMOEBA          100
666 #define MAX_INVENTORY_SIZE      1000
667 #define STD_NUM_KEYS            4
668 #define MAX_NUM_KEYS            8
669 #define NUM_BELTS               4
670 #define NUM_BELT_PARTS          3
671 #define MIN_ENVELOPE_XSIZE      1
672 #define MIN_ENVELOPE_YSIZE      1
673 #define MAX_ENVELOPE_XSIZE      30
674 #define MAX_ENVELOPE_YSIZE      20
675 #define MAX_ENVELOPE_TEXT_LEN   (MAX_ENVELOPE_XSIZE * MAX_ENVELOPE_YSIZE)
676 #define MIN_CHANGE_PAGES        1
677 #define MAX_CHANGE_PAGES        32
678 #define MIN_ELEMENTS_IN_GROUP   1
679 #define MAX_ELEMENTS_IN_GROUP   16
680
681 /* values for elements with content */
682 #define MIN_ELEMENT_CONTENTS    1
683 #define STD_ELEMENT_CONTENTS    4
684 #define MAX_ELEMENT_CONTENTS    8
685
686 #define LEVEL_SCORE_ELEMENTS    16      /* level elements with score */
687
688 /* often used screen positions */
689 #define SX                      8
690 #define SY                      8
691 #define REAL_SX                 (SX - 2)
692 #define REAL_SY                 (SY - 2)
693 #define DX                      566
694 #define DY                      60
695 #define VX                      DX
696 #define VY                      400
697 #define EX                      DX
698 #define EY                      (VY - 44)
699 #define TILESIZE                32
700 #define TILEX                   TILESIZE
701 #define TILEY                   TILESIZE
702 #define MINI_TILESIZE           (TILESIZE / 2)
703 #define MINI_TILEX              MINI_TILESIZE
704 #define MINI_TILEY              MINI_TILESIZE
705 #define MICRO_TILESIZE          (TILESIZE / 8)
706 #define MICRO_TILEX             MICRO_TILESIZE
707 #define MICRO_TILEY             MICRO_TILESIZE
708 #define MIDPOSX                 (SCR_FIELDX / 2)
709 #define MIDPOSY                 (SCR_FIELDY / 2)
710 #define SXSIZE                  (SCR_FIELDX * TILEX)
711 #define SYSIZE                  (SCR_FIELDY * TILEY)
712 #define FXSIZE                  ((SCR_FIELDX + 2) * TILEX)
713 #define FYSIZE                  ((SCR_FIELDY + 2) * TILEY)
714 #define DXSIZE                  100
715 #define DYSIZE                  280
716 #define VXSIZE                  DXSIZE
717 #define VYSIZE                  100
718 #define EXSIZE                  DXSIZE
719 #define EYSIZE                  (VYSIZE + 44)
720 #define FULL_SXSIZE             (2 + SXSIZE + 2)
721 #define FULL_SYSIZE             (2 + SYSIZE + 2)
722 #define MICROLEVEL_XSIZE        ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
723 #define MICROLEVEL_YSIZE        ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
724 #define MICROLEVEL_XPOS         (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2)
725 #define MICROLEVEL_YPOS         (SX + 12 * TILEY - MICRO_TILEY)
726 #define MICROLABEL1_YPOS        (MICROLEVEL_YPOS - 36)
727 #define MICROLABEL2_YPOS        (MICROLEVEL_YPOS + MICROLEVEL_YSIZE + 7)
728
729
730 /* score for elements */
731 #define SC_EMERALD              0
732 #define SC_DIAMOND              1
733 #define SC_BUG                  2
734 #define SC_SPACESHIP            3
735 #define SC_YAMYAM               4
736 #define SC_ROBOT                5
737 #define SC_PACMAN               6
738 #define SC_NUT                  7
739 #define SC_DYNAMITE             8
740 #define SC_KEY                  9
741 #define SC_TIME_BONUS           10
742 #define SC_CRYSTAL              11
743 #define SC_PEARL                12
744 #define SC_SHIELD               13
745
746
747 /* "real" level file elements */
748 #define EL_UNDEFINED                    -1
749
750 #define EL_EMPTY_SPACE                  0
751 #define EL_EMPTY                        EL_EMPTY_SPACE
752 #define EL_SAND                         1
753 #define EL_WALL                         2
754 #define EL_WALL_SLIPPERY                3
755 #define EL_ROCK                         4
756 #define EL_KEY_OBSOLETE                 5       /* obsolete; now EL_KEY_1 */
757 #define EL_EMERALD                      6
758 #define EL_EXIT_CLOSED                  7
759 #define EL_PLAYER_OBSOLETE              8       /* obsolete; now EL_PLAYER_1 */
760 #define EL_BUG                          9
761 #define EL_SPACESHIP                    10
762 #define EL_YAMYAM                       11
763 #define EL_ROBOT                        12
764 #define EL_STEELWALL                    13
765 #define EL_DIAMOND                      14
766 #define EL_AMOEBA_DEAD                  15
767 #define EL_QUICKSAND_EMPTY              16
768 #define EL_QUICKSAND_FULL               17
769 #define EL_AMOEBA_DROP                  18
770 #define EL_BOMB                         19
771 #define EL_MAGIC_WALL                   20
772 #define EL_SPEED_PILL                   21
773 #define EL_ACID                         22
774 #define EL_AMOEBA_WET                   23
775 #define EL_AMOEBA_DRY                   24
776 #define EL_NUT                          25
777 #define EL_GAME_OF_LIFE                 26
778 #define EL_BIOMAZE                      27
779 #define EL_DYNAMITE_ACTIVE              28
780 #define EL_STONEBLOCK                   29
781 #define EL_ROBOT_WHEEL                  30
782 #define EL_ROBOT_WHEEL_ACTIVE           31
783 #define EL_KEY_1                        32
784 #define EL_KEY_2                        33
785 #define EL_KEY_3                        34
786 #define EL_KEY_4                        35
787 #define EL_GATE_1                       36
788 #define EL_GATE_2                       37
789 #define EL_GATE_3                       38
790 #define EL_GATE_4                       39
791 #define EL_GATE_1_GRAY                  40
792 #define EL_GATE_2_GRAY                  41
793 #define EL_GATE_3_GRAY                  42
794 #define EL_GATE_4_GRAY                  43
795 #define EL_DYNAMITE                     44
796 #define EL_PACMAN                       45
797 #define EL_INVISIBLE_WALL               46
798 #define EL_LAMP                         47
799 #define EL_LAMP_ACTIVE                  48
800 #define EL_WALL_EMERALD                 49
801 #define EL_WALL_DIAMOND                 50
802 #define EL_AMOEBA_FULL                  51
803 #define EL_BD_AMOEBA                    52
804 #define EL_TIME_ORB_FULL                53
805 #define EL_TIME_ORB_EMPTY               54
806 #define EL_EXPANDABLE_WALL              55
807 #define EL_BD_DIAMOND                   56
808 #define EL_EMERALD_YELLOW               57
809 #define EL_WALL_BD_DIAMOND              58
810 #define EL_WALL_EMERALD_YELLOW          59
811 #define EL_DARK_YAMYAM                  60
812 #define EL_BD_MAGIC_WALL                61
813 #define EL_INVISIBLE_STEELWALL          62
814 #define EL_SOKOBAN_FIELD_PLAYER         63
815 #define EL_DYNABOMB_INCREASE_NUMBER     64
816 #define EL_DYNABOMB_INCREASE_SIZE       65
817 #define EL_DYNABOMB_INCREASE_POWER      66
818 #define EL_SOKOBAN_OBJECT               67
819 #define EL_SOKOBAN_FIELD_EMPTY          68
820 #define EL_SOKOBAN_FIELD_FULL           69
821 #define EL_BD_BUTTERFLY_RIGHT           70
822 #define EL_BD_BUTTERFLY_UP              71
823 #define EL_BD_BUTTERFLY_LEFT            72
824 #define EL_BD_BUTTERFLY_DOWN            73
825 #define EL_BD_FIREFLY_RIGHT             74
826 #define EL_BD_FIREFLY_UP                75
827 #define EL_BD_FIREFLY_LEFT              76
828 #define EL_BD_FIREFLY_DOWN              77
829 #define EL_BD_BUTTERFLY_1               EL_BD_BUTTERFLY_DOWN
830 #define EL_BD_BUTTERFLY_2               EL_BD_BUTTERFLY_LEFT
831 #define EL_BD_BUTTERFLY_3               EL_BD_BUTTERFLY_UP
832 #define EL_BD_BUTTERFLY_4               EL_BD_BUTTERFLY_RIGHT
833 #define EL_BD_FIREFLY_1                 EL_BD_FIREFLY_LEFT
834 #define EL_BD_FIREFLY_2                 EL_BD_FIREFLY_DOWN
835 #define EL_BD_FIREFLY_3                 EL_BD_FIREFLY_RIGHT
836 #define EL_BD_FIREFLY_4                 EL_BD_FIREFLY_UP
837 #define EL_BD_BUTTERFLY                 78
838 #define EL_BD_FIREFLY                   79
839 #define EL_PLAYER_1                     80
840 #define EL_PLAYER_2                     81
841 #define EL_PLAYER_3                     82
842 #define EL_PLAYER_4                     83
843 #define EL_BUG_RIGHT                    84
844 #define EL_BUG_UP                       85
845 #define EL_BUG_LEFT                     86
846 #define EL_BUG_DOWN                     87
847 #define EL_SPACESHIP_RIGHT              88
848 #define EL_SPACESHIP_UP                 89
849 #define EL_SPACESHIP_LEFT               90
850 #define EL_SPACESHIP_DOWN               91
851 #define EL_PACMAN_RIGHT                 92
852 #define EL_PACMAN_UP                    93
853 #define EL_PACMAN_LEFT                  94
854 #define EL_PACMAN_DOWN                  95
855 #define EL_EMERALD_RED                  96
856 #define EL_EMERALD_PURPLE               97
857 #define EL_WALL_EMERALD_RED             98
858 #define EL_WALL_EMERALD_PURPLE          99
859 #define EL_ACID_POOL_TOPLEFT            100
860 #define EL_ACID_POOL_TOPRIGHT           101
861 #define EL_ACID_POOL_BOTTOMLEFT         102
862 #define EL_ACID_POOL_BOTTOM             103
863 #define EL_ACID_POOL_BOTTOMRIGHT        104
864 #define EL_BD_WALL                      105
865 #define EL_BD_ROCK                      106
866 #define EL_EXIT_OPEN                    107
867 #define EL_BLACK_ORB                    108
868 #define EL_AMOEBA_TO_DIAMOND            109
869 #define EL_MOLE                         110
870 #define EL_PENGUIN                      111
871 #define EL_SATELLITE                    112
872 #define EL_ARROW_LEFT                   113
873 #define EL_ARROW_RIGHT                  114
874 #define EL_ARROW_UP                     115
875 #define EL_ARROW_DOWN                   116
876 #define EL_PIG                          117
877 #define EL_DRAGON                       118
878
879 #define EL_EM_KEY_1_FILE_OBSOLETE       119     /* obsolete; now EL_EM_KEY_1 */
880
881 #define EL_CHAR_START                   120
882 #define EL_CHAR_ASCII0                  (EL_CHAR_START  - 32)
883 #define EL_CHAR_ASCII0_START            (EL_CHAR_ASCII0 + 32)
884
885 #include "conf_chr.h"   /* include auto-generated data structure definitions */
886
887 #define EL_CHAR_ASCII0_END              (EL_CHAR_ASCII0 + 111)
888 #define EL_CHAR_END                     (EL_CHAR_START  + 79)
889
890 #define EL_CHAR(c)                      (EL_CHAR_ASCII0 + MAP_FONT_ASCII(c))
891
892 #define EL_EXPANDABLE_WALL_HORIZONTAL   200
893 #define EL_EXPANDABLE_WALL_VERTICAL     201
894 #define EL_EXPANDABLE_WALL_ANY          202
895
896 #define EL_EM_GATE_1                    203
897 #define EL_EM_GATE_2                    204
898 #define EL_EM_GATE_3                    205
899 #define EL_EM_GATE_4                    206
900
901 #define EL_EM_KEY_2_FILE_OBSOLETE       207     /* obsolete; now EL_EM_KEY_2 */
902 #define EL_EM_KEY_3_FILE_OBSOLETE       208     /* obsolete; now EL_EM_KEY_3 */
903 #define EL_EM_KEY_4_FILE_OBSOLETE       209     /* obsolete; now EL_EM_KEY_4 */
904
905 #define EL_SP_START                     210
906 #define EL_SP_EMPTY_SPACE               (EL_SP_START + 0)
907 #define EL_SP_EMPTY                     EL_SP_EMPTY_SPACE
908 #define EL_SP_ZONK                      (EL_SP_START + 1)
909 #define EL_SP_BASE                      (EL_SP_START + 2)
910 #define EL_SP_MURPHY                    (EL_SP_START + 3)
911 #define EL_SP_INFOTRON                  (EL_SP_START + 4)
912 #define EL_SP_CHIP_SINGLE               (EL_SP_START + 5)
913 #define EL_SP_HARDWARE_GRAY             (EL_SP_START + 6)
914 #define EL_SP_EXIT_CLOSED               (EL_SP_START + 7)
915 #define EL_SP_DISK_ORANGE               (EL_SP_START + 8)
916 #define EL_SP_PORT_RIGHT                (EL_SP_START + 9)
917 #define EL_SP_PORT_DOWN                 (EL_SP_START + 10)
918 #define EL_SP_PORT_LEFT                 (EL_SP_START + 11)
919 #define EL_SP_PORT_UP                   (EL_SP_START + 12)
920 #define EL_SP_GRAVITY_PORT_RIGHT        (EL_SP_START + 13)
921 #define EL_SP_GRAVITY_PORT_DOWN         (EL_SP_START + 14)
922 #define EL_SP_GRAVITY_PORT_LEFT         (EL_SP_START + 15)
923 #define EL_SP_GRAVITY_PORT_UP           (EL_SP_START + 16)
924 #define EL_SP_SNIKSNAK                  (EL_SP_START + 17)
925 #define EL_SP_DISK_YELLOW               (EL_SP_START + 18)
926 #define EL_SP_TERMINAL                  (EL_SP_START + 19)
927 #define EL_SP_DISK_RED                  (EL_SP_START + 20)
928 #define EL_SP_PORT_VERTICAL             (EL_SP_START + 21)
929 #define EL_SP_PORT_HORIZONTAL           (EL_SP_START + 22)
930 #define EL_SP_PORT_ANY                  (EL_SP_START + 23)
931 #define EL_SP_ELECTRON                  (EL_SP_START + 24)
932 #define EL_SP_BUGGY_BASE                (EL_SP_START + 25)
933 #define EL_SP_CHIP_LEFT                 (EL_SP_START + 26)
934 #define EL_SP_CHIP_RIGHT                (EL_SP_START + 27)
935 #define EL_SP_HARDWARE_BASE_1           (EL_SP_START + 28)
936 #define EL_SP_HARDWARE_GREEN            (EL_SP_START + 29)
937 #define EL_SP_HARDWARE_BLUE             (EL_SP_START + 30)
938 #define EL_SP_HARDWARE_RED              (EL_SP_START + 31)
939 #define EL_SP_HARDWARE_YELLOW           (EL_SP_START + 32)
940 #define EL_SP_HARDWARE_BASE_2           (EL_SP_START + 33)
941 #define EL_SP_HARDWARE_BASE_3           (EL_SP_START + 34)
942 #define EL_SP_HARDWARE_BASE_4           (EL_SP_START + 35)
943 #define EL_SP_HARDWARE_BASE_5           (EL_SP_START + 36)
944 #define EL_SP_HARDWARE_BASE_6           (EL_SP_START + 37)
945 #define EL_SP_CHIP_TOP                  (EL_SP_START + 38)
946 #define EL_SP_CHIP_BOTTOM               (EL_SP_START + 39)
947 #define EL_SP_END                       (EL_SP_START + 39)
948
949 #define EL_EM_GATE_1_GRAY               250
950 #define EL_EM_GATE_2_GRAY               251
951 #define EL_EM_GATE_3_GRAY               252
952 #define EL_EM_GATE_4_GRAY               253
953
954 #define EL_UNUSED_254                   254
955 #define EL_UNUSED_255                   255
956
957 #define EL_PEARL                        256
958 #define EL_CRYSTAL                      257
959 #define EL_WALL_PEARL                   258
960 #define EL_WALL_CRYSTAL                 259
961 #define EL_DOOR_WHITE                   260
962 #define EL_DOOR_WHITE_GRAY              261
963 #define EL_KEY_WHITE                    262
964 #define EL_SHIELD_NORMAL                263
965 #define EL_EXTRA_TIME                   264
966 #define EL_SWITCHGATE_OPEN              265
967 #define EL_SWITCHGATE_CLOSED            266
968 #define EL_SWITCHGATE_SWITCH_UP         267
969 #define EL_SWITCHGATE_SWITCH_DOWN       268
970
971 #define EL_UNUSED_269                   269
972 #define EL_UNUSED_270                   270
973
974 #define EL_CONVEYOR_BELT_1_LEFT          271
975 #define EL_CONVEYOR_BELT_1_MIDDLE        272
976 #define EL_CONVEYOR_BELT_1_RIGHT         273
977 #define EL_CONVEYOR_BELT_1_SWITCH_LEFT   274
978 #define EL_CONVEYOR_BELT_1_SWITCH_MIDDLE 275
979 #define EL_CONVEYOR_BELT_1_SWITCH_RIGHT  276
980 #define EL_CONVEYOR_BELT_2_LEFT          277
981 #define EL_CONVEYOR_BELT_2_MIDDLE        278
982 #define EL_CONVEYOR_BELT_2_RIGHT         279
983 #define EL_CONVEYOR_BELT_2_SWITCH_LEFT   280
984 #define EL_CONVEYOR_BELT_2_SWITCH_MIDDLE 281
985 #define EL_CONVEYOR_BELT_2_SWITCH_RIGHT  282
986 #define EL_CONVEYOR_BELT_3_LEFT          283
987 #define EL_CONVEYOR_BELT_3_MIDDLE        284
988 #define EL_CONVEYOR_BELT_3_RIGHT         285
989 #define EL_CONVEYOR_BELT_3_SWITCH_LEFT   286
990 #define EL_CONVEYOR_BELT_3_SWITCH_MIDDLE 287
991 #define EL_CONVEYOR_BELT_3_SWITCH_RIGHT  288
992 #define EL_CONVEYOR_BELT_4_LEFT          289
993 #define EL_CONVEYOR_BELT_4_MIDDLE        290
994 #define EL_CONVEYOR_BELT_4_RIGHT         291
995 #define EL_CONVEYOR_BELT_4_SWITCH_LEFT   292
996 #define EL_CONVEYOR_BELT_4_SWITCH_MIDDLE 293
997 #define EL_CONVEYOR_BELT_4_SWITCH_RIGHT  294
998 #define EL_LANDMINE                     295
999 #define EL_ENVELOPE_OBSOLETE            296   /* obsolete; now EL_ENVELOPE_1 */
1000 #define EL_LIGHT_SWITCH                 297
1001 #define EL_LIGHT_SWITCH_ACTIVE          298
1002 #define EL_SIGN_EXCLAMATION             299
1003 #define EL_SIGN_RADIOACTIVITY           300
1004 #define EL_SIGN_STOP                    301
1005 #define EL_SIGN_WHEELCHAIR              302
1006 #define EL_SIGN_PARKING                 303
1007 #define EL_SIGN_ONEWAY                  304
1008 #define EL_SIGN_HEART                   305
1009 #define EL_SIGN_TRIANGLE                306
1010 #define EL_SIGN_ROUND                   307
1011 #define EL_SIGN_EXIT                    308
1012 #define EL_SIGN_YINYANG                 309
1013 #define EL_SIGN_OTHER                   310
1014 #define EL_MOLE_LEFT                    311
1015 #define EL_MOLE_RIGHT                   312
1016 #define EL_MOLE_UP                      313
1017 #define EL_MOLE_DOWN                    314
1018 #define EL_STEELWALL_SLIPPERY           315
1019 #define EL_INVISIBLE_SAND               316
1020 #define EL_DX_UNKNOWN_15                317
1021 #define EL_DX_UNKNOWN_42                318
1022
1023 #define EL_UNUSED_319                   319
1024 #define EL_UNUSED_320                   320
1025
1026 #define EL_SHIELD_DEADLY                321
1027 #define EL_TIMEGATE_OPEN                322
1028 #define EL_TIMEGATE_CLOSED              323
1029 #define EL_TIMEGATE_SWITCH_ACTIVE       324
1030 #define EL_TIMEGATE_SWITCH              325
1031
1032 #define EL_BALLOON                      326
1033 #define EL_BALLOON_SWITCH_LEFT          327
1034 #define EL_BALLOON_SWITCH_RIGHT         328
1035 #define EL_BALLOON_SWITCH_UP            329
1036 #define EL_BALLOON_SWITCH_DOWN          330
1037 #define EL_BALLOON_SWITCH_ANY           331
1038
1039 #define EL_EMC_STEELWALL_1              332
1040 #define EL_EMC_STEELWALL_2              333
1041 #define EL_EMC_STEELWALL_3              334
1042 #define EL_EMC_STEELWALL_4              335
1043 #define EL_EMC_WALL_1                   336
1044 #define EL_EMC_WALL_2                   337
1045 #define EL_EMC_WALL_3                   338
1046 #define EL_EMC_WALL_4                   339
1047 #define EL_EMC_WALL_5                   340
1048 #define EL_EMC_WALL_6                   341
1049 #define EL_EMC_WALL_7                   342
1050 #define EL_EMC_WALL_8                   343
1051
1052 #define EL_TUBE_ANY                     344
1053 #define EL_TUBE_VERTICAL                345
1054 #define EL_TUBE_HORIZONTAL              346
1055 #define EL_TUBE_VERTICAL_LEFT           347
1056 #define EL_TUBE_VERTICAL_RIGHT          348
1057 #define EL_TUBE_HORIZONTAL_UP           349
1058 #define EL_TUBE_HORIZONTAL_DOWN         350
1059 #define EL_TUBE_LEFT_UP                 351
1060 #define EL_TUBE_LEFT_DOWN               352
1061 #define EL_TUBE_RIGHT_UP                353
1062 #define EL_TUBE_RIGHT_DOWN              354
1063 #define EL_SPRING                       355
1064 #define EL_TRAP                         356
1065 #define EL_DX_SUPABOMB                  357
1066
1067 #define EL_UNUSED_358                   358
1068 #define EL_UNUSED_359                   359
1069
1070 /* ---------- begin of custom elements section ----------------------------- */
1071 #define EL_CUSTOM_START                 360
1072
1073 #include "conf_cus.h"   /* include auto-generated data structure definitions */
1074
1075 #define NUM_CUSTOM_ELEMENTS             256
1076 #define EL_CUSTOM_END                   615
1077 /* ---------- end of custom elements section ------------------------------- */
1078
1079 #define EL_EM_KEY_1                     616
1080 #define EL_EM_KEY_2                     617
1081 #define EL_EM_KEY_3                     618
1082 #define EL_EM_KEY_4                     619
1083 #define EL_ENVELOPE_1                   620
1084 #define EL_ENVELOPE_2                   621
1085 #define EL_ENVELOPE_3                   622
1086 #define EL_ENVELOPE_4                   623
1087
1088 /* ---------- begin of group elements section ------------------------------ */
1089 #define EL_GROUP_START                  624
1090
1091 #include "conf_grp.h"   /* include auto-generated data structure definitions */
1092
1093 #define NUM_GROUP_ELEMENTS              32
1094 #define EL_GROUP_END                    655
1095 /* ---------- end of custom elements section ------------------------------- */
1096
1097 #define EL_UNKNOWN                      656
1098 #define EL_TRIGGER_ELEMENT              657
1099 #define EL_TRIGGER_PLAYER               658
1100
1101 #define EL_SP_GRAVITY_ON_PORT_RIGHT     659
1102 #define EL_SP_GRAVITY_ON_PORT_DOWN      660
1103 #define EL_SP_GRAVITY_ON_PORT_LEFT      661
1104 #define EL_SP_GRAVITY_ON_PORT_UP        662
1105 #define EL_SP_GRAVITY_OFF_PORT_RIGHT    663
1106 #define EL_SP_GRAVITY_OFF_PORT_DOWN     664
1107 #define EL_SP_GRAVITY_OFF_PORT_LEFT     665
1108 #define EL_SP_GRAVITY_OFF_PORT_UP       666
1109
1110
1111 /* the following EMC style elements are currently not implemented in R'n'D */
1112 #define EL_BALLOON_SWITCH_NONE          667
1113 #define EL_EMC_GATE_5                   668
1114 #define EL_EMC_GATE_6                   669
1115 #define EL_EMC_GATE_7                   670
1116 #define EL_EMC_GATE_8                   671
1117 #define EL_EMC_GATE_5_GRAY              672
1118 #define EL_EMC_GATE_6_GRAY              673
1119 #define EL_EMC_GATE_7_GRAY              674
1120 #define EL_EMC_GATE_8_GRAY              675
1121 #define EL_EMC_KEY_5                    676
1122 #define EL_EMC_KEY_6                    677
1123 #define EL_EMC_KEY_7                    678
1124 #define EL_EMC_KEY_8                    679
1125 #define EL_EMC_ANDROID                  680
1126 #define EL_EMC_GRASS                    681
1127 #define EL_EMC_MAGIC_BALL               682
1128 #define EL_EMC_MAGIC_BALL_ACTIVE        683
1129 #define EL_EMC_MAGIC_BALL_SWITCH        684
1130 #define EL_EMC_MAGIC_BALL_SWITCH_ACTIVE 685
1131 #define EL_EMC_SPRING_BUMPER            686
1132 #define EL_EMC_PLANT                    687
1133 #define EL_EMC_LENSES                   688
1134 #define EL_EMC_MAGNIFIER                689
1135 #define EL_EMC_WALL_9                   690
1136 #define EL_EMC_WALL_10                  691
1137 #define EL_EMC_WALL_11                  692
1138 #define EL_EMC_WALL_12                  693
1139 #define EL_EMC_WALL_13                  694
1140 #define EL_EMC_WALL_14                  695
1141 #define EL_EMC_WALL_15                  696
1142 #define EL_EMC_WALL_16                  697
1143 #define EL_EMC_WALL_SLIPPERY_1          698
1144 #define EL_EMC_WALL_SLIPPERY_2          699
1145 #define EL_EMC_WALL_SLIPPERY_3          700
1146 #define EL_EMC_WALL_SLIPPERY_4          701
1147 #define EL_EMC_FAKE_GRASS               702
1148 #define EL_EMC_FAKE_ACID                703
1149 #define EL_EMC_DRIPPER                  704
1150
1151 #define NUM_FILE_ELEMENTS               705
1152
1153
1154 /* "real" (and therefore drawable) runtime elements */
1155 #define EL_FIRST_RUNTIME_REAL           NUM_FILE_ELEMENTS
1156
1157 #define EL_DYNABOMB_PLAYER_1_ACTIVE     (EL_FIRST_RUNTIME_REAL + 0)
1158 #define EL_DYNABOMB_PLAYER_2_ACTIVE     (EL_FIRST_RUNTIME_REAL + 1)
1159 #define EL_DYNABOMB_PLAYER_3_ACTIVE     (EL_FIRST_RUNTIME_REAL + 2)
1160 #define EL_DYNABOMB_PLAYER_4_ACTIVE     (EL_FIRST_RUNTIME_REAL + 3)
1161 #define EL_SP_DISK_RED_ACTIVE           (EL_FIRST_RUNTIME_REAL + 4)
1162 #define EL_SWITCHGATE_OPENING           (EL_FIRST_RUNTIME_REAL + 5)
1163 #define EL_SWITCHGATE_CLOSING           (EL_FIRST_RUNTIME_REAL + 6)
1164 #define EL_TIMEGATE_OPENING             (EL_FIRST_RUNTIME_REAL + 7)
1165 #define EL_TIMEGATE_CLOSING             (EL_FIRST_RUNTIME_REAL + 8)
1166 #define EL_PEARL_BREAKING               (EL_FIRST_RUNTIME_REAL + 9)
1167 #define EL_TRAP_ACTIVE                  (EL_FIRST_RUNTIME_REAL + 10)
1168 #define EL_INVISIBLE_STEELWALL_ACTIVE   (EL_FIRST_RUNTIME_REAL + 11)
1169 #define EL_INVISIBLE_WALL_ACTIVE        (EL_FIRST_RUNTIME_REAL + 12)
1170 #define EL_INVISIBLE_SAND_ACTIVE        (EL_FIRST_RUNTIME_REAL + 13)
1171 #define EL_CONVEYOR_BELT_1_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 14)
1172 #define EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 15)
1173 #define EL_CONVEYOR_BELT_1_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 16)
1174 #define EL_CONVEYOR_BELT_2_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 17)
1175 #define EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 18)
1176 #define EL_CONVEYOR_BELT_2_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 19)
1177 #define EL_CONVEYOR_BELT_3_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 20)
1178 #define EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 21)
1179 #define EL_CONVEYOR_BELT_3_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 22)
1180 #define EL_CONVEYOR_BELT_4_LEFT_ACTIVE   (EL_FIRST_RUNTIME_REAL + 23)
1181 #define EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE (EL_FIRST_RUNTIME_REAL + 24)
1182 #define EL_CONVEYOR_BELT_4_RIGHT_ACTIVE  (EL_FIRST_RUNTIME_REAL + 25)
1183 #define EL_EXIT_OPENING                 (EL_FIRST_RUNTIME_REAL + 26)
1184 #define EL_EXIT_CLOSING                 (EL_FIRST_RUNTIME_REAL + 27)
1185 #define EL_SP_EXIT_OPENING              (EL_FIRST_RUNTIME_REAL + 28)
1186 #define EL_SP_EXIT_CLOSING              (EL_FIRST_RUNTIME_REAL + 29)
1187 #define EL_SP_EXIT_OPEN                 (EL_FIRST_RUNTIME_REAL + 30)
1188 #define EL_SP_TERMINAL_ACTIVE           (EL_FIRST_RUNTIME_REAL + 31)
1189 #define EL_SP_BUGGY_BASE_ACTIVATING     (EL_FIRST_RUNTIME_REAL + 32)
1190 #define EL_SP_BUGGY_BASE_ACTIVE         (EL_FIRST_RUNTIME_REAL + 33)
1191 #define EL_SP_MURPHY_CLONE              (EL_FIRST_RUNTIME_REAL + 34)
1192 #define EL_AMOEBA_DROPPING              (EL_FIRST_RUNTIME_REAL + 35)
1193 #define EL_QUICKSAND_EMPTYING           (EL_FIRST_RUNTIME_REAL + 36)
1194 #define EL_MAGIC_WALL_ACTIVE            (EL_FIRST_RUNTIME_REAL + 37)
1195 #define EL_BD_MAGIC_WALL_ACTIVE         (EL_FIRST_RUNTIME_REAL + 38)
1196 #define EL_MAGIC_WALL_FULL              (EL_FIRST_RUNTIME_REAL + 39)
1197 #define EL_BD_MAGIC_WALL_FULL           (EL_FIRST_RUNTIME_REAL + 40)
1198 #define EL_MAGIC_WALL_EMPTYING          (EL_FIRST_RUNTIME_REAL + 41)
1199 #define EL_BD_MAGIC_WALL_EMPTYING       (EL_FIRST_RUNTIME_REAL + 42)
1200 #define EL_MAGIC_WALL_DEAD              (EL_FIRST_RUNTIME_REAL + 43)
1201 #define EL_BD_MAGIC_WALL_DEAD           (EL_FIRST_RUNTIME_REAL + 44)
1202
1203 /* "unreal" (and therefore not drawable) runtime elements */
1204 #define EL_FIRST_RUNTIME_UNREAL         (EL_FIRST_RUNTIME_REAL + 45)
1205
1206 #define EL_BLOCKED                      (EL_FIRST_RUNTIME_UNREAL + 0)
1207 #define EL_EXPLOSION                    (EL_FIRST_RUNTIME_UNREAL + 1)
1208 #define EL_NUT_BREAKING                 (EL_FIRST_RUNTIME_UNREAL + 2)
1209 #define EL_DIAMOND_BREAKING             (EL_FIRST_RUNTIME_UNREAL + 3)
1210 #define EL_ACID_SPLASH_LEFT             (EL_FIRST_RUNTIME_UNREAL + 4)
1211 #define EL_ACID_SPLASH_RIGHT            (EL_FIRST_RUNTIME_UNREAL + 5)
1212 #define EL_AMOEBA_GROWING               (EL_FIRST_RUNTIME_UNREAL + 6)
1213 #define EL_AMOEBA_SHRINKING             (EL_FIRST_RUNTIME_UNREAL + 7)
1214 #define EL_EXPANDABLE_WALL_GROWING      (EL_FIRST_RUNTIME_UNREAL + 8)
1215 #define EL_FLAMES                       (EL_FIRST_RUNTIME_UNREAL + 9)
1216 #define EL_PLAYER_IS_LEAVING            (EL_FIRST_RUNTIME_UNREAL + 10)
1217 #define EL_PLAYER_IS_EXPLODING_1        (EL_FIRST_RUNTIME_UNREAL + 11)
1218 #define EL_PLAYER_IS_EXPLODING_2        (EL_FIRST_RUNTIME_UNREAL + 12)
1219 #define EL_PLAYER_IS_EXPLODING_3        (EL_FIRST_RUNTIME_UNREAL + 13)
1220 #define EL_PLAYER_IS_EXPLODING_4        (EL_FIRST_RUNTIME_UNREAL + 14)
1221 #define EL_QUICKSAND_FILLING            (EL_FIRST_RUNTIME_UNREAL + 15)
1222 #define EL_MAGIC_WALL_FILLING           (EL_FIRST_RUNTIME_UNREAL + 16)
1223 #define EL_BD_MAGIC_WALL_FILLING        (EL_FIRST_RUNTIME_UNREAL + 17)
1224
1225 /* dummy elements (never used as game elements, only used as graphics) */
1226 #define EL_FIRST_DUMMY                  (EL_FIRST_RUNTIME_UNREAL + 18)
1227
1228 #define EL_STEELWALL_TOPLEFT            (EL_FIRST_DUMMY + 0)
1229 #define EL_STEELWALL_TOPRIGHT           (EL_FIRST_DUMMY + 1)
1230 #define EL_STEELWALL_BOTTOMLEFT         (EL_FIRST_DUMMY + 2)
1231 #define EL_STEELWALL_BOTTOMRIGHT        (EL_FIRST_DUMMY + 3)
1232 #define EL_STEELWALL_HORIZONTAL         (EL_FIRST_DUMMY + 4)
1233 #define EL_STEELWALL_VERTICAL           (EL_FIRST_DUMMY + 5)
1234 #define EL_INVISIBLE_STEELWALL_TOPLEFT     (EL_FIRST_DUMMY + 6)
1235 #define EL_INVISIBLE_STEELWALL_TOPRIGHT    (EL_FIRST_DUMMY + 7)
1236 #define EL_INVISIBLE_STEELWALL_BOTTOMLEFT  (EL_FIRST_DUMMY + 8)
1237 #define EL_INVISIBLE_STEELWALL_BOTTOMRIGHT (EL_FIRST_DUMMY + 9)
1238 #define EL_INVISIBLE_STEELWALL_HORIZONTAL  (EL_FIRST_DUMMY + 10)
1239 #define EL_INVISIBLE_STEELWALL_VERTICAL    (EL_FIRST_DUMMY + 11)
1240 #define EL_DYNABOMB                     (EL_FIRST_DUMMY + 12)
1241 #define EL_DYNABOMB_ACTIVE              (EL_FIRST_DUMMY + 13)
1242 #define EL_DYNABOMB_PLAYER_1            (EL_FIRST_DUMMY + 14)
1243 #define EL_DYNABOMB_PLAYER_2            (EL_FIRST_DUMMY + 15)
1244 #define EL_DYNABOMB_PLAYER_3            (EL_FIRST_DUMMY + 16)
1245 #define EL_DYNABOMB_PLAYER_4            (EL_FIRST_DUMMY + 17)
1246 #define EL_SHIELD_NORMAL_ACTIVE         (EL_FIRST_DUMMY + 18)
1247 #define EL_SHIELD_DEADLY_ACTIVE         (EL_FIRST_DUMMY + 19)
1248 #define EL_AMOEBA                       (EL_FIRST_DUMMY + 20)
1249 #define EL_DEFAULT                      (EL_FIRST_DUMMY + 21)
1250 #define EL_BD_DEFAULT                   (EL_FIRST_DUMMY + 22)
1251 #define EL_SP_DEFAULT                   (EL_FIRST_DUMMY + 23)
1252 #define EL_SB_DEFAULT                   (EL_FIRST_DUMMY + 24)
1253
1254 /* internal elements (only used for internal purposes like copying) */
1255 #define EL_FIRST_INTERNAL               (EL_FIRST_DUMMY + 25)
1256
1257 #define EL_INTERNAL_CLIPBOARD_CUSTOM    (EL_FIRST_INTERNAL + 0)
1258 #define EL_INTERNAL_CLIPBOARD_CHANGE    (EL_FIRST_INTERNAL + 1)
1259 #define EL_INTERNAL_CLIPBOARD_GROUP     (EL_FIRST_INTERNAL + 2)
1260 #define EL_INTERNAL_DUMMY               (EL_FIRST_INTERNAL + 3)
1261
1262 #define EL_INTERNAL_CLIPBOARD_START     (EL_FIRST_INTERNAL + 0)
1263 #define EL_INTERNAL_CLIPBOARD_END       (EL_FIRST_INTERNAL + 2)
1264 #define EL_INTERNAL_START               (EL_FIRST_INTERNAL + 0)
1265 #define EL_INTERNAL_END                 (EL_FIRST_INTERNAL + 3)
1266
1267 #define MAX_NUM_ELEMENTS                (EL_FIRST_INTERNAL + 4)
1268
1269
1270 /* values for graphics/sounds action types */
1271 #define ACTION_DEFAULT                  0
1272 #define ACTION_WAITING                  1
1273 #define ACTION_FALLING                  2
1274 #define ACTION_MOVING                   3
1275 #define ACTION_DIGGING                  4
1276 #define ACTION_SNAPPING                 5
1277 #define ACTION_COLLECTING               6
1278 #define ACTION_DROPPING                 7
1279 #define ACTION_PUSHING                  8
1280 #define ACTION_WALKING                  9
1281 #define ACTION_PASSING                  10
1282 #define ACTION_IMPACT                   11
1283 #define ACTION_BREAKING                 12
1284 #define ACTION_ACTIVATING               13
1285 #define ACTION_DEACTIVATING             14
1286 #define ACTION_OPENING                  15
1287 #define ACTION_CLOSING                  16
1288 #define ACTION_ATTACKING                17
1289 #define ACTION_GROWING                  18
1290 #define ACTION_SHRINKING                19
1291 #define ACTION_ACTIVE                   20
1292 #define ACTION_FILLING                  21
1293 #define ACTION_EMPTYING                 22
1294 #define ACTION_CHANGING                 23
1295 #define ACTION_EXPLODING                24
1296 #define ACTION_BORING                   25
1297 #define ACTION_BORING_1                 26
1298 #define ACTION_BORING_2                 27
1299 #define ACTION_BORING_3                 28
1300 #define ACTION_BORING_4                 29
1301 #define ACTION_BORING_5                 30
1302 #define ACTION_BORING_6                 31
1303 #define ACTION_BORING_7                 32
1304 #define ACTION_BORING_8                 33
1305 #define ACTION_BORING_9                 34
1306 #define ACTION_BORING_10                35
1307 #define ACTION_SLEEPING                 36
1308 #define ACTION_SLEEPING_1               37
1309 #define ACTION_SLEEPING_2               38
1310 #define ACTION_SLEEPING_3               39
1311 #define ACTION_AWAKENING                40
1312 #define ACTION_DYING                    41
1313 #define ACTION_TURNING                  42
1314 #define ACTION_TURNING_FROM_LEFT        43
1315 #define ACTION_TURNING_FROM_RIGHT       44
1316 #define ACTION_TURNING_FROM_UP          45
1317 #define ACTION_TURNING_FROM_DOWN        46
1318 #define ACTION_SMASHED_BY_ROCK          47
1319 #define ACTION_SMASHED_BY_SPRING        48
1320 #define ACTION_SLURPED_BY_SPRING        49
1321 #define ACTION_TWINKLING                50
1322 #define ACTION_SPLASHING                51
1323 #define ACTION_PAGE_1                   52
1324 #define ACTION_PAGE_2                   53
1325 #define ACTION_PAGE_3                   54
1326 #define ACTION_PAGE_4                   55
1327 #define ACTION_PAGE_5                   56
1328 #define ACTION_PAGE_6                   57
1329 #define ACTION_PAGE_7                   58
1330 #define ACTION_PAGE_8                   59
1331 #define ACTION_PAGE_9                   60
1332 #define ACTION_PAGE_10                  61
1333 #define ACTION_PAGE_11                  62
1334 #define ACTION_PAGE_12                  63
1335 #define ACTION_PAGE_13                  64
1336 #define ACTION_PAGE_14                  65
1337 #define ACTION_PAGE_15                  66
1338 #define ACTION_PAGE_16                  67
1339 #define ACTION_PAGE_17                  68
1340 #define ACTION_PAGE_18                  69
1341 #define ACTION_PAGE_19                  70
1342 #define ACTION_PAGE_20                  71
1343 #define ACTION_PAGE_21                  72
1344 #define ACTION_PAGE_22                  73
1345 #define ACTION_PAGE_23                  74
1346 #define ACTION_PAGE_24                  75
1347 #define ACTION_PAGE_25                  76
1348 #define ACTION_PAGE_26                  77
1349 #define ACTION_PAGE_27                  78
1350 #define ACTION_PAGE_28                  79
1351 #define ACTION_PAGE_29                  80
1352 #define ACTION_PAGE_30                  81
1353 #define ACTION_PAGE_31                  82
1354 #define ACTION_PAGE_32                  83
1355 #define ACTION_OTHER                    84
1356
1357 #define NUM_ACTIONS                     85
1358
1359 #define ACTION_BORING_LAST              ACTION_BORING_10
1360 #define ACTION_SLEEPING_LAST            ACTION_SLEEPING_3
1361
1362
1363 /* values for special image configuration suffixes (must match game mode) */
1364 #define GFX_SPECIAL_ARG_DEFAULT         0
1365 #define GFX_SPECIAL_ARG_MAIN            1
1366 #define GFX_SPECIAL_ARG_LEVELS          2
1367 #define GFX_SPECIAL_ARG_SCORES          3
1368 #define GFX_SPECIAL_ARG_EDITOR          4
1369 #define GFX_SPECIAL_ARG_INFO            5
1370 #define GFX_SPECIAL_ARG_SETUP           6
1371 #define GFX_SPECIAL_ARG_PLAYING         7
1372 #define GFX_SPECIAL_ARG_DOOR            8
1373 #define GFX_SPECIAL_ARG_PREVIEW         9
1374 #define GFX_SPECIAL_ARG_CRUMBLED        10
1375
1376 #define NUM_SPECIAL_GFX_ARGS            11
1377
1378
1379 /* values for image configuration suffixes */
1380 #define GFX_ARG_X                       0
1381 #define GFX_ARG_Y                       1
1382 #define GFX_ARG_XPOS                    2
1383 #define GFX_ARG_YPOS                    3
1384 #define GFX_ARG_WIDTH                   4
1385 #define GFX_ARG_HEIGHT                  5
1386 #define GFX_ARG_VERTICAL                6
1387 #define GFX_ARG_OFFSET                  7
1388 #define GFX_ARG_XOFFSET                 8
1389 #define GFX_ARG_YOFFSET                 9
1390 #define GFX_ARG_2ND_MOVEMENT_TILE       10
1391 #define GFX_ARG_2ND_VERTICAL            11
1392 #define GFX_ARG_2ND_OFFSET              12
1393 #define GFX_ARG_2ND_XOFFSET             13
1394 #define GFX_ARG_2ND_YOFFSET             14
1395 #define GFX_ARG_2ND_SWAP_TILES          15      
1396 #define GFX_ARG_FRAMES                  16
1397 #define GFX_ARG_FRAMES_PER_LINE         17
1398 #define GFX_ARG_START_FRAME             18
1399 #define GFX_ARG_DELAY                   19
1400 #define GFX_ARG_ANIM_MODE               20
1401 #define GFX_ARG_GLOBAL_SYNC             21
1402 #define GFX_ARG_CRUMBLED_LIKE           22
1403 #define GFX_ARG_DIGGABLE_LIKE           23
1404 #define GFX_ARG_BORDER_SIZE             24
1405 #define GFX_ARG_STEP_OFFSET             25
1406 #define GFX_ARG_STEP_DELAY              26
1407 #define GFX_ARG_DIRECTION               27
1408 #define GFX_ARG_POSITION                28
1409 #define GFX_ARG_DRAW_XOFFSET            29
1410 #define GFX_ARG_DRAW_YOFFSET            30
1411 #define GFX_ARG_DRAW_MASKED             31
1412 #define GFX_ARG_ANIM_DELAY_FIXED        32
1413 #define GFX_ARG_ANIM_DELAY_RANDOM       33
1414 #define GFX_ARG_POST_DELAY_FIXED        34
1415 #define GFX_ARG_POST_DELAY_RANDOM       35
1416 #define GFX_ARG_NAME                    36
1417 #define GFX_ARG_SCALE_UP_FACTOR         37
1418 #define GFX_ARG_CLONE_FROM              38
1419
1420 #define NUM_GFX_ARGS                    39
1421
1422
1423 /* values for sound configuration suffixes */
1424 #define SND_ARG_MODE_LOOP               0
1425 #define SND_ARG_VOLUME                  1
1426 #define SND_ARG_PRIORITY                2
1427
1428 #define NUM_SND_ARGS                    3
1429
1430
1431 /* values for music configuration suffixes */
1432 #define MUS_ARG_MODE_LOOP               0
1433
1434 #define NUM_MUS_ARGS                    1
1435
1436
1437 /* values for font configuration */
1438 #define FONT_INITIAL_1                  0
1439 #define FONT_INITIAL_2                  1
1440 #define FONT_INITIAL_3                  2
1441 #define FONT_INITIAL_4                  3
1442 #define FONT_TITLE_1                    4
1443 #define FONT_TITLE_2                    5
1444 #define FONT_MENU_1                     6
1445 #define FONT_MENU_2                     7
1446 #define FONT_TEXT_1_ACTIVE              8
1447 #define FONT_TEXT_2_ACTIVE              9
1448 #define FONT_TEXT_3_ACTIVE              10
1449 #define FONT_TEXT_4_ACTIVE              11
1450 #define FONT_TEXT_1                     12
1451 #define FONT_TEXT_2                     13
1452 #define FONT_TEXT_3                     14
1453 #define FONT_TEXT_4                     15
1454 #define FONT_ENVELOPE_1                 16
1455 #define FONT_ENVELOPE_2                 17
1456 #define FONT_ENVELOPE_3                 18
1457 #define FONT_ENVELOPE_4                 19
1458 #define FONT_INPUT_1_ACTIVE             20
1459 #define FONT_INPUT_2_ACTIVE             21
1460 #define FONT_INPUT_1                    22
1461 #define FONT_INPUT_2                    23
1462 #define FONT_OPTION_OFF                 24
1463 #define FONT_OPTION_ON                  25
1464 #define FONT_VALUE_1                    26
1465 #define FONT_VALUE_2                    27
1466 #define FONT_VALUE_OLD                  28
1467 #define FONT_LEVEL_NUMBER               29
1468 #define FONT_TAPE_RECORDER              30
1469 #define FONT_GAME_INFO                  31
1470
1471 #define NUM_FONTS                       32
1472 #define NUM_INITIAL_FONTS               4
1473
1474 /* values for game_status (must match special image configuration suffixes) */
1475 #define GAME_MODE_DEFAULT               0
1476 #define GAME_MODE_MAIN                  1
1477 #define GAME_MODE_LEVELS                2
1478 #define GAME_MODE_SCORES                3
1479 #define GAME_MODE_EDITOR                4
1480 #define GAME_MODE_INFO                  5
1481 #define GAME_MODE_SETUP                 6
1482 #define GAME_MODE_PLAYING               7
1483 #define GAME_MODE_PSEUDO_DOOR           8
1484 #define GAME_MODE_PSEUDO_PREVIEW        9
1485 #define GAME_MODE_PSEUDO_CRUMBLED       10
1486
1487 /* there are no special config file suffixes for these modes */
1488 #define GAME_MODE_PSEUDO_TYPENAME       11
1489 #define GAME_MODE_QUIT                  12
1490
1491 /* special definitions currently only used for custom artwork configuration */
1492 #define MUSIC_PREFIX_BACKGROUND         0
1493 #define NUM_MUSIC_PREFIXES              1
1494 #define MAX_LEVELS                      1000
1495
1496 /* definitions for demo animation lists */
1497 #define HELPANIM_LIST_NEXT              -1
1498 #define HELPANIM_LIST_END               -999
1499
1500
1501 /* program information and versioning definitions */
1502
1503 #define RELEASE_3_1_2                   FALSE
1504
1505 #if RELEASE_3_1_2
1506 #define PROGRAM_VERSION_MAJOR           3
1507 #define PROGRAM_VERSION_MINOR           1
1508 #define PROGRAM_VERSION_PATCH           2
1509 #define PROGRAM_VERSION_BUILD           0
1510 #else
1511 /* !!! make sure that packaging script can find unique version number !!! */
1512 #define PROGRAM_VERSION_MAJOR           3
1513 #define PROGRAM_VERSION_MINOR           2
1514 #define PROGRAM_VERSION_PATCH           0
1515 #define PROGRAM_VERSION_BUILD           5
1516 #endif
1517
1518 #define PROGRAM_TITLE_STRING            "Rocks'n'Diamonds"
1519 #define PROGRAM_AUTHOR_STRING           "Holger Schemel"
1520 #define PROGRAM_COPYRIGHT_STRING       "Copyright Â©1995-2005 by Holger Schemel"
1521
1522 #define ICON_TITLE_STRING               PROGRAM_TITLE_STRING
1523 #define COOKIE_PREFIX                   "ROCKSNDIAMONDS"
1524 #define FILENAME_PREFIX                 "Rocks"
1525
1526 #if defined(PLATFORM_UNIX)
1527 #define USERDATA_DIRECTORY              ".rocksndiamonds"
1528 #elif defined(PLATFORM_WIN32)
1529 #define USERDATA_DIRECTORY              PROGRAM_TITLE_STRING
1530 #else
1531 #define USERDATA_DIRECTORY              "userdata"
1532 #endif
1533
1534 #define X11_ICON_FILENAME               "rocks_icon.xbm"
1535 #define X11_ICONMASK_FILENAME           "rocks_iconmask.xbm"
1536 #define MSDOS_POINTER_FILENAME          "mouse.pcx"
1537
1538 /* file version numbers for resource files (levels, tapes, score, setup, etc.)
1539 ** currently supported/known file version numbers:
1540 **      1.0 (old)
1541 **      1.2 (still in use)
1542 **      1.4 (still in use)
1543 **      2.0 (actual)
1544 */
1545 #define FILE_VERSION_1_0                VERSION_IDENT(1,0,0,0)
1546 #define FILE_VERSION_1_2                VERSION_IDENT(1,2,0,0)
1547 #define FILE_VERSION_1_4                VERSION_IDENT(1,4,0,0)
1548 #define FILE_VERSION_2_0                VERSION_IDENT(2,0,0,0)
1549
1550 /* file version does not change for every program version, but is changed
1551    when new features are introduced that are incompatible with older file
1552    versions, so that they can be treated accordingly */
1553 #define FILE_VERSION_ACTUAL             FILE_VERSION_2_0
1554
1555 #define GAME_VERSION_1_0                FILE_VERSION_1_0
1556 #define GAME_VERSION_1_2                FILE_VERSION_1_2
1557 #define GAME_VERSION_1_4                FILE_VERSION_1_4
1558 #define GAME_VERSION_2_0                FILE_VERSION_2_0
1559
1560 #define GAME_VERSION_ACTUAL             VERSION_IDENT(PROGRAM_VERSION_MAJOR, \
1561                                                       PROGRAM_VERSION_MINOR, \
1562                                                       PROGRAM_VERSION_PATCH, \
1563                                                       PROGRAM_VERSION_BUILD)
1564
1565 /* values for game_emulation */
1566 #define EMU_NONE                        0
1567 #define EMU_BOULDERDASH                 1
1568 #define EMU_SOKOBAN                     2
1569 #define EMU_SUPAPLEX                    3
1570
1571 /* values for level file type identifier */
1572 #define LEVEL_FILE_TYPE_UNKNOWN         0
1573 #define LEVEL_FILE_TYPE_RND             1
1574 #define LEVEL_FILE_TYPE_BD              2
1575 #define LEVEL_FILE_TYPE_EM              3
1576 #define LEVEL_FILE_TYPE_SP              4
1577 #define LEVEL_FILE_TYPE_DX              5
1578 #define LEVEL_FILE_TYPE_SB              6
1579 #define LEVEL_FILE_TYPE_DC              7
1580
1581 #define NUM_LEVEL_FILE_TYPES            8
1582
1583 /* values for game engine type identifier */
1584 #define GAME_ENGINE_TYPE_UNKNOWN        LEVEL_FILE_TYPE_UNKNOWN
1585 #define GAME_ENGINE_TYPE_RND            LEVEL_FILE_TYPE_RND
1586 #define GAME_ENGINE_TYPE_EM             LEVEL_FILE_TYPE_EM
1587
1588 #define NUM_ENGINE_TYPES                3
1589
1590
1591 struct MenuInfo
1592 {
1593   int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
1594   int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
1595
1596   int scrollbar_xoffset;
1597
1598   int list_size[NUM_SPECIAL_GFX_ARGS];
1599
1600   int sound[NUM_SPECIAL_GFX_ARGS];
1601   int music[NUM_SPECIAL_GFX_ARGS];
1602 };
1603
1604 struct DoorInfo
1605 {
1606   int step_offset;
1607   int step_delay;
1608   int anim_mode;
1609 };
1610
1611 struct HiScore
1612 {
1613   char Name[MAX_PLAYER_NAME_LEN + 1];
1614   int Score;
1615 };
1616
1617 struct Content
1618 {
1619   int e[3][3];
1620 };
1621
1622 struct PlayerInfo
1623 {
1624   boolean present;              /* player present in level playfield */
1625   boolean connected;            /* player connected (locally or via network) */
1626   boolean active;               /* player present and connected */
1627
1628   int index_nr;                 /* player number (0 to 3) */
1629   int index_bit;                /* player number bit (1 << 0 to 1 << 3) */
1630   int element_nr;               /* element (EL_PLAYER_1 to EL_PLAYER_4) */
1631   int client_nr;                /* network client identifier */
1632
1633   byte action;                  /* action from local input device */
1634   byte effective_action;        /* action acknowledged from network server
1635                                    or summarized over all configured input
1636                                    devices when in single player mode */
1637   byte programmed_action;       /* action forced by game itself (like moving
1638                                    through doors); overrides other actions */
1639
1640   int jx, jy, last_jx, last_jy;
1641   int MovDir, MovPos, GfxDir, GfxPos;
1642   int Frame, StepFrame;
1643
1644   int GfxAction;
1645
1646   boolean use_murphy_graphic;
1647
1648   boolean block_last_field;
1649   int block_delay_adjustment;   /* needed for different engine versions */
1650
1651   boolean can_fall_into_acid;
1652
1653   boolean LevelSolved, GameOver;
1654
1655   int last_move_dir;
1656
1657   boolean is_waiting;
1658   boolean is_moving;
1659   boolean is_auto_moving;
1660   boolean is_digging;
1661   boolean is_snapping;
1662   boolean is_collecting;
1663   boolean is_pushing;
1664   boolean is_switching;
1665   boolean is_dropping;
1666
1667   boolean is_bored;
1668   boolean is_sleeping;
1669
1670   int frame_counter_bored;
1671   int frame_counter_sleeping;
1672
1673   int anim_delay_counter;
1674   int post_delay_counter;
1675
1676   int action_waiting, last_action_waiting;
1677   int special_action_bored;
1678   int special_action_sleeping;
1679
1680   int num_special_action_bored;
1681   int num_special_action_sleeping;
1682
1683   int switch_x, switch_y;
1684   int drop_x, drop_y;
1685
1686   int show_envelope;
1687
1688   int move_delay;
1689   int move_delay_value;
1690   int move_delay_value_next;
1691   int move_delay_reset_counter;
1692
1693   int push_delay;
1694   int push_delay_value;
1695
1696   unsigned long actual_frame_counter;
1697
1698   int drop_delay;
1699
1700   int step_counter;
1701
1702   int score;
1703   int gems_still_needed;
1704   int sokobanfields_still_needed;
1705   int lights_still_needed;
1706   int friends_still_needed;
1707   int key[MAX_NUM_KEYS];
1708   int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl;
1709   int shield_normal_time_left;
1710   int shield_deadly_time_left;
1711
1712   int inventory_element[MAX_INVENTORY_SIZE];
1713   int inventory_infinite_element;
1714   int inventory_size;
1715 };
1716
1717 struct LevelSetInfo
1718 {
1719   int music[MAX_LEVELS];
1720 };
1721
1722 struct LevelFileInfo
1723 {
1724   int nr;
1725   int type;
1726   boolean packed;
1727   char *basename;
1728   char *filename;
1729 };
1730
1731 struct LevelInfo
1732 {
1733   struct LevelFileInfo file_info;
1734
1735   int game_engine_type;
1736
1737   /* level stored in native format for the alternative native game engines */
1738   struct LevelInfo_EM *native_em_level;
1739
1740   int file_version;     /* file format version the level is stored with    */
1741   int game_version;     /* game release version the level was created with */
1742
1743   boolean encoding_16bit_field;         /* level contains 16-bit elements  */
1744   boolean encoding_16bit_yamyam;        /* yamyam contains 16-bit elements */
1745   boolean encoding_16bit_amoeba;        /* amoeba contains 16-bit elements */
1746
1747   int fieldx, fieldy;
1748
1749   int time;                             /* available time (seconds) */
1750   int gems_needed;
1751
1752   char name[MAX_LEVEL_NAME_LEN + 1];
1753   char author[MAX_LEVEL_AUTHOR_LEN + 1];
1754
1755   char envelope_text[4][MAX_ENVELOPE_TEXT_LEN + 1];
1756   int envelope_xsize[4], envelope_ysize[4];
1757
1758   int score[LEVEL_SCORE_ELEMENTS];
1759
1760   struct Content yamyam_content[MAX_ELEMENT_CONTENTS];
1761   int num_yamyam_contents;
1762
1763   int amoeba_speed;
1764   int amoeba_content;
1765
1766   int game_of_life[4];
1767   int biomaze[4];
1768
1769   int time_magic_wall;
1770   int time_wheel;
1771   int time_light;
1772   int time_timegate;
1773
1774   int shield_normal_time;
1775   int shield_deadly_time;
1776
1777   int extra_time;
1778   int time_orb_time;
1779
1780   /* values for the new EMC elements */
1781   int android_move_time;
1782   int android_clone_time;
1783   boolean ball_random;
1784   boolean ball_state_initial;
1785   int ball_time;
1786   int lenses_score;
1787   int magnify_score;
1788   int slurp_score;
1789   int lenses_time;
1790   int magnify_time;
1791   int wind_direction_initial;
1792   struct Content ball_content[MAX_ELEMENT_CONTENTS];
1793   boolean android_array[16];
1794
1795   int can_move_into_acid_bits;  /* bitfield to store property for elements */
1796   int dont_collide_with_bits;   /* bitfield to store property for elements */
1797
1798   boolean double_speed;
1799   boolean initial_gravity;
1800   boolean em_slippery_gems;     /* EM style "gems slip from wall" behaviour */
1801   boolean use_spring_bug;       /* for compatibility with old levels */
1802   boolean instant_relocation;   /* no visual delay when relocating player */
1803   boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */
1804   boolean grow_into_diggable;   /* amoeba can grow into anything diggable */
1805
1806   boolean block_last_field;     /* player blocks previous field while moving */
1807   boolean sp_block_last_field;  /* player blocks previous field while moving */
1808
1809   /* ('int' instead of 'boolean' because used as selectbox value in editor) */
1810   int use_step_counter;         /* count steps instead of seconds for level */
1811
1812   short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
1813
1814   boolean use_custom_template;  /* use custom properties from template file */
1815
1816   boolean no_valid_file;        /* set when level file missing or invalid */
1817
1818   boolean changed;              /* set when level was changed in the editor */
1819 };
1820
1821 struct TapeInfo
1822 {
1823   int file_version;     /* file format version the tape is stored with    */
1824   int game_version;     /* game release version the tape was created with */
1825   int engine_version;   /* game engine version the tape was recorded with */
1826
1827   char *level_identifier;
1828   int level_nr;
1829   unsigned long random_seed;
1830   unsigned long date;
1831   unsigned long counter;
1832   unsigned long length;
1833   unsigned long length_seconds;
1834   unsigned int delay_played;
1835   boolean pause_before_death;
1836   boolean recording, playing, pausing;
1837   boolean fast_forward;
1838   boolean warp_forward;
1839   boolean deactivate_display;
1840   boolean auto_play;
1841   boolean auto_play_level_solved;
1842   boolean quick_resume;
1843   boolean single_step;
1844   boolean changed;
1845   boolean player_participates[MAX_PLAYERS];
1846   int num_participating_players;
1847
1848   struct
1849   {
1850     byte action[MAX_PLAYERS];
1851     byte delay;
1852   } pos[MAX_TAPE_LEN];
1853
1854   boolean no_valid_file;        /* set when tape file missing or invalid */
1855 };
1856
1857 struct GameInfo
1858 {
1859   /* values for engine initialization */
1860   int default_push_delay_fixed;
1861   int default_push_delay_random;
1862
1863   /* constant within running game */
1864   int engine_version;
1865   int emulation;
1866   int initial_move_delay;
1867   int initial_move_delay_value;
1868   int initial_push_delay_value;
1869
1870   /* flags to handle bugs in and changes between different engine versions */
1871   /* (for the latest engine version, these flags should always be "FALSE") */
1872   boolean use_change_when_pushing_bug;
1873   boolean use_block_last_field_bug;
1874
1875   /* variable within running game */
1876   int yamyam_content_nr;
1877   boolean magic_wall_active;
1878   int magic_wall_time_left;
1879   int light_time_left;
1880   int timegate_time_left;
1881   int belt_dir[4];
1882   int belt_dir_nr[4];
1883   int switchgate_pos;
1884   int wind_direction;
1885   boolean gravity;
1886   boolean explosions_delayed;
1887   boolean envelope_active;
1888
1889   /* values for player idle animation (no effect on engine) */
1890   int player_boring_delay_fixed;
1891   int player_boring_delay_random;
1892   int player_sleeping_delay_fixed;
1893   int player_sleeping_delay_random;
1894
1895   /* values for special game initialization control */
1896   boolean restart_level;
1897 };
1898
1899 struct GlobalInfo
1900 {
1901   char *autoplay_leveldir;
1902   int autoplay_level[MAX_TAPES_PER_SET];
1903   boolean autoplay_all;
1904
1905   char *convert_leveldir;
1906   int convert_level_nr;
1907
1908   int num_toons;
1909
1910   float frames_per_second;
1911   boolean fps_slowdown;
1912   int fps_slowdown_factor;
1913 };
1914
1915 struct ElementChangeInfo
1916 {
1917   boolean can_change;           /* use or ignore this change info */
1918
1919   boolean has_event[NUM_CHANGE_EVENTS];         /* change events */
1920
1921   int trigger_player;           /* player triggering change */
1922   int trigger_side;             /* side triggering change */
1923   int trigger_page;             /* page triggering change */
1924
1925   short target_element;         /* target element after change */
1926
1927   int delay_fixed;              /* added frame delay before changed (fixed) */
1928   int delay_random;             /* added frame delay before changed (random) */
1929   int delay_frames;             /* either 1 (frames) or 50 (seconds; 50 fps) */
1930
1931   short trigger_element;        /* element triggering change */
1932
1933   struct Content target_content;/* elements for extended change target */
1934   boolean use_target_content;   /* use extended change target */
1935   boolean only_if_complete;     /* only use complete target content */
1936   boolean use_random_replace;   /* use random value for replacing elements */
1937   int random_percentage;        /* random value for replacing elements */
1938   int replace_when;             /* type of elements that can be replaced */
1939
1940   boolean explode;              /* explode instead of change */
1941
1942   boolean has_action;           /* execute action on specified condition */
1943   int action_type;              /* type of action */
1944   int action_mode;              /* mode of action */
1945   int action_arg;               /* parameter of action */
1946
1947   /* ---------- internal values used at runtime when playing ---------- */
1948
1949   /* functions that are called before, while and after the change of an
1950      element -- currently only used for non-custom elements */
1951   void (*pre_change_function)(int x, int y);
1952   void (*change_function)(int x, int y);
1953   void (*post_change_function)(int x, int y);
1954
1955   short actual_trigger_element; /* element that actually triggered change */
1956   int actual_trigger_side;      /* element side that triggered the change */
1957   int actual_trigger_player;    /* player which actually triggered change */
1958   int actual_trigger_ce_value;  /* CE value of element that triggered change */
1959
1960   boolean can_change_or_has_action;     /* can_change | has_action */
1961
1962   /* ---------- internal values used in level editor ---------- */
1963
1964   int direct_action;            /* change triggered by actions on element */
1965   int other_action;             /* change triggered by other element actions */
1966 };
1967
1968 struct ElementGroupInfo
1969 {
1970   int num_elements;                     /* number of elements in this group */
1971   short element[MAX_ELEMENTS_IN_GROUP]; /* list of elements in this group */
1972
1973   int choice_mode;              /* how to choose element from group */
1974
1975   /* ---------- internal values used at runtime when playing ---------- */
1976
1977   /* the following is the same as above, but with recursively resolved group
1978      elements (group elements may also contain further group elements!) */
1979   int num_elements_resolved;
1980   short element_resolved[NUM_FILE_ELEMENTS];
1981
1982   int choice_pos;               /* current element choice position */
1983 };
1984
1985 struct ElementNameInfo
1986 {
1987   /* ---------- token and description strings ---------- */
1988
1989   char *token_name;             /* element token used in config files */
1990   char *class_name;             /* element class used in config files */
1991   char *editor_description;     /* pre-defined description for level editor */
1992 };
1993
1994 struct ElementInfo
1995 {
1996   /* ---------- token and description strings ---------- */
1997
1998   char *token_name;             /* element token used in config files */
1999   char *class_name;             /* element class used in config files */
2000   char *editor_description;     /* pre-defined description for level editor */
2001   char *custom_description;     /* alternative description from config file */
2002   char description[MAX_ELEMENT_NAME_LEN + 1];   /* for custom/group elements */
2003
2004   /* ---------- graphic and sound definitions ---------- */
2005
2006   int graphic[NUM_ACTIONS];     /* default graphics for several actions */
2007   int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
2008                                 /* special graphics for left/right/up/down */
2009
2010   int crumbled[NUM_ACTIONS];    /* crumbled graphics for several actions */
2011   int direction_crumbled[NUM_ACTIONS][NUM_DIRECTIONS];
2012                                 /* crumbled graphics for left/right/up/down */
2013
2014   int special_graphic[NUM_SPECIAL_GFX_ARGS];
2015                                 /* special graphics for certain screens */
2016
2017   int sound[NUM_ACTIONS];       /* default sounds for several actions */
2018
2019   /* ---------- special element property values ---------- */
2020
2021   boolean use_gfx_element;      /* use custom graphic element */
2022   short gfx_element;            /* optional custom graphic element */
2023
2024   int access_direction;         /* accessible from which direction */
2025
2026   int collect_score_initial;    /* initial score value for collecting */
2027   int collect_count_initial;    /* initial count value for collecting */
2028
2029   int ce_value_fixed_initial;   /* initial value for custom variable (fix) */
2030   int ce_value_random_initial;  /* initial value for custom variable (rnd) */
2031   boolean use_last_ce_value;    /* use value from element before change */
2032
2033   int push_delay_fixed;         /* constant delay before pushing */
2034   int push_delay_random;        /* additional random delay before pushing */
2035   int drop_delay_fixed;         /* constant delay after dropping */
2036   int drop_delay_random;        /* additional random delay after dropping */
2037   int move_delay_fixed;         /* constant delay after moving */
2038   int move_delay_random;        /* additional random delay after moving */
2039
2040   int move_pattern;             /* direction movable element moves to */
2041   int move_direction_initial;   /* initial direction element moves to */
2042   int move_stepsize;            /* step size element moves with */
2043
2044   int move_enter_element;       /* element that can be entered (and removed) */
2045   int move_leave_element;       /* element that can be left behind */
2046   int move_leave_type;          /* change (limited) or leave (unlimited) */
2047
2048   int slippery_type;            /* how/where other elements slip away */
2049
2050   struct Content content;       /* new elements after explosion */
2051
2052   int explosion_type;           /* type of explosion, like 3x3, 3+3 or 1x1 */
2053   int explosion_delay;          /* duration of explosion of this element */
2054   int ignition_delay;           /* delay for explosion by other explosion */
2055
2056   struct ElementChangeInfo *change_page; /* actual list of change pages */
2057   struct ElementChangeInfo *change;      /* pointer to current change page */
2058
2059   int num_change_pages;         /* actual number of change pages */
2060   int current_change_page;      /* currently edited change page */
2061
2062   struct ElementGroupInfo *group;       /* pointer to element group info */
2063
2064   /* ---------- internal values used at runtime when playing ---------- */
2065
2066   boolean has_change_event[NUM_CHANGE_EVENTS];
2067
2068   int event_page_nr[NUM_CHANGE_EVENTS]; /* page number for each event */
2069   struct ElementChangeInfo *event_page[NUM_CHANGE_EVENTS]; /* page for event */
2070
2071   boolean in_group[NUM_GROUP_ELEMENTS];
2072
2073   int collect_score;            /* runtime score value for collecting */
2074
2075   /* ---------- internal values used in level editor ---------- */
2076
2077   int access_type;              /* walkable or passable */
2078   int access_layer;             /* accessible over/inside/under */
2079   int access_protected;         /* protection against deadly elements */
2080   int walk_to_action;           /* diggable/collectible/pushable */
2081   int smash_targets;            /* can smash player/enemies/everything */
2082   int deadliness;               /* deadly when running/colliding/touching */
2083
2084   boolean can_explode_by_fire;  /* element explodes by fire */
2085   boolean can_explode_smashed;  /* element explodes when smashed */
2086   boolean can_explode_impact;   /* element explodes on impact */
2087
2088   boolean modified_settings;    /* set for all modified custom elements */
2089 };
2090
2091 struct FontInfo
2092 {
2093   char *token_name;             /* font token used in config files */
2094
2095   int graphic;                  /* default graphic for this font */
2096   int special_graphic[NUM_SPECIAL_GFX_ARGS];
2097                                 /* special graphics for certain screens */
2098   int special_bitmap_id[NUM_SPECIAL_GFX_ARGS];
2099                                 /* internal bitmap ID for special graphics */
2100 };
2101
2102 struct GraphicInfo
2103 {
2104   Bitmap *bitmap;
2105   int src_image_width;          /* scaled bitmap size, but w/o small images */
2106   int src_image_height;         /* scaled bitmap size, but w/o small images */
2107
2108   int src_x, src_y;             /* start position of animation frames */
2109   int width, height;            /* width/height of each animation frame */
2110   int offset_x, offset_y;       /* x/y offset to next animation frame */
2111   int offset2_x, offset2_y;     /* x/y offset to second movement tile */
2112   boolean double_movement;      /* animation has second movement tile */
2113   int swap_double_tiles;        /* explicitely force or forbid tile swapping */
2114   int anim_frames;
2115   int anim_frames_per_line;
2116   int anim_start_frame;
2117   int anim_delay;               /* important: delay of 1 means "no delay"! */
2118   int anim_mode;
2119   boolean anim_global_sync;
2120   int crumbled_like;            /* element for cloning crumble graphics */
2121   int diggable_like;            /* element for cloning digging graphics */
2122   int border_size;              /* border size for "crumbled" graphics */
2123   int scale_up_factor;          /* optional factor for scaling image up */
2124   int clone_from;               /* graphic for cloning *all* settings */
2125
2126   int anim_delay_fixed;         /* optional delay values for bored and   */
2127   int anim_delay_random;        /* sleeping player animations (animation */
2128   int post_delay_fixed;         /* intervall and following pause before  */
2129   int post_delay_random;        /* next intervall (bored animation only) */
2130
2131   int step_offset;              /* optional step offset of toon animations */
2132   int step_delay;               /* optional step delay of toon animations */
2133
2134   int draw_x, draw_y;           /* optional offset for drawing fonts chars */
2135
2136   int draw_masked;              /* optional setting for drawing envelope gfx */
2137
2138 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
2139   Pixmap clip_mask;             /* single-graphic-only clip mask for X11 */
2140   GC clip_gc;                   /* single-graphic-only clip gc for X11 */
2141 #endif
2142 };
2143
2144 struct SoundInfo
2145 {
2146   boolean loop;
2147   int volume;
2148   int priority;
2149 };
2150
2151 struct MusicInfo
2152 {
2153   boolean loop;
2154 };
2155
2156 struct MusicPrefixInfo
2157 {
2158   char *prefix;
2159   boolean is_loop_music;
2160 };
2161
2162 struct MusicFileInfo
2163 {
2164   char *basename;
2165
2166   char *title_header;
2167   char *artist_header;
2168   char *album_header;
2169   char *year_header;
2170
2171   char *title;
2172   char *artist;
2173   char *album;
2174   char *year;
2175
2176   int music;
2177
2178   boolean is_sound;
2179
2180   struct MusicFileInfo *next;
2181 };
2182
2183 struct ElementActionInfo
2184 {
2185   char *suffix;
2186   int value;
2187   boolean is_loop_sound;
2188 };
2189
2190 struct ElementDirectionInfo
2191 {
2192   char *suffix;
2193   int value;
2194 };
2195
2196 struct SpecialSuffixInfo
2197 {
2198   char *suffix;
2199   int value;
2200 };
2201
2202 struct HelpAnimInfo
2203 {
2204   int element;
2205   int action;
2206   int direction;
2207
2208   int delay;
2209 };
2210
2211
2212 extern Bitmap                  *bitmap_db_field, *bitmap_db_door;
2213 extern Pixmap                   tile_clipmask[];
2214 extern DrawBuffer             *fieldbuffer;
2215 extern DrawBuffer             *drawto_field;
2216
2217 extern int                      game_status;
2218 extern boolean                  level_editor_test_game;
2219 extern boolean                  network_playing;
2220
2221 #if defined(TARGET_SDL)
2222 extern boolean                  network_server;
2223 extern SDL_Thread              *server_thread;
2224 #endif
2225
2226 extern int                      key_joystick_mapping;
2227
2228 extern boolean                  redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
2229 extern int                      redraw_x1, redraw_y1;
2230
2231 extern short                    Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2232 extern short                    MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2233 extern short                    MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2234 extern short                    MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2235 extern short                    ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2236 extern short                    ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2237 extern short                    CustomValue[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2238 extern short                    Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2239 extern short                    Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2240 extern short                    StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2241 extern short                    Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2242 extern boolean                  Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2243 extern boolean                  Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2244 extern boolean                  Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2245 extern short                    ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2246 extern short                    WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2247 extern short                    WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2248 extern short                    CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2249 extern short                    AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2250 extern short                    AmoebaCnt[MAX_NUM_AMOEBA];
2251 extern short                    AmoebaCnt2[MAX_NUM_AMOEBA];
2252 extern short                    ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2253 extern short                    ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2254 extern short                    ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2255 extern int                      RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2256 extern int                      PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2257
2258 extern unsigned long            Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS];
2259
2260 extern int                      GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2261 extern int                      GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2262 extern int                      GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2263 extern int                      GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2264 extern int                      GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
2265
2266 extern int                      lev_fieldx, lev_fieldy;
2267 extern int                      scroll_x, scroll_y;
2268
2269 extern int                      FX, FY;
2270 extern int                      ScrollStepSize;
2271 extern int                      ScreenMovDir, ScreenMovPos, ScreenGfxPos;
2272 extern int                      BorderElement;
2273 extern int                      GameFrameDelay;
2274 extern int                      FfwdFrameDelay;
2275 extern int                      BX1, BY1;
2276 extern int                      BX2, BY2;
2277 extern int                      SBX_Left, SBX_Right;
2278 extern int                      SBY_Upper, SBY_Lower;
2279 extern int                      ZX, ZY;
2280 extern int                      ExitX, ExitY;
2281 extern int                      AllPlayersGone;
2282
2283 extern int                      TimeFrames, TimePlayed, TimeLeft, TapeTime;
2284 extern boolean                  SiebAktiv;
2285 extern int                      SiebCount;
2286
2287 extern boolean                  network_player_action_received;
2288
2289 extern int                      graphics_action_mapping[];
2290
2291 extern struct LevelSetInfo      levelset;
2292 extern struct LevelInfo         level, level_template;
2293 extern struct PlayerInfo        stored_player[], *local_player;
2294 extern struct HiScore           highscore[];
2295 extern struct TapeInfo          tape;
2296 extern struct GameInfo          game;
2297 extern struct GlobalInfo        global;
2298 extern struct MenuInfo          menu;
2299 extern struct DoorInfo          door_1, door_2;
2300 extern struct ElementInfo       element_info[];
2301 extern struct ElementNameInfo   element_name_info[];
2302 extern struct ElementActionInfo element_action_info[];
2303 extern struct ElementDirectionInfo element_direction_info[];
2304 extern struct SpecialSuffixInfo special_suffix_info[];
2305 extern struct TokenIntPtrInfo   image_config_vars[];
2306 extern struct FontInfo          font_info[];
2307 extern struct MusicPrefixInfo   music_prefix_info[];
2308 extern struct GraphicInfo      *graphic_info;
2309 extern struct SoundInfo        *sound_info;
2310 extern struct MusicInfo        *music_info;
2311 extern struct MusicFileInfo    *music_file_info;
2312 extern struct HelpAnimInfo     *helpanim_info;
2313 extern SetupFileHash           *helptext_info;
2314 extern struct ConfigTypeInfo    image_config_suffix[];
2315 extern struct ConfigTypeInfo    sound_config_suffix[];
2316 extern struct ConfigTypeInfo    music_config_suffix[];
2317 extern struct ConfigInfo        image_config[];
2318 extern struct ConfigInfo        sound_config[];
2319 extern struct ConfigInfo        music_config[];
2320 extern struct ConfigInfo        helpanim_config[];
2321 extern struct ConfigInfo        helptext_config[];
2322
2323 #endif  /* MAIN_H */