rnd-20031004-1-src
[rocksndiamonds.git] / src / init.c
index 1af2f48ee58f11b1eeb9b9126c2353df3efee9fa..c7a199118fea2390f170d8c2bbdc212910a0a1a8 100644 (file)
@@ -291,8 +291,13 @@ void InitFontGraphicInfo()
   /* ---------- initialize font graphic definitions ---------- */
 
   /* always start with reliable default values (normal font graphics) */
+#if 1
+  for (i=0; i < NUM_FONTS; i++)
+    font_info[i].graphic = IMG_FONT_INITIAL_1;
+#else
   for (i=0; i < NUM_FONTS; i++)
     font_info[i].graphic = FONT_INITIAL_1;
+#endif
 
   /* initialize normal font/graphic mapping from static configuration */
   for (i=0; font_to_graphic[i].font_nr > -1; i++)
@@ -665,6 +670,34 @@ void InitElementGraphicInfo()
     }
   }
 
+#if 1
+  /* set animation mode to "none" for each graphic with only 1 frame */
+  for (i=0; i<MAX_NUM_ELEMENTS; i++)
+  {
+    for (act=0; act<NUM_ACTIONS; act++)
+    {
+      int graphic = element_info[i].graphic[act];
+      int crumbled = element_info[i].crumbled[act];
+
+      if (graphic_info[graphic].anim_frames == 1)
+       graphic_info[graphic].anim_mode = ANIM_NONE;
+      if (graphic_info[crumbled].anim_frames == 1)
+       graphic_info[crumbled].anim_mode = ANIM_NONE;
+
+      for (dir=0; dir<NUM_DIRECTIONS; dir++)
+      {
+       graphic = element_info[i].direction_graphic[act][dir];
+       crumbled = element_info[i].direction_crumbled[act][dir];
+
+       if (graphic_info[graphic].anim_frames == 1)
+         graphic_info[graphic].anim_mode = ANIM_NONE;
+       if (graphic_info[crumbled].anim_frames == 1)
+         graphic_info[crumbled].anim_mode = ANIM_NONE;
+      }
+    }
+  }
+#endif
+
 #if 0
 #if DEBUG
   if (options.verbose)
@@ -748,16 +781,11 @@ static int get_element_from_token(char *token)
 static void set_graphic_parameters(int graphic, char **parameter_raw)
 {
   Bitmap *src_bitmap = getBitmapFromImageID(graphic);
-  boolean special_envelope_graphic;
   int parameter[NUM_GFX_ARGS];
   int anim_frames_per_row = 1, anim_frames_per_col = 1;
   int anim_frames_per_line = 1;
   int i;
 
-  special_envelope_graphic = (graphic == IMG_GAME_ENVELOPE_BACKGROUND ||
-                             (graphic >= IMG_GAME_ENVELOPE_1_BACKGROUND &&
-                              graphic <= IMG_GAME_ENVELOPE_4_BACKGROUND));
-
   /* get integer values from string parameters */
   for (i=0; i < NUM_GFX_ARGS; i++)
   {
@@ -847,8 +875,10 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
     graphic_info[graphic].anim_delay = 1;
 
   graphic_info[graphic].anim_mode = parameter[GFX_ARG_ANIM_MODE];
-  if (graphic_info[graphic].anim_frames == 1 && !special_envelope_graphic)
+#if 0
+  if (graphic_info[graphic].anim_frames == 1)
     graphic_info[graphic].anim_mode = ANIM_NONE;
+#endif
 
   /* automatically determine correct start frame, if not defined */
   if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE)
@@ -884,10 +914,6 @@ static void set_graphic_parameters(int graphic, char **parameter_raw)
 
   /* this is only used for drawing envelope graphics */
   graphic_info[graphic].draw_masked = parameter[GFX_ARG_DRAW_MASKED];
-
-  /* global envelope settings override specific settings, if undefined */
-  if (special_envelope_graphic && graphic_info[graphic].bitmap == NULL)
-    graphic_info[graphic] = graphic_info[IMG_GAME_ENVELOPE_BACKGROUND];
 }
 
 static void InitGraphicInfo()