rnd-20031008-1-src
[rocksndiamonds.git] / src / main.c
index 380af747136b26ab94b5d9de164e54381a4e2c27..f6dc5542481490d36043e11ccff279ef926c0d3b 100644 (file)
@@ -50,7 +50,8 @@ 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];
+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];
@@ -95,7 +96,7 @@ struct SetupInfo      setup;
 struct GameInfo                game;
 struct GlobalInfo      global;
 struct MenuInfo                menu;
-struct DoorInfo                door;
+struct DoorInfo                door_1, door_2;
 struct GraphicInfo     *graphic_info = NULL;
 struct SoundInfo       *sound_info = NULL;
 
@@ -139,8 +140,8 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "key_obsolete",
-    "key",
-    "key"
+    "obsolete",
+    "key (OBSOLETE)"
   },
   {
     "emerald",
@@ -154,18 +155,18 @@ 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",
@@ -253,7 +254,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "biomaze"
   },
   {
-    "dynamite_active",
+    "dynamite.active",
     "dynamite",
     "burning dynamite"
   },
@@ -268,7 +269,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "magic wheel"
   },
   {
-    "robot_wheel_active",
+    "robot_wheel.active",
     "robot_wheel",
     "magic wheel (running)"
   },
@@ -337,7 +338,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "pacman",
     "pacman",
-    "pac man"
+    "pac man (random start direction)"
   },
   {
     "invisible_wall",
@@ -350,7 +351,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "lamp (off)"
   },
   {
-    "lamp_active",
+    "lamp.active",
     "lamp",
     "lamp (on)"
   },
@@ -460,51 +461,51 @@ 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",
@@ -527,59 +528,59 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "blue player"
   },
   {
-    "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)"
   },
@@ -656,7 +657,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
   {
     "mole",
     "mole",
-    "mole"
+    "mole (random start direction)"
   },
   {
     "penguin",
@@ -699,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",
@@ -1139,19 +1140,19 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "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",
@@ -1584,9 +1585,9 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "land mine"
   },
   {
-    "envelope",
-    "envelope",
-    "mail envelope"
+    "envelope_obsolete",
+    "obsolete",
+    "envelope (OBSOLETE)"
   },
   {
     "light_switch",
@@ -1594,7 +1595,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "light switch (off)"
   },
   {
-    "light_switch_active",
+    "light_switch.active",
     "light_switch",
     "light switch (on)"
   },
@@ -1659,22 +1660,22 @@ 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)"
   },
@@ -1724,7 +1725,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "time gate (closed)"
   },
   {
-    "timegate_switch_active",
+    "timegate_switch.active",
     "timegate_switch",
     "switch for time gate"
   },
@@ -3183,183 +3184,218 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "custom",
     "custom element 256"
   },
