rnd-20030924-B-src
[rocksndiamonds.git] / src / main.c
index e9817ae3b7e59b8a8dc1cf13b13ad10c8b57f503..f3c946f44685bbf0876bbef8fde7dd05ef0a3c60 100644 (file)
@@ -27,8 +27,8 @@ Bitmap                       *bitmap_db_field, *bitmap_db_door;
 #if 0
 Pixmap                 tile_clipmask[NUM_TILES];
 #endif
-DrawBuffer          *fieldbuffer;
-DrawBuffer          *drawto_field;
+DrawBuffer            *fieldbuffer;
+DrawBuffer            *drawto_field;
 
 int                    game_status = -1;
 boolean                        level_editor_test_game = FALSE;
@@ -40,15 +40,18 @@ boolean                     redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
 int                    redraw_x1 = 0, redraw_y1 = 0;
 
 short                  Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short                  Ur[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ChangeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  StorePlayer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  Back[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 boolean                        Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+boolean                        Pushed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+unsigned long          Changed[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+unsigned long          ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaCnt[MAX_NUM_AMOEBA];
@@ -85,13 +88,15 @@ int                 TimeFrames, TimePlayed, TimeLeft;
 
 boolean                        network_player_action_received = FALSE;
 
-struct LevelInfo       level;
+struct LevelInfo       level, level_template;
 struct PlayerInfo      stored_player[MAX_PLAYERS], *local_player = NULL;
 struct HiScore         highscore[MAX_SCORE_ENTRIES];
 struct TapeInfo                tape;
 struct SetupInfo       setup;
 struct GameInfo                game;
 struct GlobalInfo      global;
+struct MenuInfo                menu;
+struct DoorInfo                door;
 struct GraphicInfo     *graphic_info = NULL;
 struct SoundInfo       *sound_info = NULL;
 
@@ -124,9 +129,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "normal wall"
   },
   {
-    "wall_crumbled",
+    "wall_slippery",
     "wall",
-    "round wall"
+    "slippery wall"
   },
   {
     "rock",
@@ -135,8 +140,8 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "key_obsolete",
-    "key",
-    "key"
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
     "emerald",
@@ -150,8 +155,8 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "player_obsolete",
-    "player",
-    "player"
+    "obsolete",
+    "player (OBSOLETE)"
   },
   {
     "bug",
@@ -289,45 +294,42 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "blue key"
   },
   {
-    "gate_1_closed",
+    "gate_1",
     "gate",
     "red door"
   },
   {
-    "gate_2_closed",
+    "gate_2",
     "gate",
     "yellow door"
   },
   {
-    "gate_3_closed",
+    "gate_3",
     "gate",
     "green door"
   },
   {
-    "gate_4_closed",
+    "gate_4",
     "gate",
     "blue door"
   },
   {
-    "gate_1_gray_closed",
+    "gate_1_gray",
     "gate",
     "gray door (opened by red key)"
   },
   {
-    "gate_2_gray_closed",
+    "gate_2_gray",
     "gate",
-    "gray door (opened by yellow key)"
-  },
+    "gray door (opened by yellow key)"},
   {
-    "gate_3_gray_closed",
+    "gate_3_gray",
     "gate",
-    "gray door (opened by green key)"
-  },
+    "gray door (opened by green key)"},
   {
-    "gate_4_gray_closed",
+    "gate_4_gray",
     "gate",
-    "gray door (opened by blue key)"
-  },
+    "gray door (opened by blue key)"},
   {
     "dynamite",
     "dynamite",
@@ -698,9 +700,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "fire breathing dragon"
   },
   {
-    "em_key_1_file",
-    "key",
-    "red key (EM style)"
+    "em_key_1_file_obsolete",
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
     "char_space",
@@ -1118,39 +1120,39 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "growing wall (any direction)"
   },
   {
-    "em_gate_1_closed",
+    "em_gate_1",
     "gate",
     "red door (EM style)"
   },
   {
-    "em_gate_2_closed",
+    "em_gate_2",
     "gate",
     "yellow door (EM style)"
   },
   {
-    "em_gate_3_closed",
+    "em_gate_3",
     "gate",
     "green door (EM style)"
   },
   {
-    "em_gate_4_closed",
+    "em_gate_4",
     "gate",
     "blue door (EM style)"
   },
   {
-    "em_key_2_file",
-    "key",
-    "yellow key (EM style)"
+    "em_key_2_file_obsolete",
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
-    "em_key_3_file",
-    "key",
-    "green key (EM style)"
+    "em_key_3_file_obsolete",
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
-    "em_key_4_file",
-    "key",
-    "blue key (EM style)"
+    "em_key_4_file_obsolete",
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
     "sp_empty_space",
@@ -1220,22 +1222,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "sp_gravity_port_right",
     "sp_port",
-    "port (leading right)"
+    "gravity port (leading right)"
   },
   {
     "sp_gravity_port_down",
     "sp_port",
-    "port (leading down)"
+    "gravity port (leading down)"
   },
   {
     "sp_gravity_port_left",
     "sp_port",
-    "port (leading left)"
+    "gravity port (leading left)"
   },
   {
     "sp_gravity_port_up",
     "sp_port",
-    "port (leading up)"
+    "gravity port (leading up)"
   },
   {
     "sp_sniksnak",
@@ -1353,22 +1355,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "chip (lower half)"
   },
   {
-    "em_gate_1_gray_closed",
+    "em_gate_1_gray",
     "gate",
     "gray door (EM style, red key)"
   },
   {
-    "em_gate_2_gray_closed",
+    "em_gate_2_gray",
     "gate",
     "gray door (EM style, yellow key)"
   },
   {
-    "em_gate_3_gray_closed",
+    "em_gate_3_gray",
     "gate",
     "gray door (EM style, green key)"
   },
   {
-    "em_gate_4_gray_closed",
+    "em_gate_4_gray",
     "gate",
     "gray door (EM style, blue key)"
   },
