rnd-20060816-2-src
[rocksndiamonds.git] / src / main.c
index ba7ab867873f6620715e4bf35ebbdc3812b11520..f09dbd62a22d7c8e4ee033673a64d207bd7f33ff 100644 (file)
 #include "main.h"
 #include "init.h"
 #include "game.h"
+#include "tape.h"
 #include "events.h"
 #include "config.h"
 
-#if 0
-GC                     tile_clip_gc;
-Bitmap                *pix[NUM_BITMAPS];
-#endif
-Bitmap                *bitmap_db_field, *bitmap_db_door;
-#if 0
-Pixmap                 tile_clipmask[NUM_TILES];
-#endif
+Bitmap                *bitmap_db_cross;
+Bitmap                *bitmap_db_field;
+Bitmap                *bitmap_db_panel;
+Bitmap                *bitmap_db_door;
 DrawBuffer            *fieldbuffer;
 DrawBuffer            *drawto_field;
 
@@ -34,6 +31,11 @@ int                  game_status = -1;
 boolean                        level_editor_test_game = FALSE;
 boolean                        network_playing = FALSE;
 
+#if defined(TARGET_SDL)
+boolean                        network_server = FALSE;
+SDL_Thread            *server_thread;
+#endif
+
 int                    key_joystick_mapping = 0;
 
 boolean                        redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
@@ -44,33 +46,44 @@ 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                  ChangePage[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  CustomValue[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];
-boolean                        Changing[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-short                  JustStopped[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ChangeCount[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaCnt[MAX_NUM_AMOEBA];
 short                  AmoebaCnt2[MAX_NUM_AMOEBA];
-short                  ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int                    RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int                    PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
+#if 0
 unsigned long          Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS];
+#endif
 
 int                    GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-int                    GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int                    GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int                    GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 
 int                    lev_fieldx, lev_fieldy;
 int                    scroll_x, scroll_y;
 
 int                    FX = SX, FY = SY;
 int                    ScrollStepSize;
-int                    ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
+int                    ScreenMovDir = MV_NONE, ScreenMovPos = 0;
 int                    ScreenGfxPos = 0;
 int                    BorderElement = EL_STEELWALL;
 int                    GameFrameDelay = GAME_FRAME_DELAY;
@@ -83,10 +96,11 @@ int                 ZX, ZY;
 int                    ExitX, ExitY;
 int                    AllPlayersGone;
 
-int                    TimeFrames, TimePlayed, TimeLeft;
+int                    TimeFrames, TimePlayed, TimeLeft, TapeTime;
 
 boolean                        network_player_action_received = FALSE;
 
+struct LevelSetInfo    levelset;
 struct LevelInfo       level, level_template;
 struct PlayerInfo      stored_player[MAX_PLAYERS], *local_player = NULL;
 struct HiScore         highscore[MAX_SCORE_ENTRIES];
@@ -95,16 +109,24 @@ struct SetupInfo   setup;
 struct GameInfo                game;
 struct GlobalInfo      global;
 struct MenuInfo                menu;
-struct DoorInfo                door;
+struct DoorInfo                door_1, door_2;
+struct PreviewInfo     preview;
 struct GraphicInfo     *graphic_info = NULL;
 struct SoundInfo       *sound_info = NULL;
+struct MusicInfo       *music_info = NULL;
+struct MusicFileInfo   *music_file_info = NULL;
+struct HelpAnimInfo    *helpanim_info = NULL;
+SetupFileHash          *helptext_info = NULL;
 
 
 /* ------------------------------------------------------------------------- */
 /* element definitions                                                       */
 /* ------------------------------------------------------------------------- */
 
-struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
+struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1];
+
+/* this contains predefined structure elements to initialize "element_info" */
+struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
 {
   /* keyword to start parser: "ELEMENT_INFO_START" <-- do not change! */
 
@@ -139,8 +161,8 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "key_obsolete",
-    "key",
-    "key"
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
     "emerald",
@@ -154,23 +176,23 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "player_obsolete",
-    "player",
-    "player"
+    "obsolete",
+    "player (OBSOLETE)"
   },
   {
     "bug",
     "bug",
-    "bug"
+    "bug (random start direction)"
   },
   {
     "spaceship",
     "spaceship",
-    "spaceship"
+    "spaceship (random start direction)"
   },
   {
     "yamyam",
     "yamyam",
-    "yam yam"
+    "yam yam (random start direction)"
   },
   {
     "robot",
@@ -179,7 +201,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "steelwall",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
@@ -230,7 +252,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "amoeba_wet",
     "amoeba",
-    "dropping amoeba"
+    "dropping amoeba (EM style)"
   },
   {
     "amoeba_dry",
@@ -253,7 +275,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "biomaze"
   },
   {
-    "dynamite_active",
+    "dynamite.active",
     "dynamite",
     "burning dynamite"
   },
@@ -268,67 +290,70 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "magic wheel"
   },
   {
-    "robot_wheel_active",
+    "robot_wheel.active",
     "robot_wheel",
     "magic wheel (running)"
   },
   {
     "key_1",
     "key",
-    "red key"
+    "key 1"
   },
   {
     "key_2",
     "key",
-    "yellow key"
+    "key 2"
   },
   {
     "key_3",
     "key",
-    "green key"
+    "key 3"
   },
   {
     "key_4",
     "key",
-    "blue key"
+    "key 4"
   },
   {
     "gate_1",
     "gate",
-    "red door"
+    "door 1"
   },
   {
     "gate_2",
     "gate",
-    "yellow door"
+    "door 2"
   },
   {
     "gate_3",
     "gate",
-    "green door"
+    "door 3"
   },
   {
     "gate_4",
     "gate",
-    "blue door"
+    "door 4"
   },
   {
     "gate_1_gray",
     "gate",
-    "gray door (opened by red key)"
+    "gray door (opened by key 1)"
   },
   {
     "gate_2_gray",
     "gate",
-    "gray door (opened by yellow key)"},
+    "gray door (opened by key 2)"
+  },
   {
     "gate_3_gray",
     "gate",
-    "gray door (opened by green key)"},
+    "gray door (opened by key 3)"
+  },
   {
     "gate_4_gray",
     "gate",
-    "gray door (opened by blue key)"},
+    "gray door (opened by key 4)"
+  },
   {
     "dynamite",
     "dynamite",
@@ -337,7 +362,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "pacman",
     "pacman",
-    "pac man"
+    "pac man (random start direction)"
   },
   {
     "invisible_wall",
@@ -350,7 +375,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "lamp (off)"
   },
   {
-    "lamp_active",
+    "lamp.active",
     "lamp",
     "lamp (on)"
   },
@@ -387,7 +412,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "expandable_wall",
     "wall",
