From: Holger Schemel Date: Wed, 10 Feb 2016 00:34:07 +0000 (+0100) Subject: added some more configuration options for global animation properties X-Git-Tag: 4.0.0.0-rc1~77 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1fcb72cda932d6ce8e528fc40c87262128fa5533;p=rocksndiamonds.git added some more configuration options for global animation properties --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 6d4c8bb7..e85df278 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -54,6 +54,8 @@ struct ConfigTypeInfo image_config_suffix[] = { ".draw_xoffset", "0", TYPE_INTEGER }, { ".draw_yoffset", "0", TYPE_INTEGER }, { ".draw_masked", "false", TYPE_BOOLEAN }, + { ".init_delay_fixed", ARG_UNDEFINED, TYPE_INTEGER }, + { ".init_delay_random", ARG_UNDEFINED, TYPE_INTEGER }, { ".anim_delay_fixed", ARG_UNDEFINED, TYPE_INTEGER }, { ".anim_delay_random", ARG_UNDEFINED, TYPE_INTEGER }, { ".post_delay_fixed", ARG_UNDEFINED, TYPE_INTEGER }, diff --git a/src/init.c b/src/init.c index 209d64be..96eefb31 100644 --- a/src/init.c +++ b/src/init.c @@ -1127,6 +1127,8 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->scale_up_factor = 1; /* default: no scaling up */ g->tile_size = TILESIZE; /* default: standard tile size */ g->clone_from = -1; /* do not use clone graphic */ + g->init_delay_fixed = 0; + g->init_delay_random = 0; g->anim_delay_fixed = 0; g->anim_delay_random = 0; g->post_delay_fixed = 0; @@ -1332,7 +1334,11 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE) g->border_size = parameter[GFX_ARG_BORDER_SIZE]; - /* this is only used for player "boring" and "sleeping" actions */ + /* used for global animations and player "boring" and "sleeping" actions */ + if (parameter[GFX_ARG_INIT_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + g->init_delay_fixed = parameter[GFX_ARG_INIT_DELAY_FIXED]; + if (parameter[GFX_ARG_INIT_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + g->init_delay_random = parameter[GFX_ARG_INIT_DELAY_RANDOM]; if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE) g->anim_delay_fixed = parameter[GFX_ARG_ANIM_DELAY_FIXED]; if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) @@ -1342,7 +1348,7 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) g->post_delay_random = parameter[GFX_ARG_POST_DELAY_RANDOM]; - /* this is only used for toon animations */ + /* used for toon animations and global animations */ g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; g->step_xoffset = parameter[GFX_ARG_STEP_XOFFSET]; g->step_yoffset = parameter[GFX_ARG_STEP_YOFFSET]; diff --git a/src/main.h b/src/main.h index 0d7218ad..dc1ed998 100644 --- a/src/main.h +++ b/src/main.h @@ -1875,29 +1875,31 @@ #define GFX_ARG_DRAW_XOFFSET 32 #define GFX_ARG_DRAW_YOFFSET 33 #define GFX_ARG_DRAW_MASKED 34 -#define GFX_ARG_ANIM_DELAY_FIXED 35 -#define GFX_ARG_ANIM_DELAY_RANDOM 36 -#define GFX_ARG_POST_DELAY_FIXED 37 -#define GFX_ARG_POST_DELAY_RANDOM 38 -#define GFX_ARG_NAME 39 -#define GFX_ARG_SCALE_UP_FACTOR 40 -#define GFX_ARG_TILE_SIZE 41 -#define GFX_ARG_CLONE_FROM 42 -#define GFX_ARG_FADE_MODE 43 -#define GFX_ARG_FADE_DELAY 44 -#define GFX_ARG_POST_DELAY 45 -#define GFX_ARG_AUTO_DELAY 46 -#define GFX_ARG_ALIGN 47 -#define GFX_ARG_VALIGN 48 -#define GFX_ARG_SORT_PRIORITY 49 -#define GFX_ARG_CLASS 50 -#define GFX_ARG_STYLE 51 -#define GFX_ARG_ACTIVE_XOFFSET 52 -#define GFX_ARG_ACTIVE_YOFFSET 53 -#define GFX_ARG_PRESSED_XOFFSET 54 -#define GFX_ARG_PRESSED_YOFFSET 55 - -#define NUM_GFX_ARGS 56 +#define GFX_ARG_INIT_DELAY_FIXED 35 +#define GFX_ARG_INIT_DELAY_RANDOM 36 +#define GFX_ARG_ANIM_DELAY_FIXED 37 +#define GFX_ARG_ANIM_DELAY_RANDOM 38 +#define GFX_ARG_POST_DELAY_FIXED 39 +#define GFX_ARG_POST_DELAY_RANDOM 40 +#define GFX_ARG_NAME 41 +#define GFX_ARG_SCALE_UP_FACTOR 42 +#define GFX_ARG_TILE_SIZE 43 +#define GFX_ARG_CLONE_FROM 44 +#define GFX_ARG_FADE_MODE 45 +#define GFX_ARG_FADE_DELAY 46 +#define GFX_ARG_POST_DELAY 47 +#define GFX_ARG_AUTO_DELAY 48 +#define GFX_ARG_ALIGN 49 +#define GFX_ARG_VALIGN 50 +#define GFX_ARG_SORT_PRIORITY 51 +#define GFX_ARG_CLASS 52 +#define GFX_ARG_STYLE 53 +#define GFX_ARG_ACTIVE_XOFFSET 54 +#define GFX_ARG_ACTIVE_YOFFSET 55 +#define GFX_ARG_PRESSED_XOFFSET 56 +#define GFX_ARG_PRESSED_YOFFSET 57 + +#define NUM_GFX_ARGS 58 /* values for sound configuration suffixes */ @@ -2817,6 +2819,8 @@ struct GraphicInfo int clone_from; /* graphic for cloning *all* settings */ + int init_delay_fixed; /* optional initial delay values for global */ + int init_delay_random; /* animations (pause interval before start) */ int anim_delay_fixed; /* optional delay values for bored and */ int anim_delay_random; /* sleeping player animations (animation */ int post_delay_fixed; /* intervall and following pause before */