rnd-20070302-1-src
[rocksndiamonds.git] / src / init.c
index d4fd58a50fb65e1fa4609de282c046c090f7fdfe..4e715dff4ab4c80abc3e19cc4cfc1cf35d6c9ab7 100644 (file)
@@ -815,7 +815,7 @@ void InitElementGraphicInfo()
     for (i = 0; i < MAX_NUM_ELEMENTS; i++)
       if (element_info[i].graphic[ACTION_DEFAULT] == IMG_UNKNOWN &&
          i != EL_UNKNOWN)
-       Error(ERR_RETURN, "warning: no graphic for element '%s' (%d)",
+       Error(ERR_INFO, "warning: no graphic for element '%s' (%d)",
              element_info[i].token_name, i);
   }
 #endif
@@ -975,6 +975,8 @@ static void set_graphic_parameters(int graphic)
   graphic_info[graphic].fade_delay = -1;
   graphic_info[graphic].post_delay = -1;
   graphic_info[graphic].auto_delay = -1;
+  graphic_info[graphic].align = ALIGN_CENTER;  /* default for title screens */
+  graphic_info[graphic].sort_priority = 0;     /* default for title screens */
 
 #if 1
   /* optional zoom factor for scaling up the image to a larger size */
@@ -1167,6 +1169,10 @@ static void set_graphic_parameters(int graphic)
     graphic_info[graphic].post_delay = parameter[GFX_ARG_POST_DELAY];
   if (parameter[GFX_ARG_AUTO_DELAY] != ARG_UNDEFINED_VALUE)
     graphic_info[graphic].auto_delay = parameter[GFX_ARG_AUTO_DELAY];
+  if (parameter[GFX_ARG_ALIGN] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].align = parameter[GFX_ARG_ALIGN];
+  if (parameter[GFX_ARG_SORT_PRIORITY] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].sort_priority = parameter[GFX_ARG_SORT_PRIORITY];
 }
 
 static void set_cloned_graphic_parameters(int graphic)
@@ -1186,18 +1192,18 @@ static void set_cloned_graphic_parameters(int graphic)
 
   if (num_references_followed >= max_num_images)
   {
-    Error(ERR_RETURN_LINE, "-");
-    Error(ERR_RETURN, "warning: error found in config file:");
-    Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename());
-    Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(graphic));
-    Error(ERR_RETURN, "error: loop discovered when resolving cloned graphics");
-    Error(ERR_RETURN, "custom graphic rejected for this element/action");
+    Error(ERR_INFO_LINE, "-");
+    Error(ERR_INFO, "warning: error found in config file:");
+    Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename());
+    Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(graphic));
+    Error(ERR_INFO, "error: loop discovered when resolving cloned graphics");
+    Error(ERR_INFO, "custom graphic rejected for this element/action");
 
     if (graphic == fallback_graphic)
       Error(ERR_EXIT, "fatal error: no fallback graphic available");
 
-    Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic");
-    Error(ERR_RETURN_LINE, "-");
+    Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic");
+    Error(ERR_INFO_LINE, "-");
 
     graphic_info[graphic] = graphic_info[fallback_graphic];
   }
@@ -1338,21 +1344,21 @@ static void InitGraphicInfo()
        src_x + width  > src_bitmap_width ||
        src_y + height > src_bitmap_height)
     {
-      Error(ERR_RETURN_LINE, "-");
-      Error(ERR_RETURN, "warning: error found in config file:");
-      Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename());
-      Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(i));
-      Error(ERR_RETURN, "- image file: '%s'", src_bitmap->source_filename);
-      Error(ERR_RETURN,
+      Error(ERR_INFO_LINE, "-");
+      Error(ERR_INFO, "warning: error found in config file:");
+      Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename());
+      Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i));
+      Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename);
+      Error(ERR_INFO,
            "error: first animation frame out of bounds (%d, %d) [%d, %d]",
            src_x, src_y, src_bitmap_width, src_bitmap_height);
-      Error(ERR_RETURN, "custom graphic rejected for this element/action");
+      Error(ERR_INFO, "custom graphic rejected for this element/action");
 
       if (i == fallback_graphic)
        Error(ERR_EXIT, "fatal error: no fallback graphic available");
 
-      Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic");
-      Error(ERR_RETURN_LINE, "-");
+      Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic");
+      Error(ERR_INFO_LINE, "-");
 
       graphic_info[i] = graphic_info[fallback_graphic];
     }