-    "growing wall"
+    "growing wall (horizontal, visible)"
   },
   {
     "bd_diamond",
@@ -421,13 +446,13 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "invisible_steelwall",
-    "wall",
+    "steelwall",
     "invisible steel wall"
   },
   {
-    "unused_63",
-    "unused",
-    "(not used)"
+    "sokoban_field_player",
+    "sokoban",
+    "sokoban field with player"
   },
   {
     "dynabomb_increase_number",
@@ -460,126 +485,126 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "sokoban field with object"
   },
   {
-    "bd_butterfly_right",
+    "bd_butterfly.right",
     "bd_butterfly",
     "butterfly (starts moving right)"},
   {
-    "bd_butterfly_up",
+    "bd_butterfly.up",
     "bd_butterfly",
     "butterfly (starts moving up)"
   },
   {
-    "bd_butterfly_left",
+    "bd_butterfly.left",
     "bd_butterfly",
     "butterfly (starts moving left)"},
   {
-    "bd_butterfly_down",
+    "bd_butterfly.down",
     "bd_butterfly",
     "butterfly (starts moving down)"},
   {
-    "bd_firefly_right",
+    "bd_firefly.right",
     "bd_firefly",
     "firefly (starts moving right)"
   },
   {
-    "bd_firefly_up",
+    "bd_firefly.up",
     "bd_firefly",
     "firefly (starts moving up)"
   },
   {
-    "bd_firefly_left",
+    "bd_firefly.left",
     "bd_firefly",
     "firefly (starts moving left)"
   },
   {
-    "bd_firefly_down",
+    "bd_firefly.down",
     "bd_firefly",
     "firefly (starts moving down)"
   },
   {
     "bd_butterfly",
     "bd_butterfly",
-    "butterfly"
+    "butterfly (random start direction)"
   },
   {
     "bd_firefly",
     "bd_firefly",
-    "firefly"
+    "firefly (random start direction)"
   },
   {
     "player_1",
     "player",
-    "yellow player"
+    "player 1"
   },
   {
     "player_2",
     "player",
-    "red player"
+    "player 2"
   },
   {
     "player_3",
     "player",
-    "green player"
+    "player 3"
   },
   {
     "player_4",
     "player",
-    "blue player"
+    "player 4"
   },
   {
-    "bug_right",
+    "bug.right",
     "bug",
     "bug (starts moving right)"
   },
   {
-    "bug_up",
+    "bug.up",
     "bug",
     "bug (starts moving up)"
   },
   {
-    "bug_left",
+    "bug.left",
     "bug",
     "bug (starts moving left)"
   },
   {
-    "bug_down",
+    "bug.down",
     "bug",
     "bug (starts moving down)"
   },
   {
-    "spaceship_right",
+    "spaceship.right",
     "spaceship",
     "spaceship (starts moving right)"},
   {
-    "spaceship_up",
+    "spaceship.up",
     "spaceship",
     "spaceship (starts moving up)"
   },
   {
-    "spaceship_left",
+    "spaceship.left",
     "spaceship",
     "spaceship (starts moving left)"},
   {
-    "spaceship_down",
+    "spaceship.down",
     "spaceship",
     "spaceship (starts moving down)"},
   {
-    "pacman_right",
+    "pacman.right",
     "pacman",
     "pac man (starts moving right)"
   },
   {
-    "pacman_up",
+    "pacman.up",
     "pacman",
     "pac man (starts moving up)"
   },
   {
-    "pacman_left",
+    "pacman.left",
     "pacman",
     "pac man (starts moving left)"
   },
   {
-    "pacman_down",
+    "pacman.down",
     "pacman",
     "pac man (starts moving down)"
   },
@@ -646,7 +671,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "black_orb",
     "black_orb",
-    "bomb"
+    "black orb bomb"
   },
   {
     "amoeba_to_diamond",
@@ -656,7 +681,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "mole",
     "mole",
-    "mole"
+    "mole (random start direction)"
   },
   {
     "penguin",
@@ -699,9 +724,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",
@@ -729,7 +754,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "letter '$'"
   },
   {
-    "char_procent",
+    "char_percent",
     "char",
     "letter '%'"
   },
@@ -1121,37 +1146,37 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "em_gate_1",
     "gate",
-    "red door (EM style)"
+    "door 1 (EM style)"
   },
   {
     "em_gate_2",
     "gate",
-    "yellow door (EM style)"
+    "door 2 (EM style)"
   },
   {
     "em_gate_3",
     "gate",
-    "green door (EM style)"
+    "door 3 (EM style)"
   },
   {
     "em_gate_4",
     "gate",
-    "blue door (EM style)"
+    "door 4 (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",
@@ -1356,32 +1381,32 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "em_gate_1_gray",
     "gate",
-    "gray door (EM style, red key)"
+    "gray door (EM style, key 1)"
   },
   {
     "em_gate_2_gray",
     "gate",
-    "gray door (EM style, yellow key)"
+    "gray door (EM style, key 2)"
   },
   {
     "em_gate_3_gray",
     "gate",
-    "gray door (EM style, green key)"
+    "gray door (EM style, key 3)"
   },
   {
     "em_gate_4_gray",
     "gate",
-    "gray door (EM style, blue key)"
+    "gray door (EM style, key 4)"
   },
   {
-    "unused_254",
-    "unused",
-    "(not used)"
+    "em_dynamite",
+    "dynamite",
+    "dynamite (EM style)"
   },
   {
-    "unused_255",
-    "unused",
-    "(not used)"
+    "em_dynamite.active",
+    "dynamite",
+    "burning dynamite (EM style)"
   },
   {
     "pearl",
@@ -1461,122 +1486,122 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "conveyor_belt_1_left",
     "conveyor_belt",
-    "red conveyor belt (left)"
+    "conveyor belt 1 (left)"
   },
   {
     "conveyor_belt_1_middle",
     "conveyor_belt",
-    "red conveyor belt (middle)"
+    "conveyor belt 1 (middle)"
   },
   {
     "conveyor_belt_1_right",
     "conveyor_belt",
-    "red conveyor belt (right)"
+    "conveyor belt 1 (right)"
   },
   {
     "conveyor_belt_1_switch_left",
     "conveyor_belt_switch",
-    "switch for red conveyor belt (left)"
+    "switch for conveyor belt 1 (left)"
   },
   {
     "conveyor_belt_1_switch_middle",
     "conveyor_belt_switch",
-    "switch for red conveyor belt (middle)"
+    "switch for conveyor belt 1 (middle)"
   },
   {
     "conveyor_belt_1_switch_right",
     "conveyor_belt_switch",
-    "switch for red conveyor belt (right)"
+    "switch for conveyor belt 1 (right)"
   },
   {
     "conveyor_belt_2_left",
     "conveyor_belt",
-    "yellow conveyor belt (left)"
+    "conveyor belt 2 (left)"
   },
   {
     "conveyor_belt_2_middle",
     "conveyor_belt",
-    "yellow conveyor belt (middle)"
+    "conveyor belt 2 (middle)"
   },
   {
     "conveyor_belt_2_right",
     "conveyor_belt",
-    "yellow conveyor belt (right)"
+    "conveyor belt 2 (right)"
   },
   {
     "conveyor_belt_2_switch_left",
     "conveyor_belt_switch",
-    "switch for yellow conveyor belt (left)"
+    "switch for conveyor belt 2 (left)"
   },
   {
     "conveyor_belt_2_switch_middle",
     "conveyor_belt_switch",
-    "switch for yellow conveyor belt (middle)"
+    "switch for conveyor belt 2 (middle)"
   },
   {
     "conveyor_belt_2_switch_right",
     "conveyor_belt_switch",
-    "switch for yellow conveyor belt (right)"
+    "switch for conveyor belt 2 (right)"
   },
   {
     "conveyor_belt_3_left",
     "conveyor_belt",
-    "green conveyor belt (left)"
+    "conveyor belt 3 (left)"
   },
   {
     "conveyor_belt_3_middle",
     "conveyor_belt",
-    "green conveyor belt (middle)"
+    "conveyor belt 3 (middle)"
   },
   {
     "conveyor_belt_3_right",
     "conveyor_belt",
-    "green conveyor belt (right)"
+    "conveyor belt 3 (right)"
   },
   {
     "conveyor_belt_3_switch_left",
     "conveyor_belt_switch",
-    "switch for green conveyor belt (left)"
+    "switch for conveyor belt 3 (left)"
   },
   {
     "conveyor_belt_3_switch_middle",
     "conveyor_belt_switch",
-    "switch for green conveyor belt (middle)"
+    "switch for conveyor belt 3 (middle)"
   },
   {
     "conveyor_belt_3_switch_right",
     "conveyor_belt_switch",
-    "switch for green conveyor belt (right)"
+    "switch for conveyor belt 3 (right)"
   },
   {
     "conveyor_belt_4_left",
     "conveyor_belt",
-    "blue conveyor belt (left)"
+    "conveyor belt 4 (left)"
   },
   {
     "conveyor_belt_4_middle",
     "conveyor_belt",
-    "blue conveyor belt (middle)"
+    "conveyor belt 4 (middle)"
   },
   {
     "conveyor_belt_4_right",
     "conveyor_belt",
-    "blue conveyor belt (right)"
+    "conveyor belt 4 (right)"
   },
   {
     "conveyor_belt_4_switch_left",
     "conveyor_belt_switch",
-    "switch for blue conveyor belt (left)"
+    "switch for conveyor belt 4 (left)"
   },
   {
     "conveyor_belt_4_switch_middle",
     "conveyor_belt_switch",
-    "switch for blue conveyor belt (middle)"
+    "switch for conveyor belt 4 (middle)"
   },
   {
     "conveyor_belt_4_switch_right",
     "conveyor_belt_switch",
-    "switch for blue conveyor belt (right)"
+    "switch for conveyor belt 4 (right)"
   },
   {
     "landmine",
@@ -1584,9 +1609,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "land mine"
   },
   {
-    "envelope",
-    "envelope",
-    "mail envelope"
+    "envelope_obsolete",
+    "obsolete",
+    "envelope (OBSOLETE)"
   },
   {
     "light_switch",
@@ -1594,7 +1619,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "light switch (off)"
   },
   {
-    "light_switch_active",
+    "light_switch.active",
     "light_switch",
     "light switch (on)"
   },
