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