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