@@ -1583,9 +1585,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "land mine"
   },
   {
-    "envelope",
-    "envelope",
-    "mail envelope"
+    "envelope_obsolete",
+    "obsolete",
+    "envelope (OBSOLETE)"
   },
   {
     "light_switch",
@@ -1678,9 +1680,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "mole (starts moving down)"
   },
   {
-    "steelwall_slanted",
+    "steelwall_slippery",
     "wall",
-    "steel wall (slanted)"
+    "slippery steel wall"
   },
   {
     "invisible_sand",
@@ -2542,320 +2544,905 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "custom",
     "custom element 128"
   },
-
-  /* ----------------------------------------------------------------------- */
-  /* "real" (and therefore drawable) runtime elements                        */
-  /* ----------------------------------------------------------------------- */
-
   {
-    "em_key_1",
-    "key",
-    "-"
-    },
-  {
-    "em_key_2",
-    "key",
-    "-"
-    },
+    "custom_129",
+    "custom",
+    "custom element 129"
+  },
   {
-    "em_key_3",
-    "key",
-    "-"
+    "custom_130",
+    "custom",
+    "custom element 130"
   },
   {
-    "em_key_4",
-    "key",
-    "-"
+    "custom_131",
+    "custom",
+    "custom element 131"
   },
   {
-    "dynabomb_player_1_active",
-    "dynabomb",
-    "-"
+    "custom_132",
+    "custom",
+    "custom element 132"
   },
   {
-    "dynabomb_player_2_active",
-    "dynabomb",
-    "-"
+    "custom_133",
+    "custom",
+    "custom element 133"
   },
   {
-    "dynabomb_player_3_active",
-    "dynabomb",
-    "-"
+    "custom_134",
+    "custom",
+    "custom element 134"
   },
   {
-    "dynabomb_player_4_active",
-    "dynabomb",
-    "-"
+    "custom_135",
+    "custom",
+    "custom element 135"
   },
   {
-    "sp_disk_red_active",
-    "dynamite",
-    "-"
+    "custom_136",
+    "custom",
+    "custom element 136"
   },
   {
-    "switchgate_opening",
-    "switchgate",
-    "-"
+    "custom_137",
+    "custom",
+    "custom element 137"
   },
   {
-    "switchgate_closing",
-    "switchgate",
-    "-"
+    "custom_138",
+    "custom",
+    "custom element 138"
   },
   {
-    "timegate_opening",
-    "timegate",
-    "-"
+    "custom_139",
+    "custom",
+    "custom element 139"
   },
   {
-    "timegate_closing",
-    "timegate",
-    "-"
+    "custom_140",
+    "custom",
+    "custom element 140"
   },
   {
-    "pearl_breaking",
-    "pearl",
-    "-"
+    "custom_141",
+    "custom",
+    "custom element 141"
   },
   {
-    "trap_active",
-    "trap",
-    "-"
+    "custom_142",
+    "custom",
+    "custom element 142"
   },
   {
-    "invisible_steelwall_active",
-    "wall",
-    "-"
+    "custom_143",
+    "custom",
+    "custom element 143"
   },
   {
-    "invisible_wall_active",
-    "wall",
-    "-"
+    "custom_144",
+    "custom",
+    "custom element 144"
   },
   {
-    "invisible_sand_active",
-    "sand",
-    "-"
+    "custom_145",
+    "custom",
+    "custom element 145"
   },
   {
-    "conveyor_belt_1_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_146",
+    "custom",
+    "custom element 146"
   },
   {
-    "conveyor_belt_1_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_147",
+    "custom",
+    "custom element 147"
   },
   {
-    "conveyor_belt_1_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_148",
+    "custom",
+    "custom element 148"
   },
   {
-    "conveyor_belt_2_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_149",
+    "custom",
+    "custom element 149"
   },
   {
-    "conveyor_belt_2_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_150",
+    "custom",
+    "custom element 150"
   },
   {
-    "conveyor_belt_2_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_151",
+    "custom",
+    "custom element 151"
   },
   {
-    "conveyor_belt_3_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_152",
+    "custom",
+    "custom element 152"
   },
   {
-    "conveyor_belt_3_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_153",
+    "custom",
+    "custom element 153"
   },
   {
-    "conveyor_belt_3_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_154",
+    "custom",
+    "custom element 154"
   },
   {
-    "conveyor_belt_4_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_155",
+    "custom",
+    "custom element 155"
   },
   {
-    "conveyor_belt_4_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_156",
+    "custom",
+    "custom element 156"
   },
   {
-    "conveyor_belt_4_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_157",
+    "custom",
+    "custom element 157"
   },
   {
-    "exit_opening",
-    "exit",
-    "-"
+    "custom_158",
+    "custom",
+    "custom element 158"
   },
   {
-    "sp_exit_open",
-    "sp_exit",
-    "-"
+    "custom_159",
+    "custom",
+    "custom element 159"
   },
   {
-    "sp_terminal_active",
-    "sp_terminal",
-    "-"
+    "custom_160",
+    "custom",
+    "custom element 160"
   },
   {
-    "sp_buggy_base_activating",
-    "sp_buggy_base",
-    "-"
+    "custom_161",
+    "custom",
+    "custom element 161"
   },
   {
-    "sp_buggy_base_active",
-    "sp_buggy_base",
-    "-"
+    "custom_162",
+    "custom",
+    "custom element 162"
   },
   {
-    "sp_murphy_clone",
-    "murphy_clone",
-    "-"
+    "custom_163",
+    "custom",
+    "custom element 163"
   },
   {
-    "amoeba_dropping",
-    "amoeba",
-    "-"
+    "custom_164",
+    "custom",
+    "custom element 164"
   },
   {
-    "quicksand_emptying",
-    "quicksand",
-    "-"
+    "custom_165",
+    "custom",
+    "custom element 165"
   },
   {
-    "magic_wall_active",
-    "magic_wall",
-    "-"
+    "custom_166",
+    "custom",
+    "custom element 166"
   },
   {
-    "bd_magic_wall_active",
-    "magic_wall",
-    "-"
+    "custom_167",
+    "custom",
+    "custom element 167"
   },
   {
-    "magic_wall_full",
-    "magic_wall",
-    "-"
+    "custom_168",
+    "custom",
+    "custom element 168"
   },
   {
-    "bd_magic_wall_full",
-    "magic_wall",
-    "-"
+    "custom_169",
+    "custom",
+    "custom element 169"
   },
   {
-    "magic_wall_emptying",
-    "magic_wall",
-    "-"
+    "custom_170",
+    "custom",
+    "custom element 170"
   },
   {
-    "bd_magic_wall_emptying",
-    "magic_wall",
-    "-"
+    "custom_171",
+    "custom",
+    "custom element 171"
   },
   {
-    "magic_wall_dead",
-    "magic_wall",
-    "-"
+    "custom_172",
+    "custom",
+    "custom element 172"
   },
   {
-    "bd_magic_wall_dead",
-    "magic_wall",
-    "-"
+    "custom_173",
+    "custom",
+    "custom element 173"
   },
   {
-    "gate_1_open",
-    "gate",
-    "red door"
+    "custom_174",
+    "custom",
+    "custom element 174"
   },
   {
-    "gate_2_open",
-    "gate",
-    "yellow door"
+    "custom_175",
+    "custom",
+    "custom element 175"
   },
   {
-    "gate_3_open",
-    "gate",
-    "green door"
+    "custom_176",
+    "custom",
+    "custom element 176"
   },
   {
-    "gate_4_open",
-    "gate",
-    "blue door"
+    "custom_177",
+    "custom",
+    "custom element 177"
   },
   {
-    "gate_1_gray_open",
-    "gate",
-    "gray door (opened by red key)"
+    "custom_178",
+    "custom",
+    "custom element 178"
   },
   {
-    "gate_2_gray_open",
-    "gate",
-    "gray door (opened by yellow key)"
+    "custom_179",
+    "custom",
+    "custom element 179"
   },
   {
-    "gate_3_gray_open",
-    "gate",
-    "gray door (opened by green key)"
+    "custom_180",
+    "custom",
+    "custom element 180"
   },
   {
-    "gate_4_gray_open",
-    "gate",
-    "gray door (opened by blue key)"
+    "custom_181",
+    "custom",
+    "custom element 181"
   },
   {
-    "em_gate_1_open",
-    "gate",
-    "red door (EM style)"
+    "custom_182",
+    "custom",
+    "custom element 182"
   },
   {
-    "em_gate_2_open",
-    "gate",
-    "yellow door (EM style)"
+    "custom_183",
+    "custom",
+    "custom element 183"
   },
   {
-    "em_gate_3_open",
-    "gate",
-    "green door (EM style)"
+    "custom_184",
+    "custom",
+    "custom element 184"
   },
   {
-    "em_gate_4_open",
-    "gate",
-    "blue door (EM style)"
+    "custom_185",
+    "custom",
+    "custom element 185"
   },
   {
-    "em_gate_1_gray_open",
-    "gate",
-    "gray door (EM style, red key)"
+    "custom_186",
+    "custom",
+    "custom element 186"
   },
   {
-    "em_gate_2_gray_open",
-    "gate",
-    "gray door (EM style, yellow key)"
+    "custom_187",
+    "custom",
+    "custom element 187"
   },
   {
-    "em_gate_3_gray_open",
-    "gate",
-    "gray door (EM style, green key)"
+    "custom_188",
+    "custom",
+    "custom element 188"
   },
   {
-    "em_gate_4_gray_open",
-    "gate",
-    "gray door (EM style, blue key)"
+    "custom_189",
+    "custom",
+    "custom element 189"
+  },
+  {
+    "custom_190",
+    "custom",
+    "custom element 190"
+  },
+  {
+    "custom_191",
+    "custom",
+    "custom element 191"
+  },
+  {
+    "custom_192",
+    "custom",
+    "custom element 192"
+  },
+  {
+    "custom_193",
+    "custom",
+    "custom element 193"
+  },
+  {
+    "custom_194",
+    "custom",
+    "custom element 194"
+  },
+  {
+    "custom_195",
+    "custom",
+    "custom element 195"
+  },
+  {
+    "custom_196",
+    "custom",
+    "custom element 196"
+  },
+  {
+    "custom_197",
+    "custom",
+    "custom element 197"
+  },
+  {
+    "custom_198",
+    "custom",
+    "custom element 198"
+  },
+  {
+    "custom_199",
+    "custom",
+    "custom element 199"
+  },
+  {
+    "custom_200",
+    "custom",
+    "custom element 200"
+  },
+  {
+    "custom_201",
+    "custom",
+    "custom element 201"
+  },
+  {
+    "custom_202",
+    "custom",
+    "custom element 202"
+  },
+  {
+    "custom_203",
+    "custom",
+    "custom element 203"
+  },
+  {
+    "custom_204",
+    "custom",
+    "custom element 204"
+  },
+  {
+    "custom_205",
+    "custom",
+    "custom element 205"
+  },
+  {
+    "custom_206",
+    "custom",
+    "custom element 206"
+  },
+  {
+    "custom_207",
+    "custom",
+    "custom element 207"
+  },
+  {
+    "custom_208",
+    "custom",
+    "custom element 208"
+  },
+  {
+    "custom_209",
+    "custom",
+    "custom element 209"
+  },
+  {
+    "custom_210",
+    "custom",
+    "custom element 210"
+  },
+  {
+    "custom_211",
+    "custom",
+    "custom element 211"
+  },
+  {
+    "custom_212",
+    "custom",
+    "custom element 212"
+  },
+  {
+    "custom_213",
+    "custom",
+    "custom element 213"
+  },
+  {
+    "custom_214",
+    "custom",
+    "custom element 214"
+  },
+  {
+    "custom_215",
+    "custom",
+    "custom element 215"
+  },
+  {
+    "custom_216",
+    "custom",
+    "custom element 216"
+  },
+  {
+    "custom_217",
+    "custom",
+    "custom element 217"
+  },
+  {
+    "custom_218",
+    "custom",
+    "custom element 218"
+  },
+  {
+    "custom_219",
+    "custom",
+    "custom element 219"
+  },
+  {
+    "custom_220",
+    "custom",
+    "custom element 220"
+  },
+  {
+    "custom_221",
+    "custom",
+    "custom element 221"
+  },
+  {
+    "custom_222",
+    "custom",
+    "custom element 222"
+  },
+  {
+    "custom_223",
+    "custom",
+    "custom element 223"
+  },
+  {
+    "custom_224",
+    "custom",
+    "custom element 224"
+  },
+  {
+    "custom_225",
+    "custom",
+    "custom element 225"
+  },
+  {
+    "custom_226",
+    "custom",
+    "custom element 226"
+  },
+  {
+    "custom_227",
+    "custom",
+    "custom element 227"
+  },
+  {
+    "custom_228",
+    "custom",
+    "custom element 228"
+  },
+  {
+    "custom_229",
+    "custom",
+    "custom element 229"
+  },
+  {
+    "custom_230",
+    "custom",
+    "custom element 230"
+  },
+  {
+    "custom_231",
+    "custom",
+    "custom element 231"
+  },
+  {
+    "custom_232",
+    "custom",
+    "custom element 232"
+  },
+  {
+    "custom_233",
+    "custom",
+    "custom element 233"
+  },
+  {
+    "custom_234",
+    "custom",
+    "custom element 234"
+  },
+  {
+    "custom_235",
+    "custom",
+    "custom element 235"
+  },
+  {
+    "custom_236",
+    "custom",
+    "custom element 236"
+  },
+  {
+    "custom_237",
+    "custom",
+    "custom element 237"
+  },
+  {
+    "custom_238",
+    "custom",
+    "custom element 238"
+  },
+  {
+    "custom_239",
+    "custom",
+    "custom element 239"
+  },
+  {
+    "custom_240",
+    "custom",
+    "custom element 240"
+  },
+  {
+    "custom_241",
+    "custom",
+    "custom element 241"
+  },
+  {
+    "custom_242",
+    "custom",
+    "custom element 242"
+  },
+  {
+    "custom_243",
+    "custom",
+    "custom element 243"
+  },
+  {
+    "custom_244",
+    "custom",
+    "custom element 244"
+  },
+  {
+    "custom_245",
+    "custom",
+    "custom element 245"
+  },
+  {
+    "custom_246",
+    "custom",
+    "custom element 246"
+  },
+  {
+    "custom_247",
+    "custom",
+    "custom element 247"
+  },
+  {
+    "custom_248",
+    "custom",
+    "custom element 248"
+  },
+  {
+    "custom_249",
+    "custom",
+    "custom element 249"
+  },
+  {
+    "custom_250",
+    "custom",
+    "custom element 250"
+  },
+  {
+    "custom_251",
+    "custom",
+    "custom element 251"
+  },
+  {
+    "custom_252",
+    "custom",
+    "custom element 252"
+  },
+  {
+    "custom_253",
+    "custom",
+    "custom element 253"
+  },
+  {
+    "custom_254",
+    "custom",
+    "custom element 254"
+  },
+  {
+    "custom_255",
+    "custom",
+    "custom element 255"
+  },
+  {
+    "custom_256",
+    "custom",
+    "custom element 256"
+  },
+  {
+    "em_key_1",
+    "key",
+    "red key (EM style)"
+    },
+  {
+    "em_key_2",
+    "key",
+    "yellow key (EM style)"
+    },
+  {
+    "em_key_3",
+    "key",
+    "green key (EM style)"
+  },
+  {
+    "em_key_4",
+    "key",
+    "blue key (EM style)"
+  },
+  {
+    "envelope_1",
+    "envelope",
+    "mail envelope 1"
+  },
+  {
+    "envelope_2",
+    "envelope",
+    "mail envelope 2"
+  },
+  {
+    "envelope_3",
+    "envelope",
+    "mail envelope 3"
+  },
+  {
+    "envelope_4",
+    "envelope",
+    "mail envelope 4"
+  },
+
+  /* ----------------------------------------------------------------------- */
+  /* "real" (and therefore drawable) runtime elements                        */
+  /* ----------------------------------------------------------------------- */
+
+  {
+    "dynabomb_player_1_active",
+    "dynabomb",
+    "-"
+  },
+  {
+    "dynabomb_player_2_active",
+    "dynabomb",
+    "-"
+  },
+  {
+    "dynabomb_player_3_active",
+    "dynabomb",
+    "-"
+  },
+  {
+    "dynabomb_player_4_active",
+    "dynabomb",
+    "-"
+  },
+  {
+    "sp_disk_red_active",
+    "dynamite",
+    "-"
+  },
+  {
+    "switchgate_opening",
+    "switchgate",
+    "-"
+  },
+  {
+    "switchgate_closing",
+    "switchgate",
+    "-"
+  },
+  {
+    "timegate_opening",
+    "timegate",
+    "-"
+  },
+  {
+    "timegate_closing",
+    "timegate",
+    "-"
+  },
+  {
+    "pearl_breaking",
+    "pearl",
+    "-"
+  },
+  {
+    "trap_active",
+    "trap",
+    "-"
+  },
+  {
+    "invisible_steelwall_active",
+    "wall",
+    "-"
+  },
+  {
+    "invisible_wall_active",
+    "wall",
+    "-"
+  },
+  {
+    "invisible_sand_active",
+    "sand",
+    "-"
+  },
+  {
+    "conveyor_belt_1_left_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_1_middle_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_1_right_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_2_left_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_2_middle_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_2_right_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_3_left_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_3_middle_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_3_right_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_4_left_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_4_middle_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "conveyor_belt_4_right_active",
+    "conveyor_belt",
+    "-"
+  },
+  {
+    "exit_opening",
+    "exit",
+    "-"
+  },
+  {
+    "exit_closing",
+    "exit",
+    "-"
+  },
+  {
+    "sp_exit_open",
+    "sp_exit",
+    "-"
+  },
+  {
+    "sp_terminal_active",
+    "sp_terminal",
+    "-"
+  },
+  {
+    "sp_buggy_base_activating",
+    "sp_buggy_base",
+    "-"
+  },
+  {
+    "sp_buggy_base_active",
+    "sp_buggy_base",
+    "-"
+  },
+  {
+    "sp_murphy_clone",
+    "murphy_clone",
+    "-"
+  },
+  {
+    "amoeba_dropping",
+    "amoeba",
+    "-"
+  },
+  {
+    "quicksand_emptying",
+    "quicksand",
+    "-"
+  },
+  {
+    "magic_wall_active",
+    "magic_wall",
+    "-"
+  },
+  {
+    "bd_magic_wall_active",
+    "magic_wall",
+    "-"
+  },
+  {
+    "magic_wall_full",
+    "magic_wall",
+    "-"
+  },
+  {
+    "bd_magic_wall_full",
+    "magic_wall",
+    "-"
+  },
+  {
+    "magic_wall_emptying",
+    "magic_wall",
+    "-"
+  },
+  {
+    "bd_magic_wall_emptying",
+    "magic_wall",
+    "-"
+  },
+  {
+    "magic_wall_dead",
+    "magic_wall",
+    "-"
+  },
+  {
+    "bd_magic_wall_dead",
+    "magic_wall",
+    "-"
   },
 
   /* ----------------------------------------------------------------------- */
