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