@@ -1659,28 +1684,28 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "sign (other)"
   },
   {
-    "mole_left",
+    "mole.left",
     "mole",
     "mole (starts moving left)"
   },
   {
-    "mole_right",
+    "mole.right",
     "mole",
     "mole (starts moving right)"
   },
   {
-    "mole_up",
+    "mole.up",
     "mole",
     "mole (starts moving up)"
   },
   {
-    "mole_down",
+    "mole.down",
     "mole",
     "mole (starts moving down)"
   },
   {
     "steelwall_slippery",
-    "wall",
+    "steelwall",
     "slippery steel wall"
   },
   {
@@ -1724,7 +1749,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "time gate (closed)"
   },
   {
-    "timegate_switch_active",
+    "timegate_switch.active",
     "timegate_switch",
     "switch for time gate"
   },
@@ -1741,46 +1766,46 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "balloon_switch_left",
     "balloon_switch",
-    "send balloon to the left"
+    "wind switch (left)"
   },
   {
     "balloon_switch_right",
     "balloon_switch",
-    "send balloon to the right"
+    "wind switch (right)"
   },
   {
     "balloon_switch_up",
     "balloon_switch",
-    "send balloon up"
+    "wind switch (up)"
   },
   {
     "balloon_switch_down",
     "balloon_switch",
-    "send balloon down"
+    "wind switch (down)"
   },
   {
     "balloon_switch_any",
     "balloon_switch",
-    "send balloon in any direction"
+    "wind switch (any direction)"
   },
   {
     "emc_steelwall_1",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
     "emc_steelwall_2",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
     "emc_steelwall_3",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
     "emc_steelwall_4",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
@@ -2543,314 +2568,1640 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "custom",
     "custom element 128"
   },
-
-  /* ----------------------------------------------------------------------- */
-  /* "real" (and therefore drawable) runtime elements                        */
-  /* ----------------------------------------------------------------------- */
-
   {
-    "em_key_1",
-    "key",
-    "-"
-    },
+    "custom_129",
+    "custom",
+    "custom element 129"
+  },
   {
-    "em_key_2",
-    "key",
-    "-"
-    },
+    "custom_130",
+    "custom",
+    "custom element 130"
+  },
   {
-    "em_key_3",
-    "key",
-    "-"
+    "custom_131",
+    "custom",
+    "custom element 131"
   },
   {
-    "em_key_4",
-    "key",
-    "-"
+    "custom_132",
+    "custom",
+    "custom element 132"
   },
   {
-    "dynabomb_player_1_active",
-    "dynabomb",
-    "-"
+    "custom_133",
+    "custom",
+    "custom element 133"
   },
   {
-    "dynabomb_player_2_active",
-    "dynabomb",
-    "-"
+    "custom_134",
+    "custom",
+    "custom element 134"
   },
   {
-    "dynabomb_player_3_active",
-    "dynabomb",
-    "-"
+    "custom_135",
+    "custom",
+    "custom element 135"
   },
   {
-    "dynabomb_player_4_active",
-    "dynabomb",
-    "-"
+    "custom_136",
+    "custom",
+    "custom element 136"
   },
   {
-    "sp_disk_red_active",
-    "dynamite",
-    "-"
+    "custom_137",
+    "custom",
+    "custom element 137"
   },
   {
-    "switchgate_opening",
-    "switchgate",
-    "-"
+    "custom_138",
+    "custom",
+    "custom element 138"
   },
   {
-    "switchgate_closing",
-    "switchgate",
-    "-"
+    "custom_139",
+    "custom",
+    "custom element 139"
   },
   {
-    "timegate_opening",
-    "timegate",
-    "-"
+    "custom_140",
+    "custom",
+    "custom element 140"
   },
   {
-    "timegate_closing",
-    "timegate",
-    "-"
+    "custom_141",
+    "custom",
+    "custom element 141"
   },
   {
-    "pearl_breaking",
-    "pearl",
-    "-"
+    "custom_142",
+    "custom",
+    "custom element 142"
   },
   {
-    "trap_active",
-    "trap",
-    "-"
+    "custom_143",
+    "custom",
+    "custom element 143"
   },
   {
-    "invisible_steelwall_active",
-    "wall",
-    "-"
+    "custom_144",
+    "custom",
+    "custom element 144"
   },
   {
-    "invisible_wall_active",
-    "wall",
-    "-"
+    "custom_145",
+    "custom",
+    "custom element 145"
   },
   {
-    "invisible_sand_active",
-    "sand",
-    "-"
+    "custom_146",
+    "custom",
+    "custom element 146"
   },
   {
-    "conveyor_belt_1_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_147",
+    "custom",
+    "custom element 147"
   },
   {
-    "conveyor_belt_1_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_148",
+    "custom",
+    "custom element 148"
   },
   {
-    "conveyor_belt_1_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_149",
+    "custom",
+    "custom element 149"
   },
   {
-    "conveyor_belt_2_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_150",
+    "custom",
+    "custom element 150"
   },
   {
-    "conveyor_belt_2_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_151",
+    "custom",
+    "custom element 151"
   },
   {
-    "conveyor_belt_2_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_152",
+    "custom",
+    "custom element 152"
   },
   {
-    "conveyor_belt_3_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_153",
+    "custom",
+    "custom element 153"
   },
   {
-    "conveyor_belt_3_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_154",
+    "custom",
+    "custom element 154"
   },
   {
-    "conveyor_belt_3_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_155",
+    "custom",
+    "custom element 155"
   },
   {
-    "conveyor_belt_4_left_active",
-    "conveyor_belt",
-    "-"
+    "custom_156",
+    "custom",
+    "custom element 156"
   },
   {
-    "conveyor_belt_4_middle_active",
-    "conveyor_belt",
-    "-"
+    "custom_157",
+    "custom",
+    "custom element 157"
   },
   {
-    "conveyor_belt_4_right_active",
-    "conveyor_belt",
-    "-"
+    "custom_158",
+    "custom",
+    "custom element 158"
   },
   {
-    "exit_opening",
-    "exit",
-    "-"
+    "custom_159",
+    "custom",
+    "custom element 159"
   },
   {
-    "sp_exit_open",
-    "sp_exit",
-    "-"
+    "custom_160",
+    "custom",
+    "custom element 160"
   },
   {
-    "sp_terminal_active",
-    "sp_terminal",
-    "-"
+    "custom_161",
+    "custom",
+    "custom element 161"
   },
   {
-    "sp_buggy_base_activating",
-    "sp_buggy_base",
-    "-"
+    "custom_162",
+    "custom",
+    "custom element 162"
   },
   {
-    "sp_buggy_base_active",
-    "sp_buggy_base",
-    "-"
+    "custom_163",
+    "custom",
+    "custom element 163"
   },
   {
-    "sp_murphy_clone",
-    "murphy_clone",
-    "-"
+    "custom_164",
+    "custom",
+    "custom element 164"
   },
   {
-    "amoeba_dropping",
-    "amoeba",
-    "-"
+    "custom_165",
+    "custom",
+    "custom element 165"
   },
   {
-    "quicksand_emptying",
-    "quicksand",
-    "-"
+    "custom_166",
+    "custom",
+    "custom element 166"
   },
   {
-    "magic_wall_active",
-    "magic_wall",
-    "-"
+    "custom_167",
+    "custom",
+    "custom element 167"
   },
   {
-    "bd_magic_wall_active",
-    "magic_wall",
-    "-"
+    "custom_168",
+    "custom",
+    "custom element 168"
   },
   {
-    "magic_wall_full",
-    "magic_wall",
-    "-"
+    "custom_169",
+    "custom",
+    "custom element 169"
   },
   {
-    "bd_magic_wall_full",
-    "magic_wall",
-    "-"
+    "custom_170",
+    "custom",
+    "custom element 170"
   },
   {
-    "magic_wall_emptying",
-    "magic_wall",
-    "-"
+    "custom_171",
+    "custom",
+    "custom element 171"
   },
   {
-    "bd_magic_wall_emptying",
-    "magic_wall",
-    "-"
+    "custom_172",
+    "custom",
+    "custom element 172"
   },
   {
-    "magic_wall_dead",
-    "magic_wall",
-    "-"
+    "custom_173",
+    "custom",
+    "custom element 173"
   },
   {
-    "bd_magic_wall_dead",
-    "magic_wall",
-    "-"
+    "custom_174",
+    "custom",
+    "custom element 174"
   },
