rnd-20020906-3-src
[rocksndiamonds.git] / src / main.c
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.c                                                   *
12 ***********************************************************/
13
14 #include "libgame/libgame.h"
15
16 #include "main.h"
17 #include "init.h"
18 #include "game.h"
19 #include "events.h"
20
21 GC              tile_clip_gc;
22 Bitmap         *pix[NUM_BITMAPS];
23 Pixmap          tile_clipmask[NUM_TILES];
24 DrawBuffer     *fieldbuffer;
25 DrawBuffer     *drawto_field;
26
27 int             game_status = MAINMENU;
28 boolean         level_editor_test_game = FALSE;
29 boolean         network_playing = FALSE;
30
31 int             key_joystick_mapping = 0;
32
33 boolean         redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
34 int             redraw_x1 = 0, redraw_y1 = 0;
35
36 short           Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
37 short           Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
38 short           MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
39 short           MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
40 short           MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
41 short           Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
42 short           Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
43 short           StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
44 short           Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
45 boolean         Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
46 short           JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
47 short           AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
48 short           AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
49 short           ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
50 unsigned long   Elementeigenschaften1[MAX_ELEMENTS];
51 unsigned long   Elementeigenschaften2[MAX_ELEMENTS];
52
53 int             lev_fieldx,lev_fieldy, scroll_x,scroll_y;
54
55 int             FX = SX, FY = SY, ScrollStepSize;
56 int             ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
57 int             ScreenGfxPos = 0;
58 int             BorderElement = EL_BETON;
59 int             GameFrameDelay = GAME_FRAME_DELAY;
60 int             FfwdFrameDelay = FFWD_FRAME_DELAY;
61 int             BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
62 int             SBX_Left, SBX_Right;
63 int             SBY_Upper, SBY_Lower;
64 int             ZX,ZY, ExitX,ExitY;
65 int             AllPlayersGone;
66
67 int             TimeFrames, TimePlayed, TimeLeft;
68
69 boolean         network_player_action_received = FALSE;
70
71 struct LevelInfo        level;
72 struct PlayerInfo       stored_player[MAX_PLAYERS], *local_player = NULL;
73 struct HiScore          highscore[MAX_SCORE_ENTRIES];
74 struct TapeInfo         tape;
75 struct SetupInfo        setup;
76 struct GameInfo         game;
77 struct GlobalInfo       global;
78
79 /* filenames of sound effects */
80 char *sound_name[NUM_SOUNDS] =
81 {
82   "amoebe.wav",
83   "antigrav.wav",
84   "autsch.wav",
85   "blurb.wav",
86   "bong.wav",
87   "buing.wav",
88   "deng.wav",
89   "fuel.wav",
90   "gong.wav",
91   "halloffame.wav",
92   "holz.wav",
93   "hui.wav",
94   "kabumm.wav",
95   "kink.wav",
96   "klapper.wav",
97   "kling.wav",
98   "klopf.wav",
99   "klumpf.wav",
100   "knack.wav",
101   "knurk.wav",
102   "krach.wav",
103   "lachen.wav",
104   "laser.wav",
105   "miep.wav",
106   "njam.wav",
107   "oeffnen.wav",
108   "pling.wav",
109   "pong.wav",
110   "pusch.wav",
111   "quiek.wav",
112   "quirk.wav",
113   "rhythmloop.wav",
114   "roaaar.wav",
115   "roehr.wav",
116   "rumms.wav",
117   "schlopp.wav",
118   "schlurf.wav",
119   "schrff.wav",
120   "schwirr.wav",
121   "sirr.wav",
122   "slurp.wav",
123   "sproing.wav",
124   "warnton.wav",
125   "whoosh.wav",
126   "zisch.wav",
127   "base.wav",
128   "infotron.wav",
129   "zonkdown.wav",
130   "zonkpush.wav",
131   "bug.wav",
132   "boom.wav",
133   "booom.wav",
134   "exit.wav",
135   "empty.wav",
136   "gate.wav"
137 };
138
139 struct ConfigInfo image_config[] =
140 {
141   /* graphics for Boulder Dash style elements and actions */
142   { "bd_diamond",                       "bd_diamond.pcx"        },
143   { "bd_diamond.frame_xpos",            "0"                     },
144   { "bd_diamond.num_frames",            "1"                     },
145   { "robot_wheel",                      "bd_diamond.pcx"        },
146   { "robot_wheel.frame_xpos",           "0"                     },
147   { "robot_wheel.num_frames",           "4"                     },
148
149   { NULL,                               NULL                    },
150 };
151
152 struct ConfigInfo sound_config[] =
153 {
154   /* sounds for Boulder Dash style elements and actions */
155   { "bd_empty_space.digging",           "empty.wav"             },
156   { "bd_sand.digging",                  "schlurf.wav"           },
157   { "bd_diamond.collecting",            "pong.wav"              },
158   { "bd_diamond.impact",                "pling.wav"             },
159   { "bd_rock.pushing",                  "pusch.wav"             },
160   { "bd_rock.impact",                   "klopf.wav"             },
161   { "bd_magic_wall.activating",         "quirk.wav"             },
162   { "bd_magic_wall.changing",           "quirk.wav"             },
163   { "bd_magic_wall.running",            "miep.wav"              },
164   { "bd_amoeba.waiting",                SND_FILE_UNDEFINED      },
165   { "bd_amoeba.creating",               "amoebe.wav"            },
166   { "bd_amoeba.turning_to_gem",         "pling.wav"             },
167   { "bd_amoeba.turning_to_rock",        "klopf.wav"             },
168   { "bd_butterfly.moving",              "klapper.wav"           },
169   { "bd_butterfly.waiting",             "klapper.wav"           },
170   { "bd_firefly.moving",                "roehr.wav"             },
171   { "bd_firefly.waiting",               "roehr.wav"             },
172   { "bd_exit.entering",                 "buing.wav"             },
173
174   /* sounds for Supaplex style elements and actions */
175   { "sp_empty_space.digging",           "empty.wav"             },
176   { "sp_base.digging",                  "base.wav"              },
177   { "sp_buggy_base.digging",            "base.wav"              },
178   { "sp_buggy_base.activating",         "bug.wav"               },
179   { "sp_infotron.collecting",           "infotron.wav"          },
180   { "sp_infotron.impact",               "pling.wav"             },
181   { "sp_zonk.pushing",                  "zonkpush.wav"          },
182   { "sp_zonk.impact",                   "zonkdown.wav"          },
183   { "sp_disk_red.collecting",           "infotron.wav"          },
184   { "sp_disk_orange.pushing",           "zonkpush.wav"          },
185   { "sp_disk_yellow.pushing",           "pusch.wav"             },
186   { "sp_port.passing",                  "gate.wav"              },
187   { "sp_exit.entering",                 "exit.wav"              },
188   { "sp_element.exploding",             "booom.wav"             },
189   { "sp_sniksnak.moving",               SND_FILE_UNDEFINED      },
190   { "sp_sniksnak.waiting",              SND_FILE_UNDEFINED      },
191   { "sp_electron.moving",               SND_FILE_UNDEFINED      },
192   { "sp_electron.waiting",              SND_FILE_UNDEFINED      },
193   { "sp_terminal.activating",           SND_FILE_UNDEFINED      },
194
195   /* sounds for Sokoban style elements and actions */
196   { "sokoban_object.pushing",           "pusch.wav"             },
197   { "sokoban_field.filling",            "deng.wav"              },
198   { "sokoban_field.clearing",           SND_FILE_UNDEFINED      },
199   { "sokoban_game.solving",             "buing.wav"             },
200
201   /* sounds for Emerald Mine style elements and actions */
202   { "empty_space.digging",              "empty.wav"             },
203   { "sand.digging",                     "schlurf.wav"           },
204   { "emerald.collecting",               "pong.wav"              },
205   { "emerald.impact",                   "pling.wav"             },
206   { "diamond.collecting",               "pong.wav"              },
207   { "diamond.impact",                   "pling.wav"             },
208   { "diamond.breaking",                 "quirk.wav"             },
209   { "rock.pushing",                     "pusch.wav"             },
210   { "rock.impact",                      "klopf.wav"             },
211   { "bomb.pushing",                     "pusch.wav"             },
212   { "nut.pushing",                      "knurk.wav"             },
213   { "nut.cracking",                     "knack.wav"             },
214   { "nut.impact",                       "klumpf.wav"            },
215   { "dynamite.collecting",              "pong.wav"              },
216   { "dynamite.placing",                 "deng.wav"              },
217   { "dynamite.burning",                 "zisch.wav"             },
218   { "key.collecting",                   "pong.wav"              },
219   { "gate.passing",                     "gate.wav"              },
220   { "bug.moving",                       "klapper.wav"           },
221   { "bug.waiting",                      "klapper.wav"           },
222   { "spaceship.moving",                 "roehr.wav"             },
223   { "spaceship.waiting",                "roehr.wav"             },
224   { "yamyam.moving",                    SND_FILE_UNDEFINED      },
225   { "yamyam.waiting",                   "njam.wav"              },
226   { "yamyam.eating_diamond",            SND_FILE_UNDEFINED      },
227   { "robot.stepping",                   "schlurf.wav"           },
228   { "robot.waiting",                    SND_FILE_UNDEFINED      },
229   { "robot_wheel.activating",           "deng.wav"              },
230   { "robot_wheel.running",              "miep.wav"              },
231   { "magic_wall.activating",            "quirk.wav"             },
232   { "magic_wall.changing",              "quirk.wav"             },
233   { "magic_wall.running",               "miep.wav"              },
234   { "amoeba.waiting",                   SND_FILE_UNDEFINED      },
235   { "amoeba.creating",                  "amoebe.wav"            },
236   { "amoeba.dropping",                  SND_FILE_UNDEFINED      },
237   { "acid.splashing",                   "blurb.wav"             },
238   { "quicksand.filling",                SND_FILE_UNDEFINED      },
239   { "quicksand.slipping_through",       SND_FILE_UNDEFINED      },
240   { "quicksand.emptying",               SND_FILE_UNDEFINED      },
241   { "exit.opening",                     "oeffnen.wav"           },
242   { "exit.entering",                    "buing.wav"             },
243
244   /* sounds for Emerald Mine Club style elements and actions */
245   { "balloon.moving",                   SND_FILE_UNDEFINED      },
246   { "balloon.waiting",                  SND_FILE_UNDEFINED      },
247   { "balloon.pushing",                  "schlurf.wav"           },
248   { "balloon_switch.activating",        SND_FILE_UNDEFINED      },
249   { "spring.moving",                    SND_FILE_UNDEFINED      },
250   { "spring.pushing",                   "pusch.wav"             },
251   { "spring.impact",                    "klopf.wav"             },
252   { "wall.growing",                     SND_FILE_UNDEFINED      },
253
254   /* sounds for Diamond Caves style elements and actions */
255   { "pearl.collecting",                 "pong.wav"              },
256   { "pearl.breaking",                   "knack.wav"             },
257   { "pearl.impact",                     "pling.wav"             },
258   { "crystal.collecting",               "pong.wav"              },
259   { "crystal.impact",                   "pling.wav"             },
260   { "envelope.collecting",              "pong.wav"              },
261   { "sand_invisible.digging",           "schlurf.wav"           },
262   { "shield_passive.collecting",        "pong.wav"              },
263   { "shield_passive.activated",         SND_FILE_UNDEFINED      },
264   { "shield_active.collecting",         "pong.wav"              },
265   { "shield_active.activated",          SND_FILE_UNDEFINED      },
266   { "extra_time.collecting",            "gong.wav"              },
267   { "mole.moving",                      SND_FILE_UNDEFINED      },
268   { "mole.waiting",                     SND_FILE_UNDEFINED      },
269   { "mole.eating_amoeba",               "blurb.wav"             },
270   { "switchgate_switch.activating",     SND_FILE_UNDEFINED      },
271   { "switchgate.opening",               "oeffnen.wav"           },
272   { "switchgate.closing",               "oeffnen.wav"           },
273   { "switchgate.passing",               "gate.wav"              },
274   { "timegate_wheel.activating",        "deng.wav"              },
275   { "timegate_wheel.running",           "miep.wav"              },
276   { "timegate.opening",                 "oeffnen.wav"           },
277   { "timegate.closing",                 "oeffnen.wav"           },
278   { "timegate.passing",                 "gate.wav"              },
279   { "conveyor_belt_switch.activating",  SND_FILE_UNDEFINED      },
280   { "conveyor_belt.running",            SND_FILE_UNDEFINED      },
281   { "light_switch.activating",          SND_FILE_UNDEFINED      },
282   { "light_switch.deactivating",        SND_FILE_UNDEFINED      },
283
284   /* sounds for DX Boulderdash style elements and actions */
285   { "dx_bomb.pushing",                  "pusch.wav"             },
286   { "trap_inactive.digging",            "schlurf.wav"           },
287   { "trap.activating",                  SND_FILE_UNDEFINED      },
288   { "tube.passing",                     SND_FILE_UNDEFINED      },
289
290   /* sounds for Rocks'n'Diamonds style elements and actions */
291   { "amoeba.turning_to_gem",            "pling.wav"             },
292   { "amoeba.turning_to_rock",           "klopf.wav"             },
293   { "speed_pill.collecting",            "pong.wav"              },
294   { "dynabomb_nr.collecting",           "pong.wav"              },
295   { "dynabomb_sz.collecting",           "pong.wav"              },
296   { "dynabomb_xl.collecting",           "pong.wav"              },
297   { "dynabomb.placing",                 "deng.wav"              },
298   { "dynabomb.burning",                 "zisch.wav"             },
299   { "satellite.moving",                 SND_FILE_UNDEFINED      },
300   { "satellite.waiting",                SND_FILE_UNDEFINED      },
301   { "satellite.pushing",                "pusch.wav"             },
302   { "lamp.activating",                  "deng.wav"              },
303   { "lamp.deactivating",                "deng.wav"              },
304   { "time_orb_full.collecting",         "gong.wav"              },
305   { "time_orb_full.impact",             "deng.wav"              },
306   { "time_orb_empty.pushing",           "pusch.wav"             },
307   { "time_orb_empty.impact",            "deng.wav"              },
308   { "gameoflife.waiting",               SND_FILE_UNDEFINED      },
309   { "gameoflife.creating",              "amoebe.wav"            },
310   { "biomaze.waiting",                  SND_FILE_UNDEFINED      },
311   { "biomaze.creating",                 "amoebe.wav"            },
312   { "pacman.moving",                    SND_FILE_UNDEFINED      },
313   { "pacman.waiting",                   SND_FILE_UNDEFINED      },
314   { "pacman.eating_amoeba",             SND_FILE_UNDEFINED      },
315   { "dark_yamyam.moving",               SND_FILE_UNDEFINED      },
316   { "dark_yamyam.waiting",              "njam.wav"              },
317   { "dark_yamyam.eating_any",           SND_FILE_UNDEFINED      },
318   { "penguin.moving",                   SND_FILE_UNDEFINED      },
319   { "penguin.waiting",                  SND_FILE_UNDEFINED      },
320   { "penguin.entering_exit",            "buing.wav"             },
321   { "pig.moving",                       SND_FILE_UNDEFINED      },
322   { "pig.waiting",                      SND_FILE_UNDEFINED      },
323   { "pig.eating_gem",                   SND_FILE_UNDEFINED      },
324   { "dragon.moving",                    SND_FILE_UNDEFINED      },
325   { "dragon.waiting",                   SND_FILE_UNDEFINED      },
326   { "dragon.attacking",                 SND_FILE_UNDEFINED      },
327
328   /* sounds for generic elements and actions */
329   { "player.dying",                     "autsch.wav"            },
330   { "element.exploding",                "roaaar.wav"            },
331
332   /* sounds for other game actions */
333   { "game.starting",                    SND_FILE_UNDEFINED      },
334   { "game.running_out_of_time",         "gong.wav"              },
335   { "game.leveltime_bonus",             "sirr.wav"              },
336   { "game.losing",                      "lachen.wav"            },
337   { "game.winning",                     SND_FILE_UNDEFINED      },
338
339   /* sounds for other non-game actions */
340   { "menu.door_opening",                "oeffnen.wav"           },
341   { "menu.door_closing",                "oeffnen.wav"           },
342   { "menu.hall_of_fame",                "halloffame.wav"        },
343   { "menu.info_screen",                 "rhythmloop.wav"        },
344
345 #if 0
346   { "[not used]",                       "antigrav.wav"          },
347   { "[not used]",                       "bong.wav"              },
348   { "[not used]",                       "fuel.wav"              },
349   { "[not used]",                       "holz.wav"              },
350   { "[not used]",                       "hui.wav"               },
351   { "[not used]",                       "kabumm.wav"            },
352   { "[not used]",                       "kink.wav"              },
353   { "[not used]",                       "kling.wav"             },
354   { "[not used]",                       "krach.wav"             },
355   { "[not used]",                       "laser.wav"             },
356   { "[not used]",                       "quiek.wav"             },
357   { "[not used]",                       "rumms.wav"             },
358   { "[not used]",                       "schlopp.wav"           },
359   { "[not used]",                       "schrff.wav"            },
360   { "[not used]",                       "schwirr.wav"           },
361   { "[not used]",                       "slurp.wav"             },
362   { "[not used]",                       "sproing.wav"           },
363   { "[not used]",                       "warnton.wav"           },
364   { "[not used]",                       "whoosh.wav"            },
365   { "[not used]",                       "boom.wav"              },
366 #endif
367
368   { NULL,                               NULL                    },
369 };
370
371 struct FileInfo *image_files;
372 struct FileInfo *sound_files;
373
374 struct ElementInfo element_info[MAX_ELEMENTS] =
375 {
376   { "empty_space",              "empty space"                   },      /* 0 */
377   { "sand",                     "sand"                          },
378   { "wall",                     "normal wall"                   },
379   { "wall",                     "round wall"                    },
380   { "rock",                     "rock"                          },
381   { "key",                      "key"                           },
382   { "emerald",                  "emerald"                       },
383   { "exit",                     "closed exit"                   },
384   { "player",                   "player"                        },
385   { "bug",                      "bug"                           },
386   { "spaceship",                "spaceship"                     },     /* 10 */
387   { "yamyam",                   "yam yam"                       },
388   { "robot",                    "robot"                         },
389   { "wall",                     "steel wall"                    },
390   { "diamond",                  "diamond"                       },
391   { "amoeba",                   "dead amoeba"                   },
392   { "quicksand",                "empty quicksand"               },
393   { "quicksand",                "quicksand with rock"           },
394   { "amoeba",                   "amoeba drop"                   },
395   { "bomb",                     "bomb"                          },
396   { "magic_wall",               "magic wall"                    },     /* 20 */
397   { "speed_pill",               "speed pill"                    },
398   { "acid",                     "acid pool"                     },
399   { "amoeba",                   "dropping amoeba"               },
400   { "amoeba",                   "normal amoeba"                 },
401   { "nut",                      "nut with emerald"              },
402   { "gameoflife",               "Conway's wall of life"         },
403   { "biomaze",                  "biomaze"                       },
404   { "dynamite",                 "burning dynamite"              },
405   { NULL,                       "unknown"                       },
406   { "robot_wheel",              "magic wheel"                   },     /* 30 */
407   { "robot_wheel",              "magic wheel (running)"         },
408   { "key",                      "red key"                       },
409   { "key",                      "yellow key"                    },
410   { "key",                      "green key"                     },
411   { "key",                      "blue key"                      },
412   { "gate",                     "red door"                      },
413   { "gate",                     "yellow door"                   },
414   { "gate",                     "green door"                    },
415   { "gate",                     "blue door"                     },
416   { "gate",                     "gray door (opened by red key)" },     /* 40 */
417   { "gate",                     "gray door (opened by yellow key)"},
418   { "gate",                     "gray door (opened by green key)"},
419   { "gate",                     "gray door (opened by blue key)"},
420   { "dynamite",                 "dynamite"                      },
421   { "pacman",                   "pac man"                       },
422   { "wall",                     "invisible normal wall"         },
423   { "lamp",                     "lamp (off)"                    },
424   { "lamp",                     "lamp (on)"                     },
425   { "wall",                     "wall with emerald"             },
426   { "wall",                     "wall with diamond"             },     /* 50 */
427   { "amoeba",                   "amoeba with content"           },
428   { "bd_amoeba",                "amoeba (BD style)"             },
429   { "time_orb_full",            "time orb (full)"               },
430   { "time_orb_empty",           "time orb (empty)"              },
431   { "wall",                     "growing wall"                  },
432   { "bd_diamond",               "diamond (BD style)"            },
433   { "emerald",                  "yellow emerald"                },
434   { "wall",                     "wall with BD style diamond"    },
435   { "wall",                     "wall with yellow emerald"      },
436   { "dark_yamyam",              "dark yam yam"                  },     /* 60 */
437   { "bd_magic_wall",            "magic wall (BD style)"         },
438   { "wall",                     "invisible steel wall"          },
439   { NULL,                       "-"                             },
440   { "dynabomb_nr",              "increases number of bombs"     },
441   { "dynabomb_sz",              "increases explosion size"      },
442   { "dynabomb_xl",              "increases power of explosion"  },
443   { "sokoban_object",           "sokoban object"                },
444   { "sokoban_field",            "sokoban empty field"           },
445   { "sokoban_field",            "sokoban field with object"     },
446   { "bd_butterfly",             "butterfly (starts moving right)"},    /* 70 */
447   { "bd_butterfly",             "butterfly (starts moving up)"  },
448   { "bd_butterfly",             "butterfly (starts moving left)"},
449   { "bd_butterfly",             "butterfly (starts moving down)"},
450   { "bd_firefly",               "firefly (starts moving right)" },
451   { "bd_firefly",               "firefly (starts moving up)"    },
452   { "bd_firefly",               "firefly (starts moving left)"  },
453   { "bd_firefly",               "firefly (starts moving down)"  },
454   { "bd_butterfly",             "butterfly"                     },
455   { "bd_firefly",               "firefly"                       },
456   { "player",                   "yellow player"                 },     /* 80 */
457   { "player",                   "red player"                    },
458   { "player",                   "green player"                  },
459   { "player",                   "blue player"                   },
460   { "bug",                      "bug (starts moving right)"     },
461   { "bug",                      "bug (starts moving up)"        },
462   { "bug",                      "bug (starts moving left)"      },
463   { "bug",                      "bug (starts moving down)"      },
464   { "spaceship",                "spaceship (starts moving right)"},
465   { "spaceship",                "spaceship (starts moving up)"  },
466   { "spaceship",                "spaceship (starts moving left)"},     /* 90 */
467   { "spaceship",                "spaceship (starts moving down)"},
468   { "pacman",                   "pac man (starts moving right)" },
469   { "pacman",                   "pac man (starts moving up)"    },
470   { "pacman",                   "pac man (starts moving left)"  },
471   { "pacman",                   "pac man (starts moving down)"  },
472   { "emerald",                  "red emerald"                   },
473   { "emerald",                  "purple emerald"                },
474   { "wall",                     "wall with red emerald"         },
475   { "wall",                     "wall with purple emerald"      },
476   { NULL,                       "unknown"                       },    /* 100 */
477   { NULL,                       "unknown"                       },
478   { NULL,                       "unknown"                       },
479   { NULL,                       "unknown"                       },
480   { NULL,                       "unknown"                       },
481   { NULL,                       "normal wall (BD style)"        },
482   { "bd_rock",                  "rock (BD style)"               },
483   { "exit",                     "open exit"                     },
484   { NULL,                       "black orb bomb"                },
485   { "amoeba",                   "amoeba"                        },
486   { "mole",                     "mole"                          },    /* 110 */
487   { "penguin",                  "penguin"                       },
488   { "satellite",                "satellite"                     },
489   { NULL,                       "arrow left"                    },
490   { NULL,                       "arrow right"                   },
491   { NULL,                       "arrow up"                      },
492   { NULL,                       "arrow down"                    },
493   { "pig",                      "pig"                           },
494   { "dragon",                   "fire breathing dragon"         },
495   { "key",                      "red key (EM style)"            },
496   { NULL,                       "letter ' '"                    },    /* 120 */
497   { NULL,                       "letter '!'"                    },
498   { NULL,                       "letter '\"'"                   },
499   { NULL,                       "letter '#'"                    },
500   { NULL,                       "letter '$'"                    },
501   { NULL,                       "letter '%'"                    },
502   { NULL,                       "letter '&'"                    },
503   { NULL,                       "letter '''"                    },
504   { NULL,                       "letter '('"                    },
505   { NULL,                       "letter ')'"                    },
506   { NULL,                       "letter '*'"                    },    /* 130 */
507   { NULL,                       "letter '+'"                    },
508   { NULL,                       "letter ','"                    },
509   { NULL,                       "letter '-'"                    },
510   { NULL,                       "letter '.'"                    },
511   { NULL,                       "letter '/'"                    },
512   { NULL,                       "letter '0'"                    },
513   { NULL,                       "letter '1'"                    },
514   { NULL,                       "letter '2'"                    },
515   { NULL,                       "letter '3'"                    },
516   { NULL,                       "letter '4'"                    },    /* 140 */
517   { NULL,                       "letter '5'"                    },
518   { NULL,                       "letter '6'"                    },
519   { NULL,                       "letter '7'"                    },
520   { NULL,                       "letter '8'"                    },
521   { NULL,                       "letter '9'"                    },
522   { NULL,                       "letter ':'"                    },
523   { NULL,                       "letter ';'"                    },
524   { NULL,                       "letter '<'"                    },
525   { NULL,                       "letter '='"                    },
526   { NULL,                       "letter '>'"                    },    /* 150 */
527   { NULL,                       "letter '?'"                    },
528   { NULL,                       "letter '@'"                    },
529   { NULL,                       "letter 'A'"                    },
530   { NULL,                       "letter 'B'"                    },
531   { NULL,                       "letter 'C'"                    },
532   { NULL,                       "letter 'D'"                    },
533   { NULL,                       "letter 'E'"                    },
534   { NULL,                       "letter 'F'"                    },
535   { NULL,                       "letter 'G'"                    },
536   { NULL,                       "letter 'H'"                    },    /* 160 */
537   { NULL,                       "letter 'I'"                    },
538   { NULL,                       "letter 'J'"                    },
539   { NULL,                       "letter 'K'"                    },
540   { NULL,                       "letter 'L'"                    },
541   { NULL,                       "letter 'M'"                    },
542   { NULL,                       "letter 'N'"                    },
543   { NULL,                       "letter 'O'"                    },
544   { NULL,                       "letter 'P'"                    },
545   { NULL,                       "letter 'Q'"                    },
546   { NULL,                       "letter 'R'"                    },    /* 170 */
547   { NULL,                       "letter 'S'"                    },
548   { NULL,                       "letter 'T'"                    },
549   { NULL,                       "letter 'U'"                    },
550   { NULL,                       "letter 'V'"                    },
551   { NULL,                       "letter 'W'"                    },
552   { NULL,                       "letter 'X'"                    },
553   { NULL,                       "letter 'Y'"                    },
554   { NULL,                       "letter 'Z'"                    },
555   { NULL,                       "letter 'Ä'"                    },
556   { NULL,                       "letter 'Ö'"                    },    /* 180 */
557   { NULL,                       "letter 'Ãœ'"                    },
558   { NULL,                       "letter '^'"                    },
559   { NULL,                       "letter ''"                     },
560   { NULL,                       "letter ''"                     },
561   { NULL,                       "letter ''"                     },
562   { NULL,                       "letter ''"                     },
563   { NULL,                       "letter ''"                     },
564   { NULL,                       "letter ''"                     },
565   { NULL,                       "letter ''"                     },
566   { NULL,                       "letter ''"                     },    /* 190 */
567   { NULL,                       "letter ''"                     },
568   { NULL,                       "letter ''"                     },
569   { NULL,                       "letter ''"                     },
570   { NULL,                       "letter ''"                     },
571   { NULL,                       "letter ''"                     },
572   { NULL,                       "letter ''"                     },
573   { NULL,                       "letter ''"                     },
574   { NULL,                       "letter ''"                     },
575   { NULL,                       "letter ''"                     },
576   { "wall",                     "growing wall (horizontal)"     },    /* 200 */
577   { "wall",                     "growing wall (vertical)"       },
578   { "wall",                     "growing wall (all directions)" },
579   { "gate",                     "red door (EM style)"           },
580   { "gate",                     "yellow door (EM style)"        },
581   { "gate",                     "green door (EM style)"         },
582   { "gate",                     "blue door (EM style)"          },
583   { "key",                      "yellow key (EM style)"         },
584   { "key",                      "green key (EM style)"          },
585   { "key",                      "blue key (EM style)"           },
586   { "empty_space",              "empty space"                   },    /* 210 */
587   { "sp_zonk",                  "zonk"                          },
588   { "sp_base",                  "base"                          },
589   { "player",                   "murphy"                        },
590   { "sp_infotron",              "infotron"                      },
591   { "wall",                     "chip (single)"                 },
592   { "wall",                     "hardware"                      },
593   { "sp_exit",                  "exit"                          },
594   { "sp_disk_orange",           "orange disk"                   },
595   { "sp_port",                  "port (leading right)"          },
596   { "sp_port",                  "port (leading down)"           },    /* 220 */
597   { "sp_port",                  "port (leading left)"           },
598   { "sp_port",                  "port (leading up)"             },
599   { "sp_port",                  "port (leading right)"          },
600   { "sp_port",                  "port (leading down)"           },
601   { "sp_port",                  "port (leading left)"           },
602   { "sp_port",                  "port (leading up)"             },
603   { "sp_sniksnak",              "snik snak"                     },
604   { "sp_disk_yellow",           "yellow disk"                   },
605   { "sp_terminal",              "terminal"                      },
606   { "sp_disk_red",              "red disk"                      },    /* 230 */
607   { "sp_port",                  "port (vertical)"               },
608   { "sp_port",                  "port (horizontal)"             },
609   { "sp_port",                  "port (all directions)"         },
610   { "sp_electron",              "electron"                      },
611   { "sp_buggy_base",            "buggy base"                    },
612   { "wall",                     "chip (left half)"              },
613   { "wall",                     "chip (right half)"             },
614   { "wall",                     "hardware"                      },
615   { "wall",                     "hardware"                      },
616   { "wall",                     "hardware"                      },    /* 240 */
617   { "wall",                     "hardware"                      },
618   { "wall",                     "hardware"                      },
619   { "wall",                     "hardware"                      },
620   { "wall",                     "hardware"                      },
621   { "wall",                     "hardware"                      },
622   { "wall",                     "hardware"                      },
623   { "wall",                     "hardware"                      },
624   { "wall",                     "chip (upper half)"             },
625   { "wall",                     "chip (lower half)"             },
626   { "gate",                     "gray door (EM style, red key)" },    /* 250 */
627   { "gate",                     "gray door (EM style, yellow key)"},
628   { "gate",                     "gray door (EM style, green key)"},
629   { "gate",                     "gray door (EM style, blue key)"},
630   { NULL,                       "unknown"                       },
631   { NULL,                       "unknown"                       },
632
633   /* 256 */
634
635   { "pearl",                    "pearl"                         },  /* (256) */
636   { "crystal",                  "crystal"                       },
637   { "wall",                     "wall with pearl"               },
638   { "wall",                     "wall with crystal"             },
639   { "gate",                     "white door"                    },    /* 260 */
640   { "gate",                     "gray door (opened by white key)"},
641   { "key",                      "white key"                     },
642   { "shield_passive",           "shield (passive)"              },
643   { "extra_time",               "extra time"                    },
644   { "switchgate",               "switch gate (open)"            },
645   { "switchgate",               "switch gate (closed)"          },
646   { "switchgate_switch",        "switch for switch gate"        },
647   { "switchgate_switch",        "switch for switch gate"        },
648   { NULL,                       "-"                             },
649   { NULL,                       "-"                             },    /* 270 */
650   { "conveyor_belt",            "red conveyor belt (left)"      },
651   { "conveyor_belt",            "red conveyor belt (middle)"    },
652   { "conveyor_belt",            "red conveyor belt (right)"     },
653   { "conveyor_belt_switch",     "switch for red conveyor belt (left)"},
654   { "conveyor_belt_switch",     "switch for red conveyor belt (middle)"},
655   { "conveyor_belt_switch",     "switch for red conveyor belt (right)"},
656   { "conveyor_belt",            "yellow conveyor belt (left)"   },
657   { "conveyor_belt",            "yellow conveyor belt (middle)" },
658   { "conveyor_belt",            "yellow conveyor belt (right)"  },
659   { "conveyor_belt_switch",     "switch for yellow conveyor belt (left)"},
660   { "conveyor_belt_switch",     "switch for yellow conveyor belt (middle)"},
661   { "conveyor_belt_switch",     "switch for yellow conveyor belt (right)"},
662   { "conveyor_belt",            "green conveyor belt (left)"    },
663   { "conveyor_belt",            "green conveyor belt (middle)"  },
664   { "conveyor_belt",            "green conveyor belt (right)"   },
665   { "conveyor_belt_switch",     "switch for green conveyor belt (left)"},
666   { "conveyor_belt_switch",     "switch for green conveyor belt (middle)"},
667   { "conveyor_belt_switch",     "switch for green conveyor belt (right)"},
668   { "conveyor_belt",            "blue conveyor belt (left)"     },
669   { "conveyor_belt",            "blue conveyor belt (middle)"   },
670   { "conveyor_belt",            "blue conveyor belt (right)"    },
671   { "conveyor_belt_switch",     "switch for blue conveyor belt (left)"},
672   { "conveyor_belt_switch",     "switch for blue conveyor belt (middle)"},
673   { "conveyor_belt_switch",     "switch for blue conveyor belt (right)"},
674   { "sand",                     "land mine"                     },
675   { "envelope",                 "mail envelope"                 },
676   { "light_switch",             "light switch (off)"            },
677   { "light_switch",             "light switch (on)"             },
678   { "wall",                     "sign (exclamation)"            },
679   { "wall",                     "sign (radio activity)"         },    /* 300 */
680   { "wall",                     "sign (stop)"                   },
681   { "wall",                     "sign (wheel chair)"            },
682   { "wall",                     "sign (parking)"                },
683   { "wall",                     "sign (one way)"                },
684   { "wall",                     "sign (heart)"                  },
685   { "wall",                     "sign (triangle)"               },
686   { "wall",                     "sign (round)"                  },
687   { "wall",                     "sign (exit)"                   },
688   { "wall",                     "sign (yin yang)"               },
689   { "wall",                     "sign (other)"                  },    /* 310 */
690   { "mole",                     "mole (starts moving left)"     },
691   { "mole",                     "mole (starts moving right)"    },
692   { "mole",                     "mole (starts moving up)"       },
693   { "mole",                     "mole (starts moving down)"     },
694   { "wall",                     "steel wall (slanted)"          },
695   { "sand",                     "invisible sand"                },
696   { NULL,                       "dx unknown 15"                 },
697   { NULL,                       "dx unknown 42"                 },
698   { NULL,                       "-"                             },
699   { NULL,                       "-"                             },    /* 320 */
700   { "shield_active",            "shield (active, kills enemies)"},
701   { "timegate",                 "time gate (open)"              },
702   { "timegate",                 "time gate (closed)"            },
703   { "timegate_wheel",           "switch for time gate"          },
704   { "timegate_wheel",           "switch for time gate"          },
705   { "balloon",                  "balloon"                       },
706   { "wall",                     "send balloon to the left"      },
707   { "wall",                     "send balloon to the right"     },
708   { "balloon_switch",           "send balloon up"               },
709   { "balloon_switch",           "send balloon down"             },    /* 330 */
710   { "balloon_switch",           "send balloon in any direction" },
711   { "wall",                     "steel wall"                    },
712   { "wall",                     "steel wall"                    },
713   { "wall",                     "steel wall"                    },
714   { "wall",                     "steel wall"                    },
715   { "wall",                     "normal wall"                   },
716   { "wall",                     "normal wall"                   },
717   { "wall",                     "normal wall"                   },
718   { "wall",                     "normal wall"                   },
719   { "wall",                     "normal wall"                   },    /* 340 */
720   { "wall",                     "normal wall"                   },
721   { "wall",                     "normal wall"                   },
722   { "wall",                     "normal wall"                   },
723   { "tube",                     "tube (all directions)"         },
724   { "tube",                     "tube (vertical)"               },
725   { "tube",                     "tube (horizontal)"             },
726   { "tube",                     "tube (vertical & left)"        },
727   { "tube",                     "tube (vertical & right)"       },
728   { "tube",                     "tube (horizontal & up)"        },
729   { "tube",                     "tube (horizontal & down)"      },    /* 350 */
730   { "tube",                     "tube (left & up)"              },
731   { "tube",                     "tube (left & down)"            },
732   { "tube",                     "tube (right & up)"             },
733   { "tube",                     "tube (right & down)"           },
734   { "spring",                   "spring"                        },
735   { "trap",                     "trap"                          },
736   { "dx_bomb",                  "stable bomb (DX style)"        },
737   { NULL,                       "-"                             }
738
739   /*
740   "-------------------------------",
741   */
742 };
743
744 struct GraphicInfo graphic_info[MAX_GRAPHICS];
745
746
747 /* ========================================================================= */
748 /* main()                                                                    */
749 /* ========================================================================= */
750
751 int main(int argc, char *argv[])
752 {
753   InitCommandName(argv[0]);
754   InitExitFunction(CloseAllAndExit);
755   InitPlatformDependantStuff();
756
757   GetOptions(argv);
758   OpenAll();
759
760   EventLoop();
761   CloseAllAndExit(0);
762
763   return 0;     /* to keep compilers happy */
764 }