@@ -2877,6 +3464,11 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-",
     "-"
   },
+  {
+    "diamond_breaking",
+    "-",
+    "-"
+  },
   {
     "acid_splash_left",
     "-",
@@ -2993,7 +3585,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "sand_crumbled",
+    "dynabomb",
     "-",
     "-"
   },
@@ -3002,6 +3594,26 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-",
     "-"
   },
+  {
+    "dynabomb_player_1",
+    "-",
+    "-"
+  },
+  {
+    "dynabomb_player_2",
+    "-",
+    "-"
+  },
+  {
+    "dynabomb_player_3",
+    "-",
+    "-"
+  },
+  {
+    "dynabomb_player_4",
+    "-",
+    "-"
+  },
   {
     "shield_normal_active",
     "-",
@@ -3012,6 +3624,26 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-",
     "-"
   },
+  {
+    "[default]",
+    "default",
+    "-"
+  },
+  {
+    "[bd_default]",
+    "bd_default",
+    "-"
+  },
+  {
+    "[sp_default]",
+    "sp_default",
+    "-"
+  },
+  {
+    "[sb_default]",
+    "sb_default",
+    "-"
+  },
 
   /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
 
@@ -3027,7 +3659,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
 /* element action and direction definitions                                  */
 /* ------------------------------------------------------------------------- */
 
