rnd-20021006-1-src
[rocksndiamonds.git] / src / init.c
index 2af73af732b1992e38fac21a3cc2b9b38436dfec..32b2cb8e3d6504c2f426e26ba65b554695b3c855 100644 (file)
@@ -937,10 +937,17 @@ void InitElementInfo()
     }
   }
 
+#if 0
   for (i=EL_CHAR_START; i<=EL_CHAR_END; i++)
     element_info[i].graphic[GFX_ACTION_DEFAULT] =
       GFX_CHAR_START + (i - EL_CHAR_START);
+#else
+  for (i=EL_CHAR_START; i<=EL_CHAR_END; i++)
+    element_info[i].graphic[GFX_ACTION_DEFAULT] =
+      IMG_CHAR_START + (i - EL_CHAR_START);
+#endif
 
+#if 0
   for (i=EL_SP_START; i<=EL_SP_END; i++)
   {
     int nr_element = i - EL_SP_START;
@@ -952,6 +959,7 @@ void InitElementInfo()
     element_info[i].graphic[GFX_ACTION_DEFAULT] =
       GFX_START_ROCKSSP + nr_graphic;
   }
+#endif
 
 #if 0
   /* this overrides some of the above default settings (GFX_SP_ZONK etc.) */
@@ -1017,7 +1025,7 @@ void InitElementInfo()
     int default_action_direction_graphic[NUM_MV_DIRECTIONS];
 
     if (default_action_graphic == -1)
-      default_action_graphic = EL_CHAR_QUESTION;
+      default_action_graphic = IMG_CHAR_QUESTION;
 
     for(dir=0; dir<NUM_MV_DIRECTIONS; dir++)
     {
@@ -1073,10 +1081,19 @@ static void InitGraphicInfo()
   {
     int *parameter = image_files[i].parameter;
 
-    /* always start with reliable default values */
     new_graphic_info[i].bitmap = getBitmapFromImageID(i);
+
     new_graphic_info[i].src_x = parameter[GFX_ARG_XPOS] * TILEX;
     new_graphic_info[i].src_y = parameter[GFX_ARG_YPOS] * TILEY;
+    new_graphic_info[i].offset_x = parameter[GFX_ARG_OFFSET];
+    new_graphic_info[i].offset_y = 0;
+
+    /* animation frames are ordered vertically instead of horizontally */
+    if (parameter[GFX_ARG_VERTICAL])
+    {
+      new_graphic_info[i].offset_x = 0;
+      new_graphic_info[i].offset_y = parameter[GFX_ARG_OFFSET];
+    }
 
     new_graphic_info[i].anim_frames = parameter[GFX_ARG_FRAMES];
 
@@ -1085,7 +1102,9 @@ static void InitGraphicInfo()
       new_graphic_info[i].anim_delay = 1;
 
     /* set mode for animation frame order */
-    if (parameter[GFX_ARG_MODE_LINEAR])
+    if (parameter[GFX_ARG_MODE_LOOP])
+      new_graphic_info[i].anim_mode = ANIM_LOOP;
+    else if (parameter[GFX_ARG_MODE_LINEAR])
       new_graphic_info[i].anim_mode = ANIM_LINEAR;
     else if (parameter[GFX_ARG_MODE_PINGPONG])
       new_graphic_info[i].anim_mode = ANIM_PINGPONG;
@@ -1102,8 +1121,6 @@ static void InitGraphicInfo()
 
     /* animation synchronized with global frame counter, not move position */
     new_graphic_info[i].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
-
-    new_graphic_info[i].anim_vertical = parameter[GFX_ARG_VERTICAL];
   }
 
 #if 0