-
-  /* ----------------------------------------------------------------------- */
-  /* "unreal" (and therefore not drawable) runtime elements                  */
-  /* ----------------------------------------------------------------------- */
-
   {
-    "blocked",
-    "-",
-    "-"
+    "custom_175",
+    "custom",
+    "custom element 175"
   },
   {
-    "explosion",
-    "-",
-    "-"
+    "custom_176",
+    "custom",
+    "custom element 176"
   },
   {
-    "nut_breaking",
-    "-",
-    "-"
+    "custom_177",
+    "custom",
+    "custom element 177"
   },
   {
-    "diamond_breaking",
-    "-",
-    "-"
+    "custom_178",
+    "custom",
+    "custom element 178"
   },
   {
-    "acid_splash_left",
-    "-",
-    "-"
+    "custom_179",
+    "custom",
+    "custom element 179"
   },
   {
-    "acid_splash_right",
-    "-",
-    "-"
+    "custom_180",
+    "custom",
+    "custom element 180"
   },
   {
-    "amoeba_growing",
-    "-",
-    "-"
+    "custom_181",
+    "custom",
+    "custom element 181"
   },
   {
-    "amoeba_shrinking",
-    "-",
-    "-"
+    "custom_182",
+    "custom",
+    "custom element 182"
   },
   {
-    "expandable_wall_growing",
-    "-",
-    "-"
+    "custom_183",
+    "custom",
+    "custom element 183"
   },
   {
-    "flames",
-    "-",
-    "-"
+    "custom_184",
+    "custom",
+    "custom element 184"
   },
   {
-    "player_is_leaving",
-    "-",
-    "-"
+    "custom_185",
+    "custom",
+    "custom element 185"
   },
   {
-    "quicksand_filling",
-    "quicksand",
-    "-"
+    "custom_186",
+    "custom",
+    "custom element 186"
   },
   {
-    "magic_wall_filling",
-    "-",
-    "-"
+    "custom_187",
+    "custom",
+    "custom element 187"
   },
   {
-    "bd_magic_wall_filling",
-    "-",
+    "custom_188",
+    "custom",
+    "custom element 188"
+  },
+  {
+    "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",
+    "key 1 (EM style)"
+    },
+  {
+    "em_key_2",
+    "key",
+    "key 2 (EM style)"
+    },
+  {
+    "em_key_3",
+    "key",
+    "key 3 (EM style)"
+  },
+  {
+    "em_key_4",
+    "key",
+    "key 4 (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"
+  },
+  {
+    "group_1",
+    "group",
+    "group element 1"
+  },
+  {
+    "group_2",
+    "group",
+    "group element 2"
+  },
+  {
+    "group_3",
+    "group",
+    "group element 3"
+  },
+  {
+    "group_4",
+    "group",
+    "group element 4"
+  },
+  {
+    "group_5",
+    "group",
+    "group element 5"
+  },
+  {
+    "group_6",
+    "group",
+    "group element 6"
+  },
+  {
+    "group_7",
+    "group",
+    "group element 7"
+  },
+  {
+    "group_8",
+    "group",
+    "group element 8"
+  },
+  {
+    "group_9",
+    "group",
+    "group element 9"
+  },
+  {
+    "group_10",
+    "group",
+    "group element 10"
+  },
+  {
+    "group_11",
+    "group",
+    "group element 11"
+  },
+  {
+    "group_12",
+    "group",
+    "group element 12"
+  },
+  {
+    "group_13",
+    "group",
+    "group element 13"
+  },
+  {
+    "group_14",
+    "group",
+    "group element 14"
+  },
+  {
+    "group_15",
+    "group",
+    "group element 15"
+  },
+  {
+    "group_16",
+    "group",
+    "group element 16"
+  },
+  {
+    "group_17",
+    "group",
+    "group element 17"
+  },
+  {
+    "group_18",
+    "group",
+    "group element 18"
+  },
+  {
+    "group_19",
+    "group",
+    "group element 19"
+  },
+  {
+    "group_20",
+    "group",
+    "group element 20"
+  },
+  {
+    "group_21",
+    "group",
+    "group element 21"
+  },
+  {
+    "group_22",
+    "group",
+    "group element 22"
+  },
+  {
+    "group_23",
+    "group",
+    "group element 23"
+  },
+  {
+    "group_24",
+    "group",
+    "group element 24"
+  },
+  {
+    "group_25",
+    "group",
+    "group element 25"
+  },
+  {
+    "group_26",
+    "group",
+    "group element 26"
+  },
+  {
+    "group_27",
+    "group",
+    "group element 27"
+  },
+  {
+    "group_28",
+    "group",
+    "group element 28"
+  },
+  {
+    "group_29",
+    "group",
+    "group element 29"
+  },
+  {
+    "group_30",
+    "group",
+    "group element 30"
+  },
+  {
+    "group_31",
+    "group",
+    "group element 31"
+  },
+  {
+    "group_32",
+    "group",
+    "group element 32"
+  },
+  {
+    "unknown",
+    "unknown",
+    "unknown element"
+  },
+  {
+    "trigger_element",
+    "trigger",
+    "element triggering change"
+  },
+  {
+    "trigger_player",
+    "trigger",
+    "player triggering change"
+  },
+  {
+    "sp_gravity_on_port_right",
+    "sp_port",
+    "gravity on port (leading right)"
+  },
+  {
+    "sp_gravity_on_port_down",
+    "sp_port",
+    "gravity on port (leading down)"
+  },
+  {
+    "sp_gravity_on_port_left",
+    "sp_port",
+    "gravity on port (leading left)"
+  },
+  {
+    "sp_gravity_on_port_up",
+    "sp_port",
+    "gravity on port (leading up)"
+  },
+  {
+    "sp_gravity_off_port_right",
+    "sp_port",
+    "gravity off port (leading right)"
+  },
+  {
+    "sp_gravity_off_port_down",
+    "sp_port",
+    "gravity off port (leading down)"
+  },
+  {
+    "sp_gravity_off_port_left",
+    "sp_port",
+    "gravity off port (leading left)"
+  },
+  {
+    "sp_gravity_off_port_up",
+    "sp_port",
+    "gravity off port (leading up)"
+  },
+  {
+    "balloon_switch_none",
+    "balloon_switch",
+    "wind switch (off)"
+  },
+  {
+    "emc_gate_5",
+    "gate",
+    "door 5 (EMC style)",
+  },
+  {
+    "emc_gate_6",
+    "gate",
+    "door 6 (EMC style)",
+  },
+  {
+    "emc_gate_7",
+    "gate",
+    "door 7 (EMC style)",
+  },
+  {
+    "emc_gate_8",
+    "gate",
+    "door 8 (EMC style)",
+  },
+  {
+    "emc_gate_5_gray",
+    "gate",
+    "gray door (EMC style, key 5)",
+  },
+  {
+    "emc_gate_6_gray",
+    "gate",
+    "gray door (EMC style, key 6)",
+  },
+  {
+    "emc_gate_7_gray",
+    "gate",
+    "gray door (EMC style, key 7)",
+  },
+  {
+    "emc_gate_8_gray",
+    "gate",
+    "gray door (EMC style, key 8)",
+  },
+  {
+    "emc_key_5",
+    "key",
+    "key 5 (EMC style)",
+  },
+  {
+    "emc_key_6",
+    "key",
+    "key 6 (EMC style)",
+  },
+  {
+    "emc_key_7",
+    "key",
+    "key 7 (EMC style)",
+  },
+  {
+    "emc_key_8",
+    "key",
+    "key 8 (EMC style)",
+  },
+  {
+    "emc_android",
+    "emc_android",
+    "android",
+  },
+  {
+    "emc_grass",
+    "emc_grass",
+    "grass",
+  },
+  {
+    "emc_magic_ball",
+    "emc_magic_ball",
+    "magic ball",
+  },
+  {
+    "emc_magic_ball.active",
+    "emc_magic_ball",
+    "magic ball (activated)",
+  },
+  {
+    "emc_magic_ball_switch",
+    "emc_magic_ball_switch",
+    "magic ball switch (off)",
+  },
+  {
+    "emc_magic_ball_switch.active",
+    "emc_magic_ball_switch",
+    "magic ball switch (on)",
+  },
+  {
+    "emc_spring_bumper",
+    "emc_spring_bumper",
+    "spring bumper",
+  },
+  {
+    "emc_plant",
+    "emc_plant",
+    "plant",
+  },
+  {
+    "emc_lenses",
+    "emc_lenses",
+    "lenses",
+  },
+  {
+    "emc_magnifier",
+    "emc_magnifier",
+    "magnifier",
+  },
+  {
+    "emc_wall_9",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_10",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_11",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_12",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_13",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_14",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_15",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_16",
+    "wall",
+    "normal wall"
+  },
+  {
+    "emc_wall_slippery_1",
+    "wall",
+    "slippery wall"
+  },
+  {
+    "emc_wall_slippery_2",
+    "wall",
+    "slippery wall"
+  },
+  {
+    "emc_wall_slippery_3",
+    "wall",
+    "slippery wall"
+  },
+  {
+    "emc_wall_slippery_4",
+    "wall",
+    "slippery wall"
+  },
+  {
+    "emc_fake_grass",
+    "fake_grass",
+    "fake grass"
+  },
+  {
+    "emc_fake_acid",
+    "fake_acid",
+    "fake acid"
+  },
+  {
+    "emc_dripper",
+    "dripper",
+    "dripper"
+  },
+  {
+    "trigger_ce_value",
+    "trigger",
+    "CE value of element triggering change"
+  },
+  {
+    "trigger_ce_score",
+    "trigger",
+    "CE score of element triggering change"
+  },
+  {
+    "current_ce_value",
+    "current",
+    "CE value of current element"
+  },
+  {
+    "current_ce_score",
+    "current",
+    "CE score of current element"
+  },
+  {
+    "yamyam.left",
+    "yamyam",
+    "yam yam (starts moving left)"
+  },
+  {
+    "yamyam.right",
+    "yamyam",
+    "yam yam (starts moving right)"
+  },
+  {
+    "yamyam.up",
+    "yamyam",
+    "yam yam (starts moving up)"
+  },
+  {
+    "yamyam.down",
+    "yamyam",
+    "yam yam (starts moving down)"
+  },
+  {
+    "bd_expandable_wall",
+    "wall",
+    "growing wall (horizontal, BD style)"
+  },
+  {
+    "last_ce_8",
+    "last_ce",
+    "CE 8 positions earlier in list"
+  },
+  {
+    "last_ce_7",
+    "last_ce",
+    "CE 7 positions earlier in list"
+  },
+  {
+    "last_ce_6",
+    "last_ce",
+    "CE 6 positions earlier in list"
+  },
+  {
+    "last_ce_5",
+    "last_ce",
+    "CE 5 positions earlier in list"
+  },
+  {
+    "last_ce_4",
+    "last_ce",
+    "CE 4 positions earlier in list"
+  },
+  {
+    "last_ce_3",
+    "last_ce",
+    "CE 3 positions earlier in list"
+  },
+  {
+    "last_ce_2",
+    "last_ce",
+    "CE 2 positions earlier in list"
+  },
+  {
+    "last_ce_1",
+    "last_ce",
+    "CE 1 position earlier in list"
+  },
+  {
+    "self",
+    "self",
+    "the current custom element"
+  },
+  {
+    "next_ce_1",
+    "next_ce",
+    "CE 1 position later in list"
+  },
+  {
+    "next_ce_2",
+    "next_ce",
+    "CE 2 positions later in list"
+  },
+  {
+    "next_ce_3",
+    "next_ce",
+    "CE 3 positions later in list"
+  },
+  {
+    "next_ce_4",
+    "next_ce",
+    "CE 4 positions later in list"
+  },
+  {
+    "next_ce_5",
+    "next_ce",
+    "CE 5 positions later in list"
+  },
+  {
+    "next_ce_6",
+    "next_ce",
+    "CE 6 positions later in list"
+  },
+  {
+    "next_ce_7",
+    "next_ce",
+    "CE 7 positions later in list"
+  },
+  {
+    "next_ce_8",
+    "next_ce",
+    "CE 8 positions later in list"
+  },
+  {
+    "any_element",
+    "any_element",
+    "this element matches any element"
+  },
+
+  /* ----------------------------------------------------------------------- */
+  /* "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",
+    "steelwall",
+    "-"
+  },
+  {
+    "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.opening",
+    "sp_exit",
+    "-"
+  },
+  {
+    "sp_exit.closing",
+    "sp_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",
+    "-"
+  },
+
+  {
+    "emc_fake_grass.active",
+    "fake_grass",
+    "-"
+  },
+  {
+    "gate_1_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "gate_2_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "gate_3_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "gate_4_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "em_gate_1_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "em_gate_2_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "em_gate_3_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "em_gate_4_gray.active",
+    "gate",
+    ""
+  },
+  {
+    "emc_gate_5_gray.active",
+    "gate",
+    "",
+  },
+  {
+    "emc_gate_6_gray.active",
+    "gate",
+    "",
+  },
+  {
+    "emc_gate_7_gray.active",
+    "gate",
+    "",
+  },
+  {
+    "emc_gate_8_gray.active",
+    "gate",
+    "",
+  },
+  {
+    "emc_dripper.active",
+    "dripper",
+    "dripper"
+  },
+  {
+    "emc_spring_bumper.active",
+    "emc_spring_bumper",
+    "spring bumper",
+  },
+
+  /* ----------------------------------------------------------------------- */
+  /* "unreal" (and therefore not drawable) runtime elements                  */
+  /* ----------------------------------------------------------------------- */
+
+  {
+    "blocked",
+    "-",
+    "-"
+  },
+  {
+    "explosion",
+    "-",
+    "-"
+  },
+  {
+    "nut.breaking",
+    "-",
+    "-"
+  },
+  {
+    "diamond.breaking",
+    "-",
+    "-"
+  },
+  {
+    "acid_splash_left",
+    "-",
+    "-"
+  },
+  {
+    "acid_splash_right",
+    "-",
+    "-"
+  },
+  {
+    "amoeba.growing",
+    "-",
+    "-"
+  },
+  {
+    "amoeba.shrinking",
+    "-",
+    "-"
+  },
+  {
+    "expandable_wall.growing",
+    "-",
+    "-"
+  },
+  {
+    "flames",
+    "-",
+    "-"
+  },
+  {
+    "player_is_leaving",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_1",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_2",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_3",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_4",
+    "-",
+    "-"
+  },
+  {
+    "quicksand.filling",
+    "quicksand",
+    "-"
+  },
+  {
+    "magic_wall.filling",
+    "-",
+    "-"
+  },
+  {
+    "bd_magic_wall.filling",
+    "-",
+    "-"
+  },
+  {
+    "element.snapping",
+    "-",
+    "-"
+  },
+  {
+    "diagonal.shrinking",
+    "-",
+    "-"
+  },
+  {
+    "diagonal.growing",
+    "-",
     "-"
   },
 