@@ -1366,21 +1372,21 @@ static void InitGraphicInfo()
        src_x + width  > src_bitmap_width ||
        src_y + height > src_bitmap_height)
     {
-      Error(ERR_RETURN_LINE, "-");
-      Error(ERR_RETURN, "warning: error found in config file:");
-      Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename());
-      Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(i));
-      Error(ERR_RETURN, "- image file: '%s'", src_bitmap->source_filename);
-      Error(ERR_RETURN,
+      Error(ERR_INFO_LINE, "-");
+      Error(ERR_INFO, "warning: error found in config file:");
+      Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename());
+      Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i));
+      Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename);
+      Error(ERR_INFO,
            "error: last animation frame (%d) out of bounds (%d, %d) [%d, %d]",
            last_frame, src_x, src_y, src_bitmap_width, src_bitmap_height);
-      Error(ERR_RETURN, "custom graphic rejected for this element/action");
+      Error(ERR_INFO, "custom graphic rejected for this element/action");
 
       if (i == fallback_graphic)
        Error(ERR_EXIT, "fatal error: no fallback graphic available");
 
-      Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic");
-      Error(ERR_RETURN_LINE, "-");
+      Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic");
+      Error(ERR_INFO_LINE, "-");
 
       graphic_info[i] = graphic_info[fallback_graphic];
     }
@@ -2389,8 +2395,10 @@ void InitElementPropertiesStatic()
     EL_NUT,
     EL_AMOEBA_DROP,
     EL_QUICKSAND_FULL,
+    EL_QUICKSAND_FAST_FULL,
     EL_MAGIC_WALL_FULL,
     EL_BD_MAGIC_WALL_FULL,
+    EL_DC_MAGIC_WALL_FULL,
     EL_TIME_ORB_FULL,
     EL_TIME_ORB_EMPTY,
     EL_SP_ZONK,
@@ -2837,6 +2845,22 @@ void InitElementPropertiesStatic()
     -1
   };
 
+  static int ep_can_pass_dc_magic_wall[] =
+  {
+    EL_ROCK,
+    EL_BD_ROCK,
+    EL_EMERALD,
+    EL_BD_DIAMOND,
+    EL_EMERALD_YELLOW,
+    EL_EMERALD_RED,
+    EL_EMERALD_PURPLE,
+    EL_DIAMOND,
+    EL_PEARL,
+    EL_CRYSTAL,
+
+    -1
+  };
+
   static int ep_switchable[] =
   {
     EL_ROBOT_WHEEL,
@@ -3433,6 +3457,17 @@ void InitElementPropertiesStatic()
     -1
   };
 
+  static int ep_acid_pool[] =
+  {
+    EL_ACID_POOL_TOPLEFT,
+    EL_ACID_POOL_TOPRIGHT,
+    EL_ACID_POOL_BOTTOMLEFT,
+    EL_ACID_POOL_BOTTOM,
+    EL_ACID_POOL_BOTTOMRIGHT,
+
+    -1
+  };
+
   static int ep_keygate[] =
   {
     EL_GATE_1,
@@ -3566,6 +3601,7 @@ void InitElementPropertiesStatic()
     EL_STEELWALL,
     EL_AMOEBA_DEAD,
     EL_QUICKSAND_EMPTY,
+    EL_QUICKSAND_FAST_EMPTY,
     EL_STONEBLOCK,
     EL_ROBOT_WHEEL,
     EL_KEY_1,
@@ -3650,6 +3686,8 @@ void InitElementPropertiesStatic()
     EL_MAGIC_WALL_DEAD,
     EL_BD_MAGIC_WALL,
     EL_BD_MAGIC_WALL_DEAD,
+    EL_DC_MAGIC_WALL,
+    EL_DC_MAGIC_WALL_DEAD,
     EL_AMOEBA_TO_DIAMOND,
     EL_BLOCKED,
     EL_SP_EMPTY,
@@ -3883,6 +3921,7 @@ void InitElementPropertiesStatic()
 
     { ep_player,                       EP_PLAYER                       },
     { ep_can_pass_magic_wall,          EP_CAN_PASS_MAGIC_WALL          },
+    { ep_can_pass_dc_magic_wall,       EP_CAN_PASS_DC_MAGIC_WALL       },
     { ep_switchable,                   EP_SWITCHABLE                   },
     { ep_bd_element,                   EP_BD_ELEMENT                   },
     { ep_sp_element,                   EP_SP_ELEMENT                   },
@@ -3898,6 +3937,7 @@ void InitElementPropertiesStatic()
     { ep_belt_active,                  EP_BELT_ACTIVE                  },
     { ep_belt_switch,                  EP_BELT_SWITCH                  },
     { ep_tube,                         EP_TUBE                         },
+    { ep_acid_pool,                    EP_ACID_POOL                    },
     { ep_keygate,                      EP_KEYGATE                      },
     { ep_amoeboid,                     EP_AMOEBOID                     },
     { ep_amoebalive,                   EP_AMOEBALIVE                   },