rnd-20060805-5-src
[rocksndiamonds.git] / src / main.c
index bc9a1e8bdace8fae9e8b0084769ca51e4e07d231..c9c29c8b8651f2d225a4fd8daeefd6706cd0a180 100644 (file)
 #include "main.h"
 #include "init.h"
 #include "game.h"
+#include "tape.h"
 #include "events.h"
 #include "config.h"
 
-Bitmap                *bitmap_db_field, *bitmap_db_door;
+Bitmap                *bitmap_db_title;
+Bitmap                *bitmap_db_field;
+Bitmap                *bitmap_db_door;
 DrawBuffer            *fieldbuffer;
 DrawBuffer            *drawto_field;
 
@@ -64,7 +67,9 @@ 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                    GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
@@ -185,7 +190,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   {
     "yamyam",
     "yamyam",
-    "yam yam"
+    "yam yam (random start direction)"
   },
   {
     "robot",
@@ -194,7 +199,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "steelwall",
-    "wall",
+    "steelwall",
     "steel wall"
   },
   {
@@ -245,7 +250,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   {
     "amoeba_wet",
     "amoeba",
-    "dropping amoeba"
+    "dropping amoeba (EM style)"
   },
   {
     "amoeba_dry",
@@ -405,7 +410,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   {
     "expandable_wall",
     "wall",
-    "growing wall"
+    "growing wall (horizontal, visible)"
   },
   {
     "bd_diamond",
@@ -439,7 +444,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "invisible_steelwall",
-    "wall",
+    "steelwall",
     "invisible steel wall"
   },
   {
@@ -1392,14 +1397,14 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "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",
@@ -1698,7 +1703,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "steelwall_slippery",
-    "wall",
+    "steelwall",
     "slippery steel wall"
   },
   {
@@ -1783,22 +1788,22 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "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"
   },
   {
@@ -3651,6 +3656,136 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "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                        */
@@ -3713,7 +3848,7 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
   },
   {
     "invisible_steelwall.active",
-    "wall",
+    "steelwall",
     "-"
   },
   {
@@ -4328,24 +4463,24 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "hide group elements"
   },
   {
-    "internal_cascade_user",
+    "internal_cascade_ref",
     "internal",
-    "show user defined elements"
+    "show reference elements"
   },
   {
-    "internal_cascade_user.active",
+    "internal_cascade_ref.active",
     "internal",
-    "hide user defined elements"
+    "hide reference elements"
   },
   {
-    "internal_cascade_generic",
+    "internal_cascade_user",
     "internal",
-    "show elements"
+    "show user defined elements"
   },
   {
-    "internal_cascade_generic.active",
+    "internal_cascade_user.active",
     "internal",
-    "hide elements"
+    "hide user defined elements"
   },
   {
     "internal_cascade_dynamic",
@@ -4423,7 +4558,7 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] =
   { ".turning_from_down",      ACTION_TURNING_FROM_DOWN,       FALSE   },
   { ".smashed_by_rock",                ACTION_SMASHED_BY_ROCK,         FALSE   },
   { ".smashed_by_spring",      ACTION_SMASHED_BY_SPRING,       FALSE   },
-  { ".slurped_by_spring",      ACTION_SLURPED_BY_SPRING,       FALSE   },
+  { ".eating",                 ACTION_EATING,                  FALSE   },
   { ".twinkling",              ACTION_TWINKLING,               FALSE   },
   { ".splashing",              ACTION_SPLASHING,               FALSE   },
   { ".page[1]",                        ACTION_PAGE_1,                  FALSE   },
@@ -4483,6 +4618,7 @@ struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 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,               },
@@ -4584,6 +4720,7 @@ 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"           },
@@ -4641,9 +4778,11 @@ static void print_usage()
 
 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);