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