@@ -2924,7 +4275,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "dynabomb_active",
+    "dynabomb.active",
     "-",
     "-"
   },
@@ -2949,15 +4300,20 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "shield_normal_active",
+    "shield_normal.active",
     "-",
     "-"
   },
   {
-    "shield_deadly_active",
+    "shield_deadly.active",
     "-",
     "-"
   },
+  {
+    "amoeba",
+    "amoeba",
+    "-"
+  },
   {
     "[default]",
     "default",
@@ -2978,6 +4334,166 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "sb_default",
     "-"
   },
+  {
+    "internal_clipboard_custom",
+    "internal",
+    "empty custom element"
+  },
+  {
+    "internal_clipboard_change",
+    "internal",
+    "empty change page"
+  },
+  {
+    "internal_clipboard_group",
+    "internal",
+    "empty group element"
+  },
+  {
+    "internal_dummy",
+    "internal",
+    "-"
+  },
+  {
+    "internal_cascade_bd",
+    "internal",
+    "show Boulder Dash elements"
+  },
+  {
+    "internal_cascade_bd.active",
+    "internal",
+    "hide Boulder Dash elements"
+  },
+  {
+    "internal_cascade_em",
+    "internal",
+    "show Emerald Mine elements"
+  },
+  {
+    "internal_cascade_em.active",
+    "internal",
+    "hide Emerald Mine elements"
+  },
+  {
+    "internal_cascade_emc",
+    "internal",
+    "show Emerald Mine Club elements"
+  },
+  {
+    "internal_cascade_emc.active",
+    "internal",
+    "hide Emerald Mine Club elements"
+  },
+  {
+    "internal_cascade_rnd",
+    "internal",
+    "show Rocks'n'Diamonds elements"
+  },
+  {
+    "internal_cascade_rnd.active",
+    "internal",
+    "hide Rocks'n'Diamonds elements"
+  },
+  {
+    "internal_cascade_sb",
+    "internal",
+    "show Sokoban elements"
+  },
+  {
+    "internal_cascade_sb.active",
+    "internal",
+    "hide Sokoban elements"
+  },
+  {
+    "internal_cascade_sp",
+    "internal",
+    "show Supaplex elements"
+  },
+  {
+    "internal_cascade_sp.active",
+    "internal",
+    "hide Supaplex elements"
+  },
+  {
+    "internal_cascade_dc",
+    "internal",
+    "show Diamond Caves II elements"
+  },
+  {
+    "internal_cascade_dc.active",
+    "internal",
+    "hide Diamond Caves II elements"
+  },
+  {
+    "internal_cascade_dx",
+    "internal",
+    "show DX Boulderdash elements"
+  },
+  {
+    "internal_cascade_dx.active",
+    "internal",
+    "hide DX Boulderdash elements"
+  },
+  {
+    "internal_cascade_chars",
+    "internal",
+    "show text elements"
+  },
+  {
+    "internal_cascade_chars.active",
+    "internal",
+    "hide text elements"
+  },
+  {
+    "internal_cascade_ce",
+    "internal",
+    "show custom elements"
+  },
+  {
+    "internal_cascade_ce.active",
+    "internal",
+    "hide custom elements"
+  },
+  {
+    "internal_cascade_ge",
+    "internal",
+    "show group elements"
+  },
+  {
+    "internal_cascade_ge.active",
+    "internal",
+    "hide group elements"
+  },
+  {
+    "internal_cascade_ref",
+    "internal",
+    "show reference elements"
+  },
+  {
+    "internal_cascade_ref.active",
+    "internal",
+    "hide reference elements"
+  },
+  {
+    "internal_cascade_user",
+    "internal",
+    "show user defined elements"
+  },
+  {
+    "internal_cascade_user.active",
+    "internal",
+    "hide user defined elements"
+  },
+  {
+    "internal_cascade_dynamic",
+    "internal",
+    "show elements used in this level"
+  },
+  {
+    "internal_cascade_dynamic.active",
+    "internal",
+    "hide elements used in this level"
+  },
 
   /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */
 