-
-  /* ----------------------------------------------------------------------- */
-  /* "real" (and therefore drawable) runtime elements                        */
-  /* ----------------------------------------------------------------------- */
-
   {
     "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"
   },
   {
-    "dynabomb_player_1_active",
+    "envelope_4",
+    "envelope",
+    "mail envelope 4"
+  },
+
+  /* ----------------------------------------------------------------------- */
+  /* "real" (and therefore drawable) runtime elements                        */
+  /* ----------------------------------------------------------------------- */
+
+  {
+    "dynabomb_player_1.active",
     "dynabomb",
     "-"
   },
   {
-    "dynabomb_player_2_active",
+    "dynabomb_player_2.active",
     "dynabomb",
     "-"
   },
   {
-    "dynabomb_player_3_active",
+    "dynabomb_player_3.active",
     "dynabomb",
     "-"
   },
   {
-    "dynabomb_player_4_active",
+    "dynabomb_player_4.active",
     "dynabomb",
     "-"
   },
   {
-    "sp_disk_red_active",
+    "sp_disk_red.active",
     "dynamite",
     "-"
   },
   {
-    "switchgate_opening",
+    "switchgate.opening",
     "switchgate",
     "-"
   },
   {
-    "switchgate_closing",
+    "switchgate.closing",
     "switchgate",
     "-"
   },
   {
-    "timegate_opening",
+    "timegate.opening",
     "timegate",
     "-"
   },
   {
-    "timegate_closing",
+    "timegate.closing",
     "timegate",
     "-"
   },
   {
-    "pearl_breaking",
+    "pearl.breaking",
     "pearl",
     "-"
   },
   {
-    "trap_active",
+    "trap.active",
     "trap",
     "-"
   },
   {
-    "invisible_steelwall_active",
+    "invisible_steelwall.active",
     "wall",
     "-"
   },
   {
-    "invisible_wall_active",
+    "invisible_wall.active",
     "wall",
     "-"
   },
   {
-    "invisible_sand_active",
+    "invisible_sand.active",
     "sand",
     "-"
   },
   {
-    "conveyor_belt_1_left_active",
+    "conveyor_belt_1_left.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_1_middle_active",
+    "conveyor_belt_1_middle.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_1_right_active",
+    "conveyor_belt_1_right.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_2_left_active",
+    "conveyor_belt_2_left.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_2_middle_active",
+    "conveyor_belt_2_middle.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_2_right_active",
+    "conveyor_belt_2_right.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_3_left_active",
+    "conveyor_belt_3_left.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_3_middle_active",
+    "conveyor_belt_3_middle.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_3_right_active",
+    "conveyor_belt_3_right.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_4_left_active",
+    "conveyor_belt_4_left.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_4_middle_active",
+    "conveyor_belt_4_middle.active",
     "conveyor_belt",
     "-"
   },
   {
-    "conveyor_belt_4_right_active",
+    "conveyor_belt_4_right.active",
     "conveyor_belt",
     "-"
   },
   {
-    "exit_opening",
+    "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.active",
     "sp_terminal",
     "-"
   },
   {
-    "sp_buggy_base_activating",
+    "sp_buggy_base.activating",
     "sp_buggy_base",
     "-"
   },
   {
-    "sp_buggy_base_active",
+    "sp_buggy_base.active",
     "sp_buggy_base",
     "-"
   },
@@ -3369,22 +3405,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "amoeba_dropping",
+    "amoeba.dropping",
     "amoeba",
     "-"
   },
   {
-    "quicksand_emptying",
+    "quicksand.emptying",
     "quicksand",
     "-"
   },
   {
-    "magic_wall_active",
+    "magic_wall.active",
     "magic_wall",
     "-"
   },
   {
-    "bd_magic_wall_active",
+    "bd_magic_wall.active",
     "magic_wall",
     "-"
   },
@@ -3399,12 +3435,12 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "magic_wall_emptying",
+    "magic_wall.emptying",
     "magic_wall",
     "-"
   },
   {
-    "bd_magic_wall_emptying",
+    "bd_magic_wall.emptying",
     "magic_wall",
     "-"
   },
@@ -3464,7 +3500,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "expandable_wall_growing",
+    "expandable_wall.growing",
     "-",
     "-"
   },
@@ -3479,17 +3515,17 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "quicksand_filling",
+    "quicksand.filling",
     "quicksand",
     "-"
   },
   {
-    "magic_wall_filling",
+    "magic_wall.filling",
     "-",
     "-"
   },
   {
-    "bd_magic_wall_filling",
+    "bd_magic_wall.filling",
     "-",
     "-"
   },
@@ -3564,7 +3600,7 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "dynabomb_active",
+    "dynabomb.active",
     "-",
     "-"
   },
@@ -3589,12 +3625,12 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-"
   },
   {
-    "shield_normal_active",
+    "shield_normal.active",
     "-",
     "-"
   },
   {
-    "shield_deadly_active",
+    "shield_deadly.active",
     "-",
     "-"
   },
@@ -3721,8 +3757,12 @@ struct TokenIntPtrInfo image_config_vars[] =
   { "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_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.step_offset",      &door_2.step_offset                        },
+  { "door_2.step_delay",       &door_2.step_delay                         },
+  { "door_2.anim_mode",                &door_2.anim_mode                          },
 
   { NULL,                      NULL,                                      }
 };
@@ -3753,6 +3793,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"             },