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