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