reverted setting (and maybe inheriting) draw order for global animations
authorHolger Schemel <info@artsoft.org>
Wed, 13 Dec 2023 16:06:03 +0000 (17:06 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 13 Dec 2023 16:06:03 +0000 (17:06 +0100)
Although this feature seems to be quite useful (setting draw order for
main animations once, and let animation parts inherit the draw order
from the main animation if it is not defined for the animation part),
it would have to be implemented for all other attributes, too (like X
and Y position of the main animation and animation parts, for example),
so it seems to be better to not make an exception for this specific
attribute.

This reverts commit 895d5cb3.

src/anim.c
src/init.c

index e836ff6a3aaf8ff85dabe6b0679111df38133f88..cdc0fd0574363fc39f82a6dd9c19fd5f1060a77d 100644 (file)
@@ -531,10 +531,6 @@ static void InitGlobalAnimControls(void)
 
       anim->state = ANIM_STATE_INACTIVE;
 
-      // if draw order is undefined, set to default value "0"
-      if (anim->control_info.draw_order == ARG_UNDEFINED_VALUE)
-       anim->control_info.draw_order = 0;
-
       part_nr = 0;
 
       for (p = 0; p < NUM_GLOBAL_ANIM_PARTS_ALL; p++)
@@ -606,10 +602,6 @@ static void InitGlobalAnimControls(void)
        if (part->control_info.class == get_hash_from_key("pointer") &&
            part->control_info.style == STYLE_DEFAULT)
          part->control_info.style |= STYLE_PASSTHROUGH;
-
-       // if draw order is undefined, inherit it from main animation
-       if (part->control_info.draw_order == ARG_UNDEFINED_VALUE)
-         part->control_info.draw_order = anim->control_info.draw_order;
       }
 
       if (anim->num_parts > 0 || anim->has_base)
index 45945dcd2d2f7868056be394ef789c4b34bf293c..af11e4c7a5242329fcab1d5c112ddf05c50b90bb 100644 (file)
@@ -722,23 +722,14 @@ static void InitGlobalAnimGraphicInfo(void)
     struct GraphicInfo *g = &graphic_info[graphic];
     struct FileInfo *image = getImageListEntryFromImageID(graphic);
     char **parameter_raw = image->parameter;
-    int p1 = GFX_ARG_DRAW_MASKED;
-    int p2 = GFX_ARG_DRAW_ORDER;
-    int draw_masked = get_graphic_parameter_value(parameter_raw[p1],
-                                                 image_config_suffix[p1].token,
-                                                 image_config_suffix[p1].type);
-    int draw_order = get_graphic_parameter_value(parameter_raw[p2],
-                                                image_config_suffix[p2].token,
-                                                image_config_suffix[p2].type);
+    int p = GFX_ARG_DRAW_MASKED;
+    int draw_masked = get_graphic_parameter_value(parameter_raw[p],
+                                                 image_config_suffix[p].token,
+                                                 image_config_suffix[p].type);
 
     // if ".draw_masked" parameter is undefined, use default value "TRUE"
     if (draw_masked == ARG_UNDEFINED_VALUE)
       g->draw_masked = TRUE;
-
-    // if ".draw_order" parameter is undefined, set back to "undefined"
-    // (used to be able to inherit draw order from main animation later)
-    if (draw_order == ARG_UNDEFINED_VALUE)
-      g->draw_order = ARG_UNDEFINED_VALUE;
   }
 
 #if 0
@@ -1666,10 +1657,6 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
   if (parameter[GFX_ARG_DRAW_MASKED] != ARG_UNDEFINED_VALUE)
     g->draw_masked = parameter[GFX_ARG_DRAW_MASKED];
 
-  // use a different default value for global animations (corrected later)
-  if (graphic >= IMG_GLOBAL_ANIM_1 && graphic <= IMG_GLOBAL_ANIM_32)
-    g->draw_order = ARG_UNDEFINED_VALUE;
-
   // used for toon animations and global animations
   if (parameter[GFX_ARG_DRAW_ORDER] != ARG_UNDEFINED_VALUE)
     g->draw_order = parameter[GFX_ARG_DRAW_ORDER];