-struct ElementActionInfo element_action_info[NUM_ACTIONS + 1] =
+struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
 {
   { ".[DEFAULT]",      ACTION_DEFAULT,         TRUE    },
   { ".waiting",                ACTION_WAITING,         TRUE    },
@@ -3038,6 +3670,7 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1] =
   { ".collecting",     ACTION_COLLECTING,      FALSE   },
   { ".dropping",       ACTION_DROPPING,        FALSE   },
   { ".pushing",                ACTION_PUSHING,         FALSE   },
+  { ".walking",                ACTION_WALKING,         FALSE   },
   { ".passing",                ACTION_PASSING,         FALSE   },
   { ".impact",         ACTION_IMPACT,          FALSE   },
   { ".breaking",       ACTION_BREAKING,        FALSE   },
@@ -3056,6 +3689,9 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1] =
   { ".dying",          ACTION_DYING,           FALSE   },
   { ".other",          ACTION_OTHER,           FALSE   },
 
+  /* empty suffix always matches -- check as last entry in InitSoundInfo() */
+  { "",                        ACTION_DEFAULT,         TRUE    },
+
   { NULL,              0,                      0       }
 };
 
@@ -3071,22 +3707,63 @@ struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
 
 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
 {
-  { ".MAIN",           0,                              },
-  { ".LEVELS",         0,                              },
-  { ".SCORES",         0,                              },
-  { ".EDITOR",         0,                              },
-  { ".INFO",           0,                              },
-  { ".SETUP",          0,                              },
-  { ".DOOR",           0,                              },
-  { ".PREVIEW",                0,                              },
+  { ".MAIN",           GAME_MODE_MAIN,                 },
+  { ".LEVELS",         GAME_MODE_LEVELS                },
+  { ".SCORES",         GAME_MODE_SCORES,               },
+  { ".EDITOR",         GAME_MODE_EDITOR,               },
+  { ".INFO",           GAME_MODE_INFO,                 },
+  { ".SETUP",          GAME_MODE_SETUP,                },
+  { ".PLAYING",                GAME_MODE_PLAYING,              },
+  { ".DOOR",           GAME_MODE_PSEUDO_DOOR,          },
+  { ".PREVIEW",                GAME_MODE_PSEUDO_PREVIEW,       },
+  { ".CRUMBLED",       GAME_MODE_PSEUDO_CRUMBLED,      },
 
   { NULL,              0,                              }
 };
 
