rnd-20030703-1-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 #include "config.h"
21
22 #if 0
23 GC                      tile_clip_gc;
24 Bitmap                 *pix[NUM_BITMAPS];
25 #endif
26 Bitmap                 *bitmap_db_field, *bitmap_db_door;
27 #if 0
28 Pixmap                  tile_clipmask[NUM_TILES];
29 #endif
30 DrawBuffer             *fieldbuffer;
31 DrawBuffer             *drawto_field;
32
33 int                     game_status = -1;
34 boolean                 level_editor_test_game = FALSE;
35 boolean                 network_playing = FALSE;
36
37 int                     key_joystick_mapping = 0;
38
39 boolean                 redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
40 int                     redraw_x1 = 0, redraw_y1 = 0;
41
42 short                   Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
43 short                   Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
44 short                   MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
45 short                   MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
46 short                   MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
47 short                   ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
48 short                   Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
49 short                   Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
50 short                   StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
51 short                   Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
52 boolean                 Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
53 boolean                 Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
54 short                   JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
55 short                   AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
56 short                   AmoebaCnt[MAX_NUM_AMOEBA];
57 short                   AmoebaCnt2[MAX_NUM_AMOEBA];
58 short                   ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
59 short                   ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
60
61 unsigned long           Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS];
62
63 int                     GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
64 int                     GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
65 int                     GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
66 int                     GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
67
68 int                     lev_fieldx, lev_fieldy;
69 int                     scroll_x, scroll_y;
70
71 int                     FX = SX, FY = SY;
72 int                     ScrollStepSize;
73 int                     ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
74 int                     ScreenGfxPos = 0;
75 int                     BorderElement = EL_STEELWALL;
76 int                     GameFrameDelay = GAME_FRAME_DELAY;
77 int                     FfwdFrameDelay = FFWD_FRAME_DELAY;
78 int                     BX1 = 0, BY1 = 0;
79 int                     BX2 = SCR_FIELDX - 1, BY2 = SCR_FIELDY - 1;
80 int                     SBX_Left, SBX_Right;
81 int                     SBY_Upper, SBY_Lower;
82 int                     ZX, ZY;
83 int                     ExitX, ExitY;
84 int                     AllPlayersGone;
85
86 int                     TimeFrames, TimePlayed, TimeLeft;
87
88 boolean                 network_player_action_received = FALSE;
89
90 struct LevelInfo        level;
91 struct PlayerInfo       stored_player[MAX_PLAYERS], *local_player = NULL;
92 struct HiScore          highscore[MAX_SCORE_ENTRIES];
93 struct TapeInfo         tape;
94 struct SetupInfo        setup;
95 struct GameInfo         game;
96 struct GlobalInfo       global;
97 struct MenuInfo         menu;
98 struct DoorInfo         door;
99 struct GraphicInfo     *graphic_info = NULL;
100 struct SoundInfo       *sound_info = NULL;
101
102
103 /* ------------------------------------------------------------------------- */
104 /* element definitions                                                       */
105 /* ------------------------------------------------------------------------- */
106
107 struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
108 {
109   /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */
110
111   /* ----------------------------------------------------------------------- */
112   /* "real" level file elements                                              */
113   /* ----------------------------------------------------------------------- */
114
115   {
116     "empty_space",
117     "empty_space",
118     "empty space"
119   },
120   {
121     "sand",
122     "sand",
123     "sand"
124   },
125   {
126     "wall",
127     "wall",
128     "normal wall"
129   },
130   {
131     "wall_crumbled",
132     "wall",
133     "round wall"
134   },
135   {
136     "rock",
137     "rock",
138     "rock"
139   },
140   {
141     "key_obsolete",
142     "key",
143     "key"
144   },
145   {
146     "emerald",
147     "emerald",
148     "emerald"
149   },
150   {
151     "exit_closed",
152     "exit",
153     "closed exit"
154   },
155   {
156     "player_obsolete",
157     "player",
158     "player"
159   },
160   {
161     "bug",
162     "bug",
163     "bug"
164   },
165   {
166     "spaceship",
167     "spaceship",
168     "spaceship"
169   },
170   {
171     "yamyam",
172     "yamyam",
173     "yam yam"
174   },
175   {
176     "robot",
177     "robot",
178     "robot"
179   },
180   {
181     "steelwall",
182     "wall",
183     "steel wall"
184   },
185   {
186     "diamond",
187     "diamond",
188     "diamond"
189   },
190   {
191     "amoeba_dead",
192     "amoeba",
193     "dead amoeba"
194   },
195   {
196     "quicksand_empty",
197     "quicksand",
198     "empty quicksand"
199   },
200   {
201     "quicksand_full",
202     "quicksand",
203     "quicksand with rock"
204   },
205   {
206     "amoeba_drop",
207     "amoeba",
208     "amoeba drop"
209   },
210   {
211     "bomb",
212     "bomb",
213     "bomb"
214   },
215   {
216     "magic_wall",
217     "magic_wall",
218     "magic wall"
219   },
220   {
221     "speed_pill",
222     "speed_pill",
223     "speed pill"
224   },
225   {
226     "acid",
227     "acid",
228     "acid"
229   },
230   {
231     "amoeba_wet",
232     "amoeba",
233     "dropping amoeba"
234   },
235   {
236     "amoeba_dry",
237     "amoeba",
238     "normal amoeba"
239   },
240   {
241     "nut",
242     "nut",
243     "nut with emerald"
244   },
245   {
246     "game_of_life",
247     "game_of_life",
248     "Conway's wall of life"
249   },
250   {
251     "biomaze",
252     "biomaze",
253     "biomaze"
254   },
255   {
256     "dynamite_active",
257     "dynamite",
258     "burning dynamite"
259   },
260   {
261     "stoneblock",
262     "wall",
263     "wall"
264   },
265   {
266     "robot_wheel",
267     "robot_wheel",
268     "magic wheel"
269   },
270   {
271     "robot_wheel_active",
272     "robot_wheel",
273     "magic wheel (running)"
274   },
275   {
276     "key_1",
277     "key",
278     "red key"
279   },
280   {
281     "key_2",
282     "key",
283     "yellow key"
284   },
285   {
286     "key_3",
287     "key",
288     "green key"
289   },
290   {
291     "key_4",
292     "key",
293     "blue key"
294   },
295   {
296     "gate_1",
297     "gate",
298     "red door"
299   },
300   {
301     "gate_2",
302     "gate",
303     "yellow door"
304   },
305   {
306     "gate_3",
307     "gate",
308     "green door"
309   },
310   {
311     "gate_4",
312     "gate",
313     "blue door"
314   },
315   {
316     "gate_1_gray",
317     "gate",
318     "gray door (opened by red key)"
319   },
320   {
321     "gate_2_gray",
322     "gate",
323     "gray door (opened by yellow key)"},
324   {
325     "gate_3_gray",
326     "gate",
327     "gray door (opened by green key)"},
328   {
329     "gate_4_gray",
330     "gate",
331     "gray door (opened by blue key)"},
332   {
333     "dynamite",
334     "dynamite",
335     "dynamite"
336   },
337   {
338     "pacman",
339     "pacman",
340     "pac man"
341   },
342   {
343     "invisible_wall",
344     "wall",
345     "invisible normal wall"
346   },
347   {
348     "lamp",
349     "lamp",
350     "lamp (off)"
351   },
352   {
353     "lamp_active",
354     "lamp",
355     "lamp (on)"
356   },
357   {
358     "wall_emerald",
359     "wall",
360     "wall with emerald"
361   },
362   {
363     "wall_diamond",
364     "wall",
365     "wall with diamond"
366   },
367   {
368     "amoeba_full",
369     "amoeba",
370     "amoeba with content"
371   },
372   {
373     "bd_amoeba",
374     "bd_amoeba",
375     "amoeba (BD style)"
376   },
377   {
378     "time_orb_full",
379     "time_orb_full",
380     "time orb (full)"
381   },
382   {
383     "time_orb_empty",
384     "time_orb_empty",
385     "time orb (empty)"
386   },
387   {
388     "expandable_wall",
389     "wall",
390     "growing wall"
391   },
392   {
393     "bd_diamond",
394     "bd_diamond",
395     "diamond (BD style)"
396   },
397   {
398     "emerald_yellow",
399     "emerald",
400     "yellow emerald"
401   },
402   {
403     "wall_bd_diamond",
404     "wall",
405     "wall with BD style diamond"
406   },
407   {
408     "wall_emerald_yellow",
409     "wall",
410     "wall with yellow emerald"
411   },
412   {
413     "dark_yamyam",
414     "dark_yamyam",
415     "dark yam yam"
416   },
417   {
418     "bd_magic_wall",
419     "bd_magic_wall",
420     "magic wall (BD style)"
421   },
422   {
423     "invisible_steelwall",
424     "wall",
425     "invisible steel wall"
426   },
427   {
428     "unused_63",
429     "unused",
430     "(not used)"
431   },
432   {
433     "dynabomb_increase_number",
434     "dynabomb",
435     "increases number of bombs"
436   },
437   {
438     "dynabomb_increase_size",
439     "dynabomb",
440     "increases explosion size"
441   },
442   {
443     "dynabomb_increase_power",
444     "dynabomb",
445     "increases power of explosion"
446   },
447   {
448     "sokoban_object",
449     "sokoban",
450     "sokoban object"
451   },
452   {
453     "sokoban_field_empty",
454     "sokoban",
455     "sokoban empty field"
456   },
457   {
458     "sokoban_field_full",
459     "sokoban",
460     "sokoban field with object"
461   },
462   {
463     "bd_butterfly_right",
464     "bd_butterfly",
465     "butterfly (starts moving right)"},
466   {
467     "bd_butterfly_up",
468     "bd_butterfly",
469     "butterfly (starts moving up)"
470   },
471   {
472     "bd_butterfly_left",
473     "bd_butterfly",
474     "butterfly (starts moving left)"},
475   {
476     "bd_butterfly_down",
477     "bd_butterfly",
478     "butterfly (starts moving down)"},
479   {
480     "bd_firefly_right",
481     "bd_firefly",
482     "firefly (starts moving right)"
483   },
484   {
485     "bd_firefly_up",
486     "bd_firefly",
487     "firefly (starts moving up)"
488   },
489   {
490     "bd_firefly_left",
491     "bd_firefly",
492     "firefly (starts moving left)"
493   },
494   {
495     "bd_firefly_down",
496     "bd_firefly",
497     "firefly (starts moving down)"
498   },
499   {
500     "bd_butterfly",
501     "bd_butterfly",
502     "butterfly"
503   },
504   {
505     "bd_firefly",
506     "bd_firefly",
507     "firefly"
508   },
509   {
510     "player_1",
511     "player",
512     "yellow player"
513   },
514   {
515     "player_2",
516     "player",
517     "red player"
518   },
519   {
520     "player_3",
521     "player",
522     "green player"
523   },
524   {
525     "player_4",
526     "player",
527     "blue player"
528   },
529   {
530     "bug_right",
531     "bug",
532     "bug (starts moving right)"
533   },
534   {
535     "bug_up",
536     "bug",
537     "bug (starts moving up)"
538   },
539   {
540     "bug_left",
541     "bug",
542     "bug (starts moving left)"
543   },
544   {
545     "bug_down",
546     "bug",
547     "bug (starts moving down)"
548   },
549   {
550     "spaceship_right",
551     "spaceship",
552     "spaceship (starts moving right)"},
553   {
554     "spaceship_up",
555     "spaceship",
556     "spaceship (starts moving up)"
557   },
558   {
559     "spaceship_left",
560     "spaceship",
561     "spaceship (starts moving left)"},
562   {
563     "spaceship_down",
564     "spaceship",
565     "spaceship (starts moving down)"},
566   {
567     "pacman_right",
568     "pacman",
569     "pac man (starts moving right)"
570   },
571   {
572     "pacman_up",
573     "pacman",
574     "pac man (starts moving up)"
575   },
576   {
577     "pacman_left",
578     "pacman",
579     "pac man (starts moving left)"
580   },
581   {
582     "pacman_down",
583     "pacman",
584     "pac man (starts moving down)"
585   },
586   {
587     "emerald_red",
588     "emerald",
589     "red emerald"
590   },
591   {
592     "emerald_purple",
593     "emerald",
594     "purple emerald"
595   },
596   {
597     "wall_emerald_red",
598     "wall",
599     "wall with red emerald"
600   },
601   {
602     "wall_emerald_purple",
603     "wall",
604     "wall with purple emerald"
605   },
606   {
607     "acid_pool_topleft",
608     "wall",
609     "acid pool (top left)"
610   },
611   {
612     "acid_pool_topright",
613     "wall",
614     "acid pool (top right)"
615   },
616   {
617     "acid_pool_bottomleft",
618     "wall",
619     "acid pool (bottom left)"
620   },
621   {
622     "acid_pool_bottom",
623     "wall",
624     "acid pool (bottom)"
625   },
626   {
627     "acid_pool_bottomright",
628     "wall",
629     "acid pool (bottom right)"
630   },
631   {
632     "bd_wall",
633     "wall",
634     "normal wall (BD style)"
635   },
636   {
637     "bd_rock",
638     "bd_rock",
639     "rock (BD style)"
640   },
641   {
642     "exit_open",
643     "exit",
644     "open exit"
645   },
646   {
647     "black_orb",
648     "black_orb",
649     "bomb"
650   },
651   {
652     "amoeba_to_diamond",
653     "amoeba",
654     "amoeba"
655   },
656   {
657     "mole",
658     "mole",
659     "mole"
660   },
661   {
662     "penguin",
663     "penguin",
664     "penguin"
665   },
666   {
667     "satellite",
668     "satellite",
669     "satellite"
670   },
671   {
672     "arrow_left",
673     "arrow",
674     "arrow left"
675   },
676   {
677     "arrow_right",
678     "arrow",
679     "arrow right"
680   },
681   {
682     "arrow_up",
683     "arrow",
684     "arrow up"
685   },
686   {
687     "arrow_down",
688     "arrow",
689     "arrow down"
690   },
691   {
692     "pig",
693     "pig",
694     "pig"
695   },
696   {
697     "dragon",
698     "dragon",
699     "fire breathing dragon"
700   },
701   {
702     "em_key_1_file",
703     "key",
704     "red key (EM style)"
705   },
706   {
707     "char_space",
708     "char",
709     "letter ' '"
710   },
711   {
712     "char_exclam",
713     "char",
714     "letter '!'"
715   },
716   {
717     "char_quotedbl",
718     "char",
719     "letter '\"'"
720   },
721   {
722     "char_numbersign",
723     "char",
724     "letter '#'"
725   },
726   {
727     "char_dollar",
728     "char",
729     "letter '$'"
730   },
731   {
732     "char_procent",
733     "char",
734     "letter '%'"
735   },
736   {
737     "char_ampersand",
738     "char",
739     "letter '&'"
740   },
741   {
742     "char_apostrophe",
743     "char",
744     "letter '''"
745   },
746   {
747     "char_parenleft",
748     "char",
749     "letter '('"
750   },
751   {
752     "char_parenright",
753     "char",
754     "letter ')'"
755   },
756   {
757     "char_asterisk",
758     "char",
759     "letter '*'"
760   },
761   {
762     "char_plus",
763     "char",
764     "letter '+'"
765   },
766   {
767     "char_comma",
768     "char",
769     "letter ','"
770   },
771   {
772     "char_minus",
773     "char",
774     "letter '-'"
775   },
776   {
777     "char_period",
778     "char",
779     "letter '.'"
780   },
781   {
782     "char_slash",
783     "char",
784     "letter '/'"
785   },
786   {
787     "char_0",
788     "char",
789     "letter '0'"
790   },
791   {
792     "char_1",
793     "char",
794     "letter '1'"
795   },
796   {
797     "char_2",
798     "char",
799     "letter '2'"
800   },
801   {
802     "char_3",
803     "char",
804     "letter '3'"
805   },
806   {
807     "char_4",
808     "char",
809     "letter '4'"
810   },
811   {
812     "char_5",
813     "char",
814     "letter '5'"
815   },
816   {
817     "char_6",
818     "char",
819     "letter '6'"
820   },
821   {
822     "char_7",
823     "char",
824     "letter '7'"
825   },
826   {
827     "char_8",
828     "char",
829     "letter '8'"
830   },
831   {
832     "char_9",
833     "char",
834     "letter '9'"
835   },
836   {
837     "char_colon",
838     "char",
839     "letter ':'"
840   },
841   {
842     "char_semicolon",
843     "char",
844     "letter ';'"
845   },
846   {
847     "char_less",
848     "char",
849     "letter '<'"
850   },
851   {
852     "char_equal",
853     "char",
854     "letter '='"
855   },
856   {
857     "char_greater",
858     "char",
859     "letter '>'"
860   },
861   {
862     "char_question",
863     "char",
864     "letter '?'"
865   },
866   {
867     "char_at",
868     "char",
869     "letter '@'"
870   },
871   {
872     "char_a",
873     "char",
874     "letter 'A'"
875   },
876   {
877     "char_b",
878     "char",
879     "letter 'B'"
880   },
881   {
882     "char_c",
883     "char",
884     "letter 'C'"
885   },
886   {
887     "char_d",
888     "char",
889     "letter 'D'"
890   },
891   {
892     "char_e",
893     "char",
894     "letter 'E'"
895   },
896   {
897     "char_f",
898     "char",
899     "letter 'F'"
900   },
901   {
902     "char_g",
903     "char",
904     "letter 'G'"
905   },
906   {
907     "char_h",
908     "char",
909     "letter 'H'"
910   },
911   {
912     "char_i",
913     "char",
914     "letter 'I'"
915   },
916   {
917     "char_j",
918     "char",
919     "letter 'J'"
920   },
921   {
922     "char_k",
923     "char",
924     "letter 'K'"
925   },
926   {
927     "char_l",
928     "char",
929     "letter 'L'"
930   },
931   {
932     "char_m",
933     "char",
934     "letter 'M'"
935   },
936   {
937     "char_n",
938     "char",
939     "letter 'N'"
940   },
941   {
942     "char_o",
943     "char",
944     "letter 'O'"
945   },
946   {
947     "char_p",
948     "char",
949     "letter 'P'"
950   },
951   {
952     "char_q",
953     "char",
954     "letter 'Q'"
955   },
956   {
957     "char_r",
958     "char",
959     "letter 'R'"
960   },
961   {
962     "char_s",
963     "char",
964     "letter 'S'"
965   },
966   {
967     "char_t",
968     "char",
969     "letter 'T'"
970   },
971   {
972     "char_u",
973     "char",
974     "letter 'U'"
975   },
976   {
977     "char_v",
978     "char",
979     "letter 'V'"
980   },
981   {
982     "char_w",
983     "char",
984     "letter 'W'"
985   },
986   {
987     "char_x",
988     "char",
989     "letter 'X'"
990   },
991   {
992     "char_y",
993     "char",
994     "letter 'Y'"
995   },
996   {
997     "char_z",
998     "char",
999     "letter 'Z'"
1000   },
1001   {
1002     "char_bracketleft",
1003     "char",
1004     "letter '['"
1005   },
1006   {
1007     "char_backslash",
1008     "char",
1009     "letter '\\'"
1010   },
1011   {
1012     "char_bracketright",
1013     "char",
1014     "letter ']'"
1015   },
1016   {
1017     "char_asciicircum",
1018     "char",
1019     "letter '^'"
1020   },
1021   {
1022     "char_underscore",
1023     "char",
1024     "letter '_'"
1025   },
1026   {
1027     "char_copyright",
1028     "char",
1029     "letter '©'"
1030   },
1031   {
1032     "char_aumlaut",
1033     "char",
1034     "letter 'Ä'"
1035   },
1036   {
1037     "char_oumlaut",
1038     "char",
1039     "letter 'Ö'"
1040   },
1041   {
1042     "char_uumlaut",
1043     "char",
1044     "letter 'Ãœ'"
1045   },
1046   {
1047     "char_degree",
1048     "char",
1049     "letter '°'"
1050   },
1051   {
1052     "char_trademark",
1053     "char",
1054     "letter '®'"
1055   },
1056   {
1057     "char_cursor",
1058     "char",
1059     "letter ' '"
1060   },
1061   {
1062     "char_unused",
1063     "char",
1064     "letter ''"
1065   },
1066   {
1067     "char_unused",
1068     "char",
1069     "letter ''"
1070   },
1071   {
1072     "char_unused",
1073     "char",
1074     "letter ''"
1075   },
1076   {
1077     "char_unused",
1078     "char",
1079     "letter ''"
1080   },
1081   {
1082     "char_unused",
1083     "char",
1084     "letter ''"
1085   },
1086   {
1087     "char_unused",
1088     "char",
1089     "letter ''"
1090   },
1091   {
1092     "char_unused",
1093     "char",
1094     "letter ''"
1095   },
1096   {
1097     "char_unused",
1098     "char",
1099     "letter ''"
1100   },
1101   {
1102     "char_unused",
1103     "char",
1104     "letter ''"
1105   },
1106   {
1107     "expandable_wall_horizontal",
1108     "wall",
1109     "growing wall (horizontal)"
1110   },
1111   {
1112     "expandable_wall_vertical",
1113     "wall",
1114     "growing wall (vertical)"
1115   },
1116   {
1117     "expandable_wall_any",
1118     "wall",
1119     "growing wall (any direction)"
1120   },
1121   {
1122     "em_gate_1",
1123     "gate",
1124     "red door (EM style)"
1125   },
1126   {
1127     "em_gate_2",
1128     "gate",
1129     "yellow door (EM style)"
1130   },
1131   {
1132     "em_gate_3",
1133     "gate",
1134     "green door (EM style)"
1135   },
1136   {
1137     "em_gate_4",
1138     "gate",
1139     "blue door (EM style)"
1140   },
1141   {
1142     "em_key_2_file",
1143     "key",
1144     "yellow key (EM style)"
1145   },
1146   {
1147     "em_key_3_file",
1148     "key",
1149     "green key (EM style)"
1150   },
1151   {
1152     "em_key_4_file",
1153     "key",
1154     "blue key (EM style)"
1155   },
1156   {
1157     "sp_empty_space",
1158     "empty_space",
1159     "empty space"
1160   },
1161   {
1162     "sp_zonk",
1163     "sp_zonk",
1164     "zonk"
1165   },
1166   {
1167     "sp_base",
1168     "sp_base",
1169     "base"
1170   },
1171   {
1172     "sp_murphy",
1173     "player",
1174     "murphy"
1175   },
1176   {
1177     "sp_infotron",
1178     "sp_infotron",
1179     "infotron"
1180   },
1181   {
1182     "sp_chip_single",
1183     "wall",
1184     "chip (single)"
1185   },
1186   {
1187     "sp_hardware_gray",
1188     "wall",
1189     "hardware"
1190   },
1191   {
1192     "sp_exit_closed",
1193     "sp_exit",
1194     "exit"
1195   },
1196   {
1197     "sp_disk_orange",
1198     "sp_disk_orange",
1199     "orange disk"
1200   },
1201   {
1202     "sp_port_right",
1203     "sp_port",
1204     "port (leading right)"
1205   },
1206   {
1207     "sp_port_down",
1208     "sp_port",
1209     "port (leading down)"
1210   },
1211   {
1212     "sp_port_left",
1213     "sp_port",
1214     "port (leading left)"
1215   },
1216   {
1217     "sp_port_up",
1218     "sp_port",
1219     "port (leading up)"
1220   },
1221   {
1222     "sp_gravity_port_right",
1223     "sp_port",
1224     "port (leading right)"
1225   },
1226   {
1227     "sp_gravity_port_down",
1228     "sp_port",
1229     "port (leading down)"
1230   },
1231   {
1232     "sp_gravity_port_left",
1233     "sp_port",
1234     "port (leading left)"
1235   },
1236   {
1237     "sp_gravity_port_up",
1238     "sp_port",
1239     "port (leading up)"
1240   },
1241   {
1242     "sp_sniksnak",
1243     "sp_sniksnak",
1244     "snik snak"
1245   },
1246   {
1247     "sp_disk_yellow",
1248     "sp_disk_yellow",
1249     "yellow disk"
1250   },
1251   {
1252     "sp_terminal",
1253     "sp_terminal",
1254     "terminal"
1255   },
1256   {
1257     "sp_disk_red",
1258     "dynamite",
1259     "red disk"
1260   },
1261   {
1262     "sp_port_vertical",
1263     "sp_port",
1264     "port (vertical)"
1265   },
1266   {
1267     "sp_port_horizontal",
1268     "sp_port",
1269     "port (horizontal)"
1270   },
1271   {
1272     "sp_port_any",
1273     "sp_port",
1274     "port (any direction)"
1275   },
1276   {
1277     "sp_electron",
1278     "sp_electron",
1279     "electron"
1280   },
1281   {
1282     "sp_buggy_base",
1283     "sp_buggy_base",
1284     "buggy base"
1285   },
1286   {
1287     "sp_chip_left",
1288     "wall",
1289     "chip (left half)"
1290   },
1291   {
1292     "sp_chip_right",
1293     "wall",
1294     "chip (right half)"
1295   },
1296   {
1297     "sp_hardware_base_1",
1298     "wall",
1299     "hardware"
1300   },
1301   {
1302     "sp_hardware_green",
1303     "wall",
1304     "hardware"
1305   },
1306   {
1307     "sp_hardware_blue",
1308     "wall",
1309     "hardware"
1310   },
1311   {
1312     "sp_hardware_red",
1313     "wall",
1314     "hardware"
1315   },
1316   {
1317     "sp_hardware_yellow",
1318     "wall",
1319     "hardware"
1320   },
1321   {
1322     "sp_hardware_base_2",
1323     "wall",
1324     "hardware"
1325   },
1326   {
1327     "sp_hardware_base_3",
1328     "wall",
1329     "hardware"
1330   },
1331   {
1332     "sp_hardware_base_4",
1333     "wall",
1334     "hardware"
1335   },
1336   {
1337     "sp_hardware_base_5",
1338     "wall",
1339     "hardware"
1340   },
1341   {
1342     "sp_hardware_base_6",
1343     "wall",
1344     "hardware"
1345   },
1346   {
1347     "sp_chip_top",
1348     "wall",
1349     "chip (upper half)"
1350   },
1351   {
1352     "sp_chip_bottom",
1353     "wall",
1354     "chip (lower half)"
1355   },
1356   {
1357     "em_gate_1_gray",
1358     "gate",
1359     "gray door (EM style, red key)"
1360   },
1361   {
1362     "em_gate_2_gray",
1363     "gate",
1364     "gray door (EM style, yellow key)"
1365   },
1366   {
1367     "em_gate_3_gray",
1368     "gate",
1369     "gray door (EM style, green key)"
1370   },
1371   {
1372     "em_gate_4_gray",
1373     "gate",
1374     "gray door (EM style, blue key)"
1375   },
1376   {
1377     "unused_254",
1378     "unused",
1379     "(not used)"
1380   },
1381   {
1382     "unused_255",
1383     "unused",
1384     "(not used)"
1385   },
1386   {
1387     "pearl",
1388     "pearl",
1389     "pearl"
1390   },
1391   {
1392     "crystal",
1393     "crystal",
1394     "crystal"
1395   },
1396   {
1397     "wall_pearl",
1398     "wall",
1399     "wall with pearl"
1400   },
1401   {
1402     "wall_crystal",
1403     "wall",
1404     "wall with crystal"
1405   },
1406   {
1407     "door_white",
1408     "gate",
1409     "white door"
1410   },
1411   {
1412     "door_white_gray",
1413     "gate",
1414     "gray door (opened by white key)"
1415   },
1416   {
1417     "key_white",
1418     "key",
1419     "white key"
1420   },
1421   {
1422     "shield_normal",
1423     "shield_normal",
1424     "shield (normal)"
1425   },
1426   {
1427     "extra_time",
1428     "extra_time",
1429     "extra time"
1430   },
1431   {
1432     "switchgate_open",
1433     "switchgate",
1434     "switch gate (open)"
1435   },
1436   {
1437     "switchgate_closed",
1438     "switchgate",
1439     "switch gate (closed)"
1440   },
1441   {
1442     "switchgate_switch_up",
1443     "switchgate_switch",
1444     "switch for switch gate"
1445   },
1446   {
1447     "switchgate_switch_down",
1448     "switchgate_switch",
1449     "switch for switch gate"
1450   },
1451   {
1452     "unused_269",
1453     "unused",
1454     "-"
1455   },
1456   {
1457     "unused_270",
1458     "unused",
1459     "-"
1460   },
1461   {
1462     "conveyor_belt_1_left",
1463     "conveyor_belt",
1464     "red conveyor belt (left)"
1465   },
1466   {
1467     "conveyor_belt_1_middle",
1468     "conveyor_belt",
1469     "red conveyor belt (middle)"
1470   },
1471   {
1472     "conveyor_belt_1_right",
1473     "conveyor_belt",
1474     "red conveyor belt (right)"
1475   },
1476   {
1477     "conveyor_belt_1_switch_left",
1478     "conveyor_belt_switch",
1479     "switch for red conveyor belt (left)"
1480   },
1481   {
1482     "conveyor_belt_1_switch_middle",
1483     "conveyor_belt_switch",
1484     "switch for red conveyor belt (middle)"
1485   },
1486   {
1487     "conveyor_belt_1_switch_right",
1488     "conveyor_belt_switch",
1489     "switch for red conveyor belt (right)"
1490   },
1491   {
1492     "conveyor_belt_2_left",
1493     "conveyor_belt",
1494     "yellow conveyor belt (left)"
1495   },
1496   {
1497     "conveyor_belt_2_middle",
1498     "conveyor_belt",
1499     "yellow conveyor belt (middle)"
1500   },
1501   {
1502     "conveyor_belt_2_right",
1503     "conveyor_belt",
1504     "yellow conveyor belt (right)"
1505   },
1506   {
1507     "conveyor_belt_2_switch_left",
1508     "conveyor_belt_switch",
1509     "switch for yellow conveyor belt (left)"
1510   },
1511   {
1512     "conveyor_belt_2_switch_middle",
1513     "conveyor_belt_switch",
1514     "switch for yellow conveyor belt (middle)"
1515   },
1516   {
1517     "conveyor_belt_2_switch_right",
1518     "conveyor_belt_switch",
1519     "switch for yellow conveyor belt (right)"
1520   },
1521   {
1522     "conveyor_belt_3_left",
1523     "conveyor_belt",
1524     "green conveyor belt (left)"
1525   },
1526   {
1527     "conveyor_belt_3_middle",
1528     "conveyor_belt",
1529     "green conveyor belt (middle)"
1530   },
1531   {
1532     "conveyor_belt_3_right",
1533     "conveyor_belt",
1534     "green conveyor belt (right)"
1535   },
1536   {
1537     "conveyor_belt_3_switch_left",
1538     "conveyor_belt_switch",
1539     "switch for green conveyor belt (left)"
1540   },
1541   {
1542     "conveyor_belt_3_switch_middle",
1543     "conveyor_belt_switch",
1544     "switch for green conveyor belt (middle)"
1545   },
1546   {
1547     "conveyor_belt_3_switch_right",
1548     "conveyor_belt_switch",
1549     "switch for green conveyor belt (right)"
1550   },
1551   {
1552     "conveyor_belt_4_left",
1553     "conveyor_belt",
1554     "blue conveyor belt (left)"
1555   },
1556   {
1557     "conveyor_belt_4_middle",
1558     "conveyor_belt",
1559     "blue conveyor belt (middle)"
1560   },
1561   {
1562     "conveyor_belt_4_right",
1563     "conveyor_belt",
1564     "blue conveyor belt (right)"
1565   },
1566   {
1567     "conveyor_belt_4_switch_left",
1568     "conveyor_belt_switch",
1569     "switch for blue conveyor belt (left)"
1570   },
1571   {
1572     "conveyor_belt_4_switch_middle",
1573     "conveyor_belt_switch",
1574     "switch for blue conveyor belt (middle)"
1575   },
1576   {
1577     "conveyor_belt_4_switch_right",
1578     "conveyor_belt_switch",
1579     "switch for blue conveyor belt (right)"
1580   },
1581   {
1582     "landmine",
1583     "sand",
1584     "land mine"
1585   },
1586   {
1587     "envelope",
1588     "envelope",
1589     "mail envelope"
1590   },
1591   {
1592     "light_switch",
1593     "light_switch",
1594     "light switch (off)"
1595   },
1596   {
1597     "light_switch_active",
1598     "light_switch",
1599     "light switch (on)"
1600   },
1601   {
1602     "sign_exclamation",
1603     "wall",
1604     "sign (exclamation)"
1605   },
1606   {
1607     "sign_radioactivity",
1608     "wall",
1609     "sign (radio activity)"
1610   },
1611   {
1612     "sign_stop",
1613     "wall",
1614     "sign (stop)"
1615   },
1616   {
1617     "sign_wheelchair",
1618     "wall",
1619     "sign (wheel chair)"
1620   },
1621   {
1622     "sign_parking",
1623     "wall",
1624     "sign (parking)"
1625   },
1626   {
1627     "sign_oneway",
1628     "wall",
1629     "sign (one way)"
1630   },
1631   {
1632     "sign_heart",
1633     "wall",
1634     "sign (heart)"
1635   },
1636   {
1637     "sign_triangle",
1638     "wall",
1639     "sign (triangle)"
1640   },
1641   {
1642     "sign_round",
1643     "wall",
1644     "sign (round)"
1645   },
1646   {
1647     "sign_exit",
1648     "wall",
1649     "sign (exit)"
1650   },
1651   {
1652     "sign_yinyang",
1653     "wall",
1654     "sign (yin yang)"
1655   },
1656   {
1657     "sign_other",
1658     "wall",
1659     "sign (other)"
1660   },
1661   {
1662     "mole_left",
1663     "mole",
1664     "mole (starts moving left)"
1665   },
1666   {
1667     "mole_right",
1668     "mole",
1669     "mole (starts moving right)"
1670   },
1671   {
1672     "mole_up",
1673     "mole",
1674     "mole (starts moving up)"
1675   },
1676   {
1677     "mole_down",
1678     "mole",
1679     "mole (starts moving down)"
1680   },
1681   {
1682     "steelwall_slanted",
1683     "wall",
1684     "steel wall (slanted)"
1685   },
1686   {
1687     "invisible_sand",
1688     "sand",
1689     "invisible sand"
1690   },
1691   {
1692     "dx_unknown_15",
1693     "unknown",
1694     "dx unknown element 15"
1695   },
1696   {
1697     "dx_unknown_42",
1698     "unknown",
1699     "dx unknown element 42"
1700   },
1701   {
1702     "unused_319",
1703     "unused",
1704     "(not used)"
1705   },
1706   {
1707     "unused_320",
1708     "unused",
1709     "(not used)"
1710   },
1711   {
1712     "shield_deadly",
1713     "shield_deadly",
1714     "shield (deadly, kills enemies)"
1715   },
1716   {
1717     "timegate_open",
1718     "timegate",
1719     "time gate (open)"
1720   },
1721   {
1722     "timegate_closed",
1723     "timegate",
1724     "time gate (closed)"
1725   },
1726   {
1727     "timegate_switch_active",
1728     "timegate_switch",
1729     "switch for time gate"
1730   },
1731   {
1732     "timegate_switch",
1733     "timegate_switch",
1734     "switch for time gate"
1735   },
1736   {
1737     "balloon",
1738     "balloon",
1739     "balloon"
1740   },
1741   {
1742     "balloon_switch_left",
1743     "balloon_switch",
1744     "send balloon to the left"
1745   },
1746   {
1747     "balloon_switch_right",
1748     "balloon_switch",
1749     "send balloon to the right"
1750   },
1751   {
1752     "balloon_switch_up",
1753     "balloon_switch",
1754     "send balloon up"
1755   },
1756   {
1757     "balloon_switch_down",
1758     "balloon_switch",
1759     "send balloon down"
1760   },
1761   {
1762     "balloon_switch_any",
1763     "balloon_switch",
1764     "send balloon in any direction"
1765   },
1766   {
1767     "emc_steelwall_1",
1768     "wall",
1769     "steel wall"
1770   },
1771   {
1772     "emc_steelwall_2",
1773     "wall",
1774     "steel wall"
1775   },
1776   {
1777     "emc_steelwall_3",
1778     "wall",
1779     "steel wall"
1780   },
1781   {
1782     "emc_steelwall_4",
1783     "wall",
1784     "steel wall"
1785   },
1786   {
1787     "emc_wall_1",
1788     "wall",
1789     "normal wall"
1790   },
1791   {
1792     "emc_wall_2",
1793     "wall",
1794     "normal wall"
1795   },
1796   {
1797     "emc_wall_3",
1798     "wall",
1799     "normal wall"
1800   },
1801   {
1802     "emc_wall_4",
1803     "wall",
1804     "normal wall"
1805   },
1806   {
1807     "emc_wall_5",
1808     "wall",
1809     "normal wall"
1810   },
1811   {
1812     "emc_wall_6",
1813     "wall",
1814     "normal wall"
1815   },
1816   {
1817     "emc_wall_7",
1818     "wall",
1819     "normal wall"
1820   },
1821   {
1822     "emc_wall_8",
1823     "wall",
1824     "normal wall"
1825   },
1826   {
1827     "tube_any",
1828     "tube",
1829     "tube (any direction)"
1830   },
1831   {
1832     "tube_vertical",
1833     "tube",
1834     "tube (vertical)"
1835   },
1836   {
1837     "tube_horizontal",
1838     "tube",
1839     "tube (horizontal)"
1840   },
1841   {
1842     "tube_vertical_left",
1843     "tube",
1844     "tube (vertical & left)"
1845   },
1846   {
1847     "tube_vertical_right",
1848     "tube",
1849     "tube (vertical & right)"
1850   },
1851   {
1852     "tube_horizontal_up",
1853     "tube",
1854     "tube (horizontal & up)"
1855   },
1856   {
1857     "tube_horizontal_down",
1858     "tube",
1859     "tube (horizontal & down)"
1860   },
1861   {
1862     "tube_left_up",
1863     "tube",
1864     "tube (left & up)"
1865   },
1866   {
1867     "tube_left_down",
1868     "tube",
1869     "tube (left & down)"
1870   },
1871   {
1872     "tube_right_up",
1873     "tube",
1874     "tube (right & up)"
1875   },
1876   {
1877     "tube_right_down",
1878     "tube",
1879     "tube (right & down)"
1880   },
1881   {
1882     "spring",
1883     "spring",
1884     "spring"
1885   },
1886   {
1887     "trap",
1888     "trap",
1889     "trap"
1890   },
1891   {
1892     "dx_supabomb",
1893     "bomb",
1894     "stable bomb (DX style)"
1895   },
1896   {
1897     "unused_358",
1898     "unused",
1899     "-"
1900   },
1901   {
1902     "unused_359",
1903     "unused",
1904     "-"
1905   },
1906   {
1907     "custom_1",
1908     "custom",
1909     "custom element 1"
1910   },
1911   {
1912     "custom_2",
1913     "custom",
1914     "custom element 2"
1915   },
1916   {
1917     "custom_3",
1918     "custom",
1919     "custom element 3"
1920   },
1921   {
1922     "custom_4",
1923     "custom",
1924     "custom element 4"
1925   },
1926   {
1927     "custom_5",
1928     "custom",
1929     "custom element 5"
1930   },
1931   {
1932     "custom_6",
1933     "custom",
1934     "custom element 6"
1935   },
1936   {
1937     "custom_7",
1938     "custom",
1939     "custom element 7"
1940   },
1941   {
1942     "custom_8",
1943     "custom",
1944     "custom element 8"
1945   },
1946   {
1947     "custom_9",
1948     "custom",
1949     "custom element 9"
1950   },
1951   {
1952     "custom_10",
1953     "custom",
1954     "custom element 10"
1955   },
1956   {
1957     "custom_11",
1958     "custom",
1959     "custom element 11"
1960   },
1961   {
1962     "custom_12",
1963     "custom",
1964     "custom element 12"
1965   },
1966   {
1967     "custom_13",
1968     "custom",
1969     "custom element 13"
1970   },
1971   {
1972     "custom_14",
1973     "custom",
1974     "custom element 14"
1975   },
1976   {
1977     "custom_15",
1978     "custom",
1979     "custom element 15"
1980   },
1981   {
1982     "custom_16",
1983     "custom",
1984     "custom element 16"
1985   },
1986   {
1987     "custom_17",
1988     "custom",
1989     "custom element 17"
1990   },
1991   {
1992     "custom_18",
1993     "custom",
1994     "custom element 18"
1995   },
1996   {
1997     "custom_19",
1998     "custom",
1999     "custom element 19"
2000   },
2001   {
2002     "custom_20",
2003     "custom",
2004     "custom element 20"
2005   },
2006   {
2007     "custom_21",
2008     "custom",
2009     "custom element 21"
2010   },
2011   {
2012     "custom_22",
2013     "custom",
2014     "custom element 22"
2015   },
2016   {
2017     "custom_23",
2018     "custom",
2019     "custom element 23"
2020   },
2021   {
2022     "custom_24",
2023     "custom",
2024     "custom element 24"
2025   },
2026   {
2027     "custom_25",
2028     "custom",
2029     "custom element 25"
2030   },
2031   {
2032     "custom_26",
2033     "custom",
2034     "custom element 26"
2035   },
2036   {
2037     "custom_27",
2038     "custom",
2039     "custom element 27"
2040   },
2041   {
2042     "custom_28",
2043     "custom",
2044     "custom element 28"
2045   },
2046   {
2047     "custom_29",
2048     "custom",
2049     "custom element 29"
2050   },
2051   {
2052     "custom_30",
2053     "custom",
2054     "custom element 30"
2055   },
2056   {
2057     "custom_31",
2058     "custom",
2059     "custom element 31"
2060   },
2061   {
2062     "custom_32",
2063     "custom",
2064     "custom element 32"
2065   },
2066   {
2067     "custom_33",
2068     "custom",
2069     "custom element 33"
2070   },
2071   {
2072     "custom_34",
2073     "custom",
2074     "custom element 34"
2075   },
2076   {
2077     "custom_35",
2078     "custom",
2079     "custom element 35"
2080   },
2081   {
2082     "custom_36",
2083     "custom",
2084     "custom element 36"
2085   },
2086   {
2087     "custom_37",
2088     "custom",
2089     "custom element 37"
2090   },
2091   {
2092     "custom_38",
2093     "custom",
2094     "custom element 38"
2095   },
2096   {
2097     "custom_39",
2098     "custom",
2099     "custom element 39"
2100   },
2101   {
2102     "custom_40",
2103     "custom",
2104     "custom element 40"
2105   },
2106   {
2107     "custom_41",
2108     "custom",
2109     "custom element 41"
2110   },
2111   {
2112     "custom_42",
2113     "custom",
2114     "custom element 42"
2115   },
2116   {
2117     "custom_43",
2118     "custom",
2119     "custom element 43"
2120   },
2121   {
2122     "custom_44",
2123     "custom",
2124     "custom element 44"
2125   },
2126   {
2127     "custom_45",
2128     "custom",
2129     "custom element 45"
2130   },
2131   {
2132     "custom_46",
2133     "custom",
2134     "custom element 46"
2135   },
2136   {
2137     "custom_47",
2138     "custom",
2139     "custom element 47"
2140   },
2141   {
2142     "custom_48",
2143     "custom",
2144     "custom element 48"
2145   },
2146   {
2147     "custom_49",
2148     "custom",
2149     "custom element 49"
2150   },
2151   {
2152     "custom_50",
2153     "custom",
2154     "custom element 50"
2155   },
2156   {
2157     "custom_51",
2158     "custom",
2159     "custom element 51"
2160   },
2161   {
2162     "custom_52",
2163     "custom",
2164     "custom element 52"
2165   },
2166   {
2167     "custom_53",
2168     "custom",
2169     "custom element 53"
2170   },
2171   {
2172     "custom_54",
2173     "custom",
2174     "custom element 54"
2175   },
2176   {
2177     "custom_55",
2178     "custom",
2179     "custom element 55"
2180   },
2181   {
2182     "custom_56",
2183     "custom",
2184     "custom element 56"
2185   },
2186   {
2187     "custom_57",
2188     "custom",
2189     "custom element 57"
2190   },
2191   {
2192     "custom_58",
2193     "custom",
2194     "custom element 58"
2195   },
2196   {
2197     "custom_59",
2198     "custom",
2199     "custom element 59"
2200   },
2201   {
2202     "custom_60",
2203     "custom",
2204     "custom element 60"
2205   },
2206   {
2207     "custom_61",
2208     "custom",
2209     "custom element 61"
2210   },
2211   {
2212     "custom_62",
2213     "custom",
2214     "custom element 62"
2215   },
2216   {
2217     "custom_63",
2218     "custom",
2219     "custom element 63"
2220   },
2221   {
2222     "custom_64",
2223     "custom",
2224     "custom element 64"
2225   },
2226   {
2227     "custom_65",
2228     "custom",
2229     "custom element 65"
2230   },
2231   {
2232     "custom_66",
2233     "custom",
2234     "custom element 66"
2235   },
2236   {
2237     "custom_67",
2238     "custom",
2239     "custom element 67"
2240   },
2241   {
2242     "custom_68",
2243     "custom",
2244     "custom element 68"
2245   },
2246   {
2247     "custom_69",
2248     "custom",
2249     "custom element 69"
2250   },
2251   {
2252     "custom_70",
2253     "custom",
2254     "custom element 70"
2255   },
2256   {
2257     "custom_71",
2258     "custom",
2259     "custom element 71"
2260   },
2261   {
2262     "custom_72",
2263     "custom",
2264     "custom element 72"
2265   },
2266   {
2267     "custom_73",
2268     "custom",
2269     "custom element 73"
2270   },
2271   {
2272     "custom_74",
2273     "custom",
2274     "custom element 74"
2275   },
2276   {
2277     "custom_75",
2278     "custom",
2279     "custom element 75"
2280   },
2281   {
2282     "custom_76",
2283     "custom",
2284     "custom element 76"
2285   },
2286   {
2287     "custom_77",
2288     "custom",
2289     "custom element 77"
2290   },
2291   {
2292     "custom_78",
2293     "custom",
2294     "custom element 78"
2295   },
2296   {
2297     "custom_79",
2298     "custom",
2299     "custom element 79"
2300   },
2301   {
2302     "custom_80",
2303     "custom",
2304     "custom element 80"
2305   },
2306   {
2307     "custom_81",
2308     "custom",
2309     "custom element 81"
2310   },
2311   {
2312     "custom_82",
2313     "custom",
2314     "custom element 82"
2315   },
2316   {
2317     "custom_83",
2318     "custom",
2319     "custom element 83"
2320   },
2321   {
2322     "custom_84",
2323     "custom",
2324     "custom element 84"
2325   },
2326   {
2327     "custom_85",
2328     "custom",
2329     "custom element 85"
2330   },
2331   {
2332     "custom_86",
2333     "custom",
2334     "custom element 86"
2335   },
2336   {
2337     "custom_87",
2338     "custom",
2339     "custom element 87"
2340   },
2341   {
2342     "custom_88",
2343     "custom",
2344     "custom element 88"
2345   },
2346   {
2347     "custom_89",
2348     "custom",
2349     "custom element 89"
2350   },
2351   {
2352     "custom_90",
2353     "custom",
2354     "custom element 90"
2355   },
2356   {
2357     "custom_91",
2358     "custom",
2359     "custom element 91"
2360   },
2361   {
2362     "custom_92",
2363     "custom",
2364     "custom element 92"
2365   },
2366   {
2367     "custom_93",
2368     "custom",
2369     "custom element 93"
2370   },
2371   {
2372     "custom_94",
2373     "custom",
2374     "custom element 94"
2375   },
2376   {
2377     "custom_95",
2378     "custom",
2379     "custom element 95"
2380   },
2381   {
2382     "custom_96",
2383     "custom",
2384     "custom element 96"
2385   },
2386   {
2387     "custom_97",
2388     "custom",
2389     "custom element 97"
2390   },
2391   {
2392     "custom_98",
2393     "custom",
2394     "custom element 98"
2395   },
2396   {
2397     "custom_99",
2398     "custom",
2399     "custom element 99"
2400   },
2401   {
2402     "custom_100",
2403     "custom",
2404     "custom element 100"
2405   },
2406   {
2407     "custom_101",
2408     "custom",
2409     "custom element 101"
2410   },
2411   {
2412     "custom_102",
2413     "custom",
2414     "custom element 102"
2415   },
2416   {
2417     "custom_103",
2418     "custom",
2419     "custom element 103"
2420   },
2421   {
2422     "custom_104",
2423     "custom",
2424     "custom element 104"
2425   },
2426   {
2427     "custom_105",
2428     "custom",
2429     "custom element 105"
2430   },
2431   {
2432     "custom_106",
2433     "custom",
2434     "custom element 106"
2435   },
2436   {
2437     "custom_107",
2438     "custom",
2439     "custom element 107"
2440   },
2441   {
2442     "custom_108",
2443     "custom",
2444     "custom element 108"
2445   },
2446   {
2447     "custom_109",
2448     "custom",
2449     "custom element 109"
2450   },
2451   {
2452     "custom_110",
2453     "custom",
2454     "custom element 110"
2455   },
2456   {
2457     "custom_111",
2458     "custom",
2459     "custom element 111"
2460   },
2461   {
2462     "custom_112",
2463     "custom",
2464     "custom element 112"
2465   },
2466   {
2467     "custom_113",
2468     "custom",
2469     "custom element 113"
2470   },
2471   {
2472     "custom_114",
2473     "custom",
2474     "custom element 114"
2475   },
2476   {
2477     "custom_115",
2478     "custom",
2479     "custom element 115"
2480   },
2481   {
2482     "custom_116",
2483     "custom",
2484     "custom element 116"
2485   },
2486   {
2487     "custom_117",
2488     "custom",
2489     "custom element 117"
2490   },
2491   {
2492     "custom_118",
2493     "custom",
2494     "custom element 118"
2495   },
2496   {
2497     "custom_119",
2498     "custom",
2499     "custom element 119"
2500   },
2501   {
2502     "custom_120",
2503     "custom",
2504     "custom element 120"
2505   },
2506   {
2507     "custom_121",
2508     "custom",
2509     "custom element 121"
2510   },
2511   {
2512     "custom_122",
2513     "custom",
2514     "custom element 122"
2515   },
2516   {
2517     "custom_123",
2518     "custom",
2519     "custom element 123"
2520   },
2521   {
2522     "custom_124",
2523     "custom",
2524     "custom element 124"
2525   },
2526   {
2527     "custom_125",
2528     "custom",
2529     "custom element 125"
2530   },
2531   {
2532     "custom_126",
2533     "custom",
2534     "custom element 126"
2535   },
2536   {
2537     "custom_127",
2538     "custom",
2539     "custom element 127"
2540   },
2541   {
2542     "custom_128",
2543     "custom",
2544     "custom element 128"
2545   },
2546
2547   /* ----------------------------------------------------------------------- */
2548   /* "real" (and therefore drawable) runtime elements                        */
2549   /* ----------------------------------------------------------------------- */
2550
2551   {
2552     "em_key_1",
2553     "key",
2554     "-"
2555     },
2556   {
2557     "em_key_2",
2558     "key",
2559     "-"
2560     },
2561   {
2562     "em_key_3",
2563     "key",
2564     "-"
2565   },
2566   {
2567     "em_key_4",
2568     "key",
2569     "-"
2570   },
2571   {
2572     "dynabomb_player_1_active",
2573     "dynabomb",
2574     "-"
2575   },
2576   {
2577     "dynabomb_player_2_active",
2578     "dynabomb",
2579     "-"
2580   },
2581   {
2582     "dynabomb_player_3_active",
2583     "dynabomb",
2584     "-"
2585   },
2586   {
2587     "dynabomb_player_4_active",
2588     "dynabomb",
2589     "-"
2590   },
2591   {
2592     "sp_disk_red_active",
2593     "dynamite",
2594     "-"
2595   },
2596   {
2597     "switchgate_opening",
2598     "switchgate",
2599     "-"
2600   },
2601   {
2602     "switchgate_closing",
2603     "switchgate",
2604     "-"
2605   },
2606   {
2607     "timegate_opening",
2608     "timegate",
2609     "-"
2610   },
2611   {
2612     "timegate_closing",
2613     "timegate",
2614     "-"
2615   },
2616   {
2617     "pearl_breaking",
2618     "pearl",
2619     "-"
2620   },
2621   {
2622     "trap_active",
2623     "trap",
2624     "-"
2625   },
2626   {
2627     "invisible_steelwall_active",
2628     "wall",
2629     "-"
2630   },
2631   {
2632     "invisible_wall_active",
2633     "wall",
2634     "-"
2635   },
2636   {
2637     "invisible_sand_active",
2638     "sand",
2639     "-"
2640   },
2641   {
2642     "conveyor_belt_1_left_active",
2643     "conveyor_belt",
2644     "-"
2645   },
2646   {
2647     "conveyor_belt_1_middle_active",
2648     "conveyor_belt",
2649     "-"
2650   },
2651   {
2652     "conveyor_belt_1_right_active",
2653     "conveyor_belt",
2654     "-"
2655   },
2656   {
2657     "conveyor_belt_2_left_active",
2658     "conveyor_belt",
2659     "-"
2660   },
2661   {
2662     "conveyor_belt_2_middle_active",
2663     "conveyor_belt",
2664     "-"
2665   },
2666   {
2667     "conveyor_belt_2_right_active",
2668     "conveyor_belt",
2669     "-"
2670   },
2671   {
2672     "conveyor_belt_3_left_active",
2673     "conveyor_belt",
2674     "-"
2675   },
2676   {
2677     "conveyor_belt_3_middle_active",
2678     "conveyor_belt",
2679     "-"
2680   },
2681   {
2682     "conveyor_belt_3_right_active",
2683     "conveyor_belt",
2684     "-"
2685   },
2686   {
2687     "conveyor_belt_4_left_active",
2688     "conveyor_belt",
2689     "-"
2690   },
2691   {
2692     "conveyor_belt_4_middle_active",
2693     "conveyor_belt",
2694     "-"
2695   },
2696   {
2697     "conveyor_belt_4_right_active",
2698     "conveyor_belt",
2699     "-"
2700   },
2701   {
2702     "exit_opening",
2703     "exit",
2704     "-"
2705   },
2706   {
2707     "sp_exit_open",
2708     "sp_exit",
2709     "-"
2710   },
2711   {
2712     "sp_terminal_active",
2713     "sp_terminal",
2714     "-"
2715   },
2716   {
2717     "sp_buggy_base_activating",
2718     "sp_buggy_base",
2719     "-"
2720   },
2721   {
2722     "sp_buggy_base_active",
2723     "sp_buggy_base",
2724     "-"
2725   },
2726   {
2727     "sp_murphy_clone",
2728     "murphy_clone",
2729     "-"
2730   },
2731   {
2732     "amoeba_dropping",
2733     "amoeba",
2734     "-"
2735   },
2736   {
2737     "quicksand_emptying",
2738     "quicksand",
2739     "-"
2740   },
2741   {
2742     "magic_wall_active",
2743     "magic_wall",
2744     "-"
2745   },
2746   {
2747     "bd_magic_wall_active",
2748     "magic_wall",
2749     "-"
2750   },
2751   {
2752     "magic_wall_full",
2753     "magic_wall",
2754     "-"
2755   },
2756   {
2757     "bd_magic_wall_full",
2758     "magic_wall",
2759     "-"
2760   },
2761   {
2762     "magic_wall_emptying",
2763     "magic_wall",
2764     "-"
2765   },
2766   {
2767     "bd_magic_wall_emptying",
2768     "magic_wall",
2769     "-"
2770   },
2771   {
2772     "magic_wall_dead",
2773     "magic_wall",
2774     "-"
2775   },
2776   {
2777     "bd_magic_wall_dead",
2778     "magic_wall",
2779     "-"
2780   },
2781
2782   /* ----------------------------------------------------------------------- */
2783   /* "unreal" (and therefore not drawable) runtime elements                  */
2784   /* ----------------------------------------------------------------------- */
2785
2786   {
2787     "blocked",
2788     "-",
2789     "-"
2790   },
2791   {
2792     "explosion",
2793     "-",
2794     "-"
2795   },
2796   {
2797     "nut_breaking",
2798     "-",
2799     "-"
2800   },
2801   {
2802     "diamond_breaking",
2803     "-",
2804     "-"
2805   },
2806   {
2807     "acid_splash_left",
2808     "-",
2809     "-"
2810   },
2811   {
2812     "acid_splash_right",
2813     "-",
2814     "-"
2815   },
2816   {
2817     "amoeba_growing",
2818     "-",
2819     "-"
2820   },
2821   {
2822     "amoeba_shrinking",
2823     "-",
2824     "-"
2825   },
2826   {
2827     "expandable_wall_growing",
2828     "-",
2829     "-"
2830   },
2831   {
2832     "flames",
2833     "-",
2834     "-"
2835   },
2836   {
2837     "player_is_leaving",
2838     "-",
2839     "-"
2840   },
2841   {
2842     "quicksand_filling",
2843     "quicksand",
2844     "-"
2845   },
2846   {
2847     "magic_wall_filling",
2848     "-",
2849     "-"
2850   },
2851   {
2852     "bd_magic_wall_filling",
2853     "-",
2854     "-"
2855   },
2856
2857   /* ----------------------------------------------------------------------- */
2858   /* dummy elements (never used as game elements, only used as graphics)     */
2859   /* ----------------------------------------------------------------------- */
2860
2861   {
2862     "steelwall_topleft",
2863     "-",
2864     "-"
2865   },
2866   {
2867     "steelwall_topright",
2868     "-",
2869     "-"
2870   },
2871   {
2872     "steelwall_bottomleft",
2873     "-",
2874     "-"
2875   },
2876   {
2877     "steelwall_bottomright",
2878     "-",
2879     "-"
2880   },
2881   {
2882     "steelwall_horizontal",
2883     "-",
2884     "-"
2885   },
2886   {
2887     "steelwall_vertical",
2888     "-",
2889     "-"
2890   },
2891   {
2892     "invisible_steelwall_topleft",
2893     "-",
2894     "-"
2895   },
2896   {
2897     "invisible_steelwall_topright",
2898     "-",
2899     "-"
2900   },
2901   {
2902     "invisible_steelwall_bottomleft",
2903     "-",
2904     "-"
2905   },
2906   {
2907     "invisible_steelwall_bottomright",
2908     "-",
2909     "-"
2910   },
2911   {
2912     "invisible_steelwall_horizontal",
2913     "-",
2914     "-"
2915   },
2916   {
2917     "invisible_steelwall_vertical",
2918     "-",
2919     "-"
2920   },
2921   {
2922     "sand_crumbled",
2923     "-",
2924     "-"
2925   },
2926   {
2927     "dynabomb_active",
2928     "-",
2929     "-"
2930   },
2931   {
2932     "shield_normal_active",
2933     "-",
2934     "-"
2935   },
2936   {
2937     "shield_deadly_active",
2938     "-",
2939     "-"
2940   },
2941   {
2942     "[default]",
2943     "default",
2944     "-"
2945   },
2946   {
2947     "[bd_default]",
2948     "bd_default",
2949     "-"
2950   },
2951   {
2952     "[sp_default]",
2953     "sp_default",
2954     "-"
2955   },
2956   {
2957     "[sb_default]",
2958     "sb_default",
2959     "-"
2960   },
2961
2962   /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
2963
2964   {
2965     NULL,
2966     NULL,
2967     NULL
2968   }
2969 };
2970
2971
2972 /* ------------------------------------------------------------------------- */
2973 /* element action and direction definitions                                  */
2974 /* ------------------------------------------------------------------------- */
2975
2976 struct ElementActionInfo element_action_info[NUM_ACTIONS + 1] =
2977 {
2978   { ".[DEFAULT]",       ACTION_DEFAULT,         TRUE    },
2979   { ".waiting",         ACTION_WAITING,         TRUE    },
2980   { ".falling",         ACTION_FALLING,         TRUE    },
2981   { ".moving",          ACTION_MOVING,          TRUE    },
2982   { ".digging",         ACTION_DIGGING,         FALSE   },
2983   { ".snapping",        ACTION_SNAPPING,        FALSE   },
2984   { ".collecting",      ACTION_COLLECTING,      FALSE   },
2985   { ".dropping",        ACTION_DROPPING,        FALSE   },
2986   { ".pushing",         ACTION_PUSHING,         FALSE   },
2987   { ".walking",         ACTION_WALKING,         FALSE   },
2988   { ".passing",         ACTION_PASSING,         FALSE   },
2989   { ".impact",          ACTION_IMPACT,          FALSE   },
2990   { ".breaking",        ACTION_BREAKING,        FALSE   },
2991   { ".activating",      ACTION_ACTIVATING,      FALSE   },
2992   { ".deactivating",    ACTION_DEACTIVATING,    FALSE   },
2993   { ".opening",         ACTION_OPENING,         FALSE   },
2994   { ".closing",         ACTION_CLOSING,         FALSE   },
2995   { ".attacking",       ACTION_ATTACKING,       TRUE    },
2996   { ".growing",         ACTION_GROWING,         TRUE    },
2997   { ".shrinking",       ACTION_SHRINKING,       FALSE   },
2998   { ".active",          ACTION_ACTIVE,          TRUE    },
2999   { ".filling",         ACTION_FILLING,         FALSE   },
3000   { ".emptying",        ACTION_EMPTYING,        FALSE   },
3001   { ".changing",        ACTION_CHANGING,        FALSE   },
3002   { ".exploding",       ACTION_EXPLODING,       FALSE   },
3003   { ".dying",           ACTION_DYING,           FALSE   },
3004   { ".other",           ACTION_OTHER,           FALSE   },
3005
3006   { NULL,               0,                      0       }
3007 };
3008
3009 struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
3010 {
3011   { ".left",            MV_BIT_LEFT                     },
3012   { ".right",           MV_BIT_RIGHT                    },
3013   { ".up",              MV_BIT_UP                       },
3014   { ".down",            MV_BIT_DOWN                     },
3015
3016   { NULL,               0                               }
3017 };
3018
3019 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
3020 {
3021   { ".MAIN",            GAME_MODE_MAIN,                 },
3022   { ".LEVELS",          GAME_MODE_LEVELS                },
3023   { ".SCORES",          GAME_MODE_SCORES,               },
3024   { ".EDITOR",          GAME_MODE_EDITOR,               },
3025   { ".INFO",            GAME_MODE_INFO,                 },
3026   { ".SETUP",           GAME_MODE_SETUP,                },
3027   { ".DOOR",            GAME_MODE_PSEUDO_DOOR,          },
3028   { ".PREVIEW",         GAME_MODE_PSEUDO_PREVIEW,       },
3029
3030   { NULL,               0,                              }
3031 };
3032
3033 struct TokenIntPtrInfo image_config_vars[] =
3034 {
3035   { "global.num_toons",         &global.num_toons                          },
3036
3037   { "menu.draw_xoffset",        &menu.draw_xoffset_default                 },
3038   { "menu.draw_yoffset",        &menu.draw_yoffset_default                 },
3039   { "menu.draw_xoffset.MAIN",   &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN]   },
3040   { "menu.draw_yoffset.MAIN",   &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN]   },
3041   { "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
3042   { "menu.draw_yoffset.LEVELS", &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] },
3043   { "menu.draw_xoffset.SCORES", &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] },
3044   { "menu.draw_yoffset.SCORES", &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] },
3045   { "menu.draw_xoffset.EDITOR", &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] },
3046   { "menu.draw_yoffset.EDITOR", &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] },
3047   { "menu.draw_xoffset.INFO",   &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO]   },
3048   { "menu.draw_yoffset.INFO",   &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO]   },
3049   { "menu.draw_xoffset.SETUP",  &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP]  },
3050   { "menu.draw_yoffset.SETUP",  &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP]  },
3051
3052   { "menu.list_size",           &menu.list_size_default                    },
3053   { "menu.list_size.LEVELS",    &menu.list_size[GFX_SPECIAL_ARG_LEVELS]    },
3054   { "menu.list_size.SCORES",    &menu.list_size[GFX_SPECIAL_ARG_SCORES]    },
3055   { "menu.list_size.INFO",      &menu.list_size[GFX_SPECIAL_ARG_INFO]      },
3056
3057   { "door.step_offset",         &door.step_offset                          },
3058   { "door.step_delay",          &door.step_delay                           },
3059
3060   { NULL,                       NULL,                                      }
3061 };
3062
3063
3064 /* ------------------------------------------------------------------------- */
3065 /* font definitions                                                          */
3066 /* ------------------------------------------------------------------------- */
3067
3068 /* Important: When one entry is a prefix of another entry, the longer entry
3069    must come first, because the dynamic configuration does prefix matching! */
3070
3071 struct FontInfo font_info[NUM_FONTS + 1] =
3072 {
3073   { "font.initial_1"            },
3074   { "font.initial_2"            },
3075   { "font.initial_3"            },
3076   { "font.initial_4"            },
3077   { "font.title_1"              },
3078   { "font.title_2"              },
3079   { "font.menu_1"               },
3080   { "font.menu_2"               },
3081   { "font.text_1.active"        },
3082   { "font.text_2.active"        },
3083   { "font.text_3.active"        },
3084   { "font.text_4.active"        },
3085   { "font.text_1"               },
3086   { "font.text_2"               },
3087   { "font.text_3"               },
3088   { "font.text_4"               },
3089   { "font.input_1.active"       },
3090   { "font.input_2.active"       },
3091   { "font.input_1"              },
3092   { "font.input_2"              },
3093   { "font.option_off"           },
3094   { "font.option_on"            },
3095   { "font.value_1"              },
3096   { "font.value_2"              },
3097   { "font.value_old"            },
3098   { "font.level_number"         },
3099   { "font.tape_recorder"        },
3100   { "font.game_info"            },
3101 };
3102
3103
3104 /* ========================================================================= */
3105 /* main()                                                                    */
3106 /* ========================================================================= */
3107
3108 int main(int argc, char *argv[])
3109 {
3110   InitProgramInfo(argv[0], USERDATA_DIRECTORY,
3111                   PROGRAM_TITLE_STRING, getWindowTitleString(),
3112                   ICON_TITLE_STRING, X11_ICON_FILENAME, X11_ICONMASK_FILENAME,
3113                   MSDOS_POINTER_FILENAME,
3114                   COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL);
3115
3116   InitExitFunction(CloseAllAndExit);
3117   InitPlatformDependentStuff();
3118
3119   GetOptions(argv);
3120   OpenAll();
3121
3122   EventLoop();
3123   CloseAllAndExit(0);
3124
3125   return 0;     /* to keep compilers happy */
3126 }