@@ -2995,95 +4511,200 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
 
 struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
 {
-  { ".[DEFAULT]",      ACTION_DEFAULT,         TRUE    },
-  { ".waiting",                ACTION_WAITING,         TRUE    },
-  { ".falling",                ACTION_FALLING,         TRUE    },
-  { ".moving",         ACTION_MOVING,          TRUE    },
-  { ".digging",                ACTION_DIGGING,         FALSE   },
-  { ".snapping",       ACTION_SNAPPING,        FALSE   },
-  { ".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   },
-  { ".activating",     ACTION_ACTIVATING,      FALSE   },
-  { ".deactivating",   ACTION_DEACTIVATING,    FALSE   },
-  { ".opening",                ACTION_OPENING,         FALSE   },
-  { ".closing",                ACTION_CLOSING,         FALSE   },
-  { ".attacking",      ACTION_ATTACKING,       TRUE    },
-  { ".growing",                ACTION_GROWING,         TRUE    },
-  { ".shrinking",      ACTION_SHRINKING,       FALSE   },
-  { ".active",         ACTION_ACTIVE,          TRUE    },
-  { ".filling",                ACTION_FILLING,         FALSE   },
-  { ".emptying",       ACTION_EMPTYING,        FALSE   },
-  { ".changing",       ACTION_CHANGING,        FALSE   },
-  { ".exploding",      ACTION_EXPLODING,       FALSE   },
-  { ".dying",          ACTION_DYING,           FALSE   },
-  { ".other",          ACTION_OTHER,           FALSE   },
+  { ".[DEFAULT]",              ACTION_DEFAULT,                 TRUE    },
+  { ".waiting",                        ACTION_WAITING,                 TRUE    },
+  { ".falling",                        ACTION_FALLING,                 TRUE    },
+  { ".moving",                 ACTION_MOVING,                  TRUE    },
+  { ".digging",                        ACTION_DIGGING,                 FALSE   },
+  { ".snapping",               ACTION_SNAPPING,                FALSE   },
+  { ".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   },
+  { ".activating",             ACTION_ACTIVATING,              FALSE   },
+  { ".deactivating",           ACTION_DEACTIVATING,            FALSE   },
+  { ".opening",                        ACTION_OPENING,                 FALSE   },
+  { ".closing",                        ACTION_CLOSING,                 FALSE   },
+  { ".attacking",              ACTION_ATTACKING,               TRUE    },
+  { ".growing",                        ACTION_GROWING,                 TRUE    },
+  { ".shrinking",              ACTION_SHRINKING,               FALSE   },
+  { ".active",                 ACTION_ACTIVE,                  TRUE    },
+  { ".filling",                        ACTION_FILLING,                 FALSE   },
+  { ".emptying",               ACTION_EMPTYING,                FALSE   },
+  { ".changing",               ACTION_CHANGING,                FALSE   },
+  { ".exploding",              ACTION_EXPLODING,               FALSE   },
+  { ".boring",                 ACTION_BORING,                  FALSE   },
+  { ".boring[1]",              ACTION_BORING_1,                FALSE   },
+  { ".boring[2]",              ACTION_BORING_2,                FALSE   },
+  { ".boring[3]",              ACTION_BORING_3,                FALSE   },
+  { ".boring[4]",              ACTION_BORING_4,                FALSE   },
+  { ".boring[5]",              ACTION_BORING_5,                FALSE   },
+  { ".boring[6]",              ACTION_BORING_6,                FALSE   },
+  { ".boring[7]",              ACTION_BORING_7,                FALSE   },
+  { ".boring[8]",              ACTION_BORING_8,                FALSE   },
+  { ".boring[9]",              ACTION_BORING_9,                FALSE   },
+  { ".boring[10]",             ACTION_BORING_10,               FALSE   },
+  { ".sleeping",               ACTION_SLEEPING,                FALSE   },
+  { ".sleeping[1]",            ACTION_SLEEPING_1,              FALSE   },
+  { ".sleeping[2]",            ACTION_SLEEPING_2,              FALSE   },
+  { ".sleeping[3]",            ACTION_SLEEPING_3,              FALSE   },
+  { ".awakening",              ACTION_AWAKENING,               FALSE   },
+  { ".dying",                  ACTION_DYING,                   FALSE   },
+  { ".turning",                        ACTION_TURNING,                 FALSE   },
+  { ".turning_from_left",      ACTION_TURNING_FROM_LEFT,       FALSE   },
+  { ".turning_from_right",     ACTION_TURNING_FROM_RIGHT,      FALSE   },
+  { ".turning_from_up",                ACTION_TURNING_FROM_UP,         FALSE   },
+  { ".turning_from_down",      ACTION_TURNING_FROM_DOWN,       FALSE   },
+  { ".smashed_by_rock",                ACTION_SMASHED_BY_ROCK,         FALSE   },
+  { ".smashed_by_spring",      ACTION_SMASHED_BY_SPRING,       FALSE   },
+  { ".eating",                 ACTION_EATING,                  FALSE   },
+  { ".twinkling",              ACTION_TWINKLING,               FALSE   },
+  { ".splashing",              ACTION_SPLASHING,               FALSE   },
+  { ".page[1]",                        ACTION_PAGE_1,                  FALSE   },
+  { ".page[2]",                        ACTION_PAGE_2,                  FALSE   },
+  { ".page[3]",                        ACTION_PAGE_3,                  FALSE   },
+  { ".page[4]",                        ACTION_PAGE_4,                  FALSE   },
+  { ".page[5]",                        ACTION_PAGE_5,                  FALSE   },
+  { ".page[6]",                        ACTION_PAGE_6,                  FALSE   },
+  { ".page[7]",                        ACTION_PAGE_7,                  FALSE   },
+  { ".page[8]",                        ACTION_PAGE_8,                  FALSE   },
+  { ".page[9]",                        ACTION_PAGE_9,                  FALSE   },
+  { ".page[10]",               ACTION_PAGE_10,                 FALSE   },
+  { ".page[11]",               ACTION_PAGE_11,                 FALSE   },
+  { ".page[12]",               ACTION_PAGE_12,                 FALSE   },
+  { ".page[13]",               ACTION_PAGE_13,                 FALSE   },
+  { ".page[14]",               ACTION_PAGE_14,                 FALSE   },
+  { ".page[15]",               ACTION_PAGE_15,                 FALSE   },
+  { ".page[16]",               ACTION_PAGE_16,                 FALSE   },
+  { ".page[17]",               ACTION_PAGE_17,                 FALSE   },
+  { ".page[18]",               ACTION_PAGE_18,                 FALSE   },
+  { ".page[19]",               ACTION_PAGE_19,                 FALSE   },
+  { ".page[20]",               ACTION_PAGE_20,                 FALSE   },
+  { ".page[21]",               ACTION_PAGE_21,                 FALSE   },
+  { ".page[22]",               ACTION_PAGE_22,                 FALSE   },
+  { ".page[23]",               ACTION_PAGE_23,                 FALSE   },
+  { ".page[24]",               ACTION_PAGE_24,                 FALSE   },
+  { ".page[25]",               ACTION_PAGE_25,                 FALSE   },
+  { ".page[26]",               ACTION_PAGE_26,                 FALSE   },
+  { ".page[27]",               ACTION_PAGE_27,                 FALSE   },
+  { ".page[28]",               ACTION_PAGE_28,                 FALSE   },
+  { ".page[29]",               ACTION_PAGE_29,                 FALSE   },
+  { ".page[30]",               ACTION_PAGE_30,                 FALSE   },
+  { ".page[31]",               ACTION_PAGE_31,                 FALSE   },
+  { ".page[32]",               ACTION_PAGE_32,                 FALSE   },
+  { ".other",                  ACTION_OTHER,                   FALSE   },
 
   /* empty suffix always matches -- check as last entry in InitSoundInfo() */
-  { "",                        ACTION_DEFAULT,         TRUE    },
+  { "",                                ACTION_DEFAULT,                 TRUE    },
 
-  { NULL,              0,                      0       }
+  { NULL,                      0,                              0       }
 };
 
-struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
+struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] =
 {
   { ".left",           MV_BIT_LEFT                     },
   { ".right",          MV_BIT_RIGHT                    },
   { ".up",             MV_BIT_UP                       },
   { ".down",           MV_BIT_DOWN                     },
+  { ".upleft",         MV_BIT_UP                       },
+  { ".upright",                MV_BIT_RIGHT                    },
+  { ".downleft",       MV_BIT_LEFT                     },
+  { ".downright",      MV_BIT_DOWN                     },
 
   { NULL,              0                               }
 };
 
-struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
+struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] =
 {
+  { ".[DEFAULT]",      GAME_MODE_DEFAULT,              },
+  { ".TITLE",          GAME_MODE_TITLE,                },
   { ".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,      },
 
+  /* empty suffix always matches -- check as last entry in InitMusicInfo() */
+  { "",                        GAME_MODE_DEFAULT,              },
+
   { 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                           },
-
-  { NULL,                      NULL,                                      }
+  { "global.num_toons",                &global.num_toons                           },
+
+  { "menu.draw_xoffset",       &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] },
+  { "menu.draw_yoffset",       &menu.draw_yoffset[GFX_SPECIAL_ARG_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[GFX_SPECIAL_ARG_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]       },
+
+  { "menu.fade_delay",         &menu.fade_delay                            },
+  { "menu.post_delay",         &menu.post_delay                            },
+
+  { "door_1.width",            &door_1.width                               },
+  { "door_1.height",           &door_1.height                              },
+  { "door_1.step_offset",      &door_1.step_offset                         },
+  { "door_1.step_delay",       &door_1.step_delay                          },
+  { "door_1.anim_mode",                &door_1.anim_mode                           },
+  { "door_2.width",            &door_2.width                               },
+  { "door_2.height",           &door_2.height                              },
+  { "door_2.step_offset",      &door_2.step_offset                         },
+  { "door_2.step_delay",       &door_2.step_delay                          },
+  { "door_2.anim_mode",                &door_2.anim_mode                           },
+
+  { "preview.x",               &preview.x                                  },
+  { "preview.y",               &preview.y                                  },
+  { "preview.xsize",           &preview.xsize                              },
+  { "preview.ysize",           &preview.ysize                              },
+  { "preview.tile_size",       &preview.tile_size                          },
+  { "preview.step_offset",     &preview.step_offset                        },
+  { "preview.step_delay",      &preview.step_delay                         },
+
+  { "game.panel.level.x",      &game.panel.level.x                         },
+  { "game.panel.level.y",      &game.panel.level.y                         },
+  { "game.panel.gems.x",       &game.panel.gems.x                          },
+  { "game.panel.gems.y",       &game.panel.gems.y                          },
+  { "game.panel.inventory.x",  &game.panel.inventory.x                     },
+  { "game.panel.inventory.y",  &game.panel.inventory.y                     },
+  { "game.panel.keys.x",       &game.panel.keys.x                          },
+  { "game.panel.keys.y",       &game.panel.keys.y                          },
+  { "game.panel.score.x",      &game.panel.score.x                         },
+  { "game.panel.score.y",      &game.panel.score.y                         },
+  { "game.panel.time.x",       &game.panel.time.x                          },
+  { "game.panel.time.y",       &game.panel.time.y                          },
+
+  { "[player].boring_delay_fixed",     &game.player_boring_delay_fixed     },
+  { "[player].boring_delay_random",    &game.player_boring_delay_random    },
+  { "[player].sleeping_delay_fixed",   &game.player_sleeping_delay_fixed   },
+  { "[player].sleeping_delay_random",  &game.player_sleeping_delay_random  },
+
+  { NULL,                      NULL,                                       }
 };
 
 
@@ -3112,6 +4733,10 @@ struct FontInfo font_info[NUM_FONTS + 1] =
   { "font.text_2"              },
   { "font.text_3"              },
   { "font.text_4"              },
+  { "font.envelope_1"          },
+  { "font.envelope_2"          },
+  { "font.envelope_3"          },
+  { "font.envelope_4"          },
   { "font.input_1.active"      },
   { "font.input_2.active"      },
   { "font.input_1"             },
@@ -3121,28 +4746,76 @@ struct FontInfo font_info[NUM_FONTS + 1] =
   { "font.value_1"             },
   { "font.value_2"             },
   { "font.value_old"           },
+  { "font.level_number.active" },
   { "font.level_number"                },
   { "font.tape_recorder"       },
   { "font.game_info"           },
 };
 
 