+struct TokenIntPtrInfo image_config_vars[] =
+{
+  { "global.num_toons",                &global.num_toons                          },
+
+  { "menu.draw_xoffset",       &menu.draw_xoffset_default                 },
+  { "menu.draw_yoffset",       &menu.draw_yoffset_default                 },
+  { "menu.draw_xoffset.MAIN",  &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN]   },
+  { "menu.draw_yoffset.MAIN",  &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN]   },
+  { "menu.draw_xoffset.LEVELS",        &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
+  { "menu.draw_yoffset.LEVELS",        &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] },
+  { "menu.draw_xoffset.SCORES",        &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] },
+  { "menu.draw_yoffset.SCORES",        &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] },
+  { "menu.draw_xoffset.EDITOR",        &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] },
+  { "menu.draw_yoffset.EDITOR",        &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] },
+  { "menu.draw_xoffset.INFO",  &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO]   },
+  { "menu.draw_yoffset.INFO",  &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO]   },
+  { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP]  },
+  { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP]  },
+
+  { "menu.scrollbar_xoffset",  &menu.scrollbar_xoffset                    },
+
+  { "menu.list_size",          &menu.list_size_default                    },
+  { "menu.list_size.LEVELS",   &menu.list_size[GFX_SPECIAL_ARG_LEVELS]    },
+  { "menu.list_size.SCORES",   &menu.list_size[GFX_SPECIAL_ARG_SCORES]    },
+  { "menu.list_size.INFO",     &menu.list_size[GFX_SPECIAL_ARG_INFO]      },
+
+  { "door.step_offset",                &door.step_offset                          },
+  { "door.step_delay",         &door.step_delay                           },
+  { "door.anim_mode",          &door.anim_mode                            },
+
+  { "game.envelope.anim_mode", &game.envelope.anim_mode                   },
+
+  { NULL,                      NULL,                                      }
+};
+
+
 /* ------------------------------------------------------------------------- */
 /* font definitions                                                          */
 /* ------------------------------------------------------------------------- */
 
+/* Important: When one entry is a prefix of another entry, the longer entry
+   must come first, because the dynamic configuration does prefix matching! */
+
 struct FontInfo font_info[NUM_FONTS + 1] =
 {
   { "font.initial_1"           },
@@ -3097,19 +3774,26 @@ struct FontInfo font_info[NUM_FONTS + 1] =
   { "font.title_2"             },
   { "font.menu_1"              },
   { "font.menu_2"              },
+  { "font.text_1.active"       },
+  { "font.text_2.active"       },
+  { "font.text_3.active"       },
+  { "font.text_4.active"       },
   { "font.text_1"              },
   { "font.text_2"              },
   { "font.text_3"              },
   { "font.text_4"              },
-  { "font.input"               },
-  { "font.input.active"                },
+  { "font.input_1.active"      },
+  { "font.input_2.active"      },
+  { "font.input_1"             },
+  { "font.input_2"             },
   { "font.option_off"          },
   { "font.option_on"           },
   { "font.value_1"             },
   { "font.value_2"             },
   { "font.value_old"           },
-  { "font.tape_recorder"       },
   { "font.level_number"                },
+  { "font.tape_recorder"       },
+  { "font.game_info"           },
 };
 
 
@@ -3126,7 +3810,7 @@ int main(int argc, char *argv[])
                  COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL);
 
   InitExitFunction(CloseAllAndExit);
-  InitPlatformDependantStuff();
+  InitPlatformDependentStuff();
 
   GetOptions(argv);
   OpenAll();