+/* ------------------------------------------------------------------------- */
+/* music token prefix definitions                                            */
+/* ------------------------------------------------------------------------- */
+
+struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] =
+{
+  { "background",              TRUE    },
+
+  { NULL,                      0       }
+};
+
+
 /* ========================================================================= */
 /* main()                                                                    */
 /* ========================================================================= */
 
+static void print_usage()
+{
+  printf("\n"
+        "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
+        "\n"
+        "Options:\n"
+        "  -d, --display HOSTNAME[:SCREEN]  specify X server display\n"
+        "  -b, --basepath DIRECTORY         alternative base DIRECTORY\n"
+        "  -l, --level DIRECTORY            alternative level DIRECTORY\n"
+        "  -g, --graphics DIRECTORY         alternative graphics DIRECTORY\n"
+        "  -s, --sounds DIRECTORY           alternative sounds DIRECTORY\n"
+        "  -m, --music DIRECTORY            alternative music DIRECTORY\n"
+        "  -n, --network                    network multiplayer game\n"
+        "      --serveronly                 only start network server\n"
+        "  -v, --verbose                    verbose mode\n"
+        "      --debug                      display debugging information\n"
+        "  -e, --execute COMMAND            execute batch COMMAND\n"
+        "\n"
+        "Valid commands for '--execute' option:\n"
+        "  \"print graphicsinfo.conf\"        print default graphics config\n"
+        "  \"print soundsinfo.conf\"          print default sounds config\n"
+        "  \"print musicinfo.conf\"           print default music config\n"
+        "  \"print editorsetup.conf\"         print default editor config\n"
+        "  \"print helpanim.conf\"            print default helpanim config\n"
+        "  \"print helptext.conf\"            print default helptext config\n"
+        "  \"dump level FILE\"                dump level data from FILE\n"
+        "  \"dump tape FILE\"                 dump tape data from FILE\n"
+        "  \"autoplay LEVELDIR [NR ...]\"     play level tapes for LEVELDIR\n"
+        "  \"convert LEVELDIR [NR]\"          convert levels in LEVELDIR\n"
+        "\n",
+        program.command_basename);
+}
+
 int main(int argc, char *argv[])
 {
-  InitProgramInfo(argv[0], USERDATA_DIRECTORY,
-                 PROGRAM_TITLE_STRING, getWindowTitleString(),
-                 ICON_TITLE_STRING, X11_ICON_FILENAME, X11_ICONMASK_FILENAME,
+  char * window_title_string = getWindowTitleString();
+
+  InitProgramInfo(argv[0], USERDATA_DIRECTORY, USERDATA_DIRECTORY_UNIX,
+                 PROGRAM_TITLE_STRING, window_title_string, ICON_TITLE_STRING,
+                 X11_ICON_FILENAME, X11_ICONMASK_FILENAME, SDL_ICON_FILENAME,
                  MSDOS_POINTER_FILENAME,
                  COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL);
 
   InitExitFunction(CloseAllAndExit);
   InitPlatformDependentStuff();
 
-  GetOptions(argv);
+  GetOptions(argv, print_usage);
   OpenAll();
 
   EventLoop();