From: Holger Schemel Date: Wed, 20 Jan 2016 20:33:14 +0000 (+0100) Subject: added some configuration options for global animation properties X-Git-Tag: 4.0.0.0-rc1~95 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1907a314668338eb542080062ca81d95451ca9db;p=rocksndiamonds.git added some configuration options for global animation properties --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 461dd981..860f53d4 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -45,6 +45,8 @@ struct ConfigTypeInfo image_config_suffix[] = { ".diggable_like", ARG_UNDEFINED, TYPE_ELEMENT }, { ".border_size", ARG_UNDEFINED, TYPE_INTEGER }, { ".step_offset", "4", TYPE_INTEGER }, + { ".step_xoffset", ARG_UNDEFINED, TYPE_INTEGER }, + { ".step_yoffset", ARG_UNDEFINED, TYPE_INTEGER }, { ".step_delay", "1", TYPE_INTEGER }, { ".direction", ARG_UNDEFINED, TYPE_STRING }, { ".position", ARG_UNDEFINED, TYPE_STRING }, diff --git a/src/init.c b/src/init.c index 9493ab51..6a48f576 100644 --- a/src/init.c +++ b/src/init.c @@ -1335,8 +1335,12 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->post_delay_random = parameter[GFX_ARG_POST_DELAY_RANDOM]; /* this is only used for toon animations */ - g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; - g->step_delay = parameter[GFX_ARG_STEP_DELAY]; + g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; + g->step_xoffset = parameter[GFX_ARG_STEP_XOFFSET]; + g->step_yoffset = parameter[GFX_ARG_STEP_YOFFSET]; + g->step_delay = parameter[GFX_ARG_STEP_DELAY]; + g->direction = parameter[GFX_ARG_DIRECTION]; + g->position = parameter[GFX_ARG_POSITION]; /* this is only used for drawing font characters */ g->draw_xoffset = parameter[GFX_ARG_DRAW_XOFFSET]; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 7d5268c2..4498e7f4 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2653,6 +2653,17 @@ int get_parameter_value(char *value_raw, char *suffix, int type) strEqual(value, "up") ? MV_UP : strEqual(value, "down") ? MV_DOWN : MV_NONE); } + else if (strEqual(suffix, ".position")) + { + result = (strEqual(value, "left") ? POS_LEFT : + strEqual(value, "right") ? POS_RIGHT : + strEqual(value, "top") ? POS_TOP : + strEqual(value, "upper") ? POS_UPPER : + strEqual(value, "middle") ? POS_MIDDLE : + strEqual(value, "lower") ? POS_LOWER : + strEqual(value, "bottom") ? POS_BOTTOM : + strEqual(value, "any") ? POS_ANY : POS_UNDEFINED); + } else if (strEqual(suffix, ".align")) { result = (strEqual(value, "left") ? ALIGN_LEFT : @@ -2681,6 +2692,7 @@ int get_parameter_value(char *value_raw, char *suffix, int type) string_has_parameter(value, "horizontal") ? ANIM_HORIZONTAL : string_has_parameter(value, "vertical") ? ANIM_VERTICAL : string_has_parameter(value, "centered") ? ANIM_CENTERED : + string_has_parameter(value, "all") ? ANIM_ALL : ANIM_DEFAULT); if (string_has_parameter(value, "reverse")) diff --git a/src/libgame/system.h b/src/libgame/system.h index 9fd22f15..a27653da 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -238,6 +238,7 @@ #define ANIM_VERTICAL (1 << 11) #define ANIM_CENTERED (1 << 12) #define ANIM_STATIC_PANEL (1 << 13) +#define ANIM_ALL (1 << 14) #define ANIM_DEFAULT ANIM_LOOP @@ -271,6 +272,17 @@ #define FADE_MODE_DEFAULT FADE_MODE_FADE +/* values for toon positions */ +#define POS_UNDEFINED -1 +#define POS_LEFT 0 +#define POS_RIGHT 1 +#define POS_TOP 2 +#define POS_UPPER 3 +#define POS_MIDDLE 4 +#define POS_LOWER 5 +#define POS_BOTTOM 6 +#define POS_ANY 7 + /* values for text alignment */ #define ALIGN_LEFT (1 << 0) #define ALIGN_RIGHT (1 << 1) diff --git a/src/main.h b/src/main.h index 2cbb77f0..fd07d4e2 100644 --- a/src/main.h +++ b/src/main.h @@ -1864,35 +1864,37 @@ #define GFX_ARG_DIGGABLE_LIKE 23 #define GFX_ARG_BORDER_SIZE 24 #define GFX_ARG_STEP_OFFSET 25 -#define GFX_ARG_STEP_DELAY 26 -#define GFX_ARG_DIRECTION 27 -#define GFX_ARG_POSITION 28 -#define GFX_ARG_DRAW_XOFFSET 29 -#define GFX_ARG_DRAW_YOFFSET 30 -#define GFX_ARG_DRAW_MASKED 31 -#define GFX_ARG_ANIM_DELAY_FIXED 32 -#define GFX_ARG_ANIM_DELAY_RANDOM 33 -#define GFX_ARG_POST_DELAY_FIXED 34 -#define GFX_ARG_POST_DELAY_RANDOM 35 -#define GFX_ARG_NAME 36 -#define GFX_ARG_SCALE_UP_FACTOR 37 -#define GFX_ARG_TILE_SIZE 38 -#define GFX_ARG_CLONE_FROM 39 -#define GFX_ARG_FADE_MODE 40 -#define GFX_ARG_FADE_DELAY 41 -#define GFX_ARG_POST_DELAY 42 -#define GFX_ARG_AUTO_DELAY 43 -#define GFX_ARG_ALIGN 44 -#define GFX_ARG_VALIGN 45 -#define GFX_ARG_SORT_PRIORITY 46 -#define GFX_ARG_CLASS 47 -#define GFX_ARG_STYLE 48 -#define GFX_ARG_ACTIVE_XOFFSET 49 -#define GFX_ARG_ACTIVE_YOFFSET 50 -#define GFX_ARG_PRESSED_XOFFSET 51 -#define GFX_ARG_PRESSED_YOFFSET 52 - -#define NUM_GFX_ARGS 53 +#define GFX_ARG_STEP_XOFFSET 26 +#define GFX_ARG_STEP_YOFFSET 27 +#define GFX_ARG_STEP_DELAY 28 +#define GFX_ARG_DIRECTION 29 +#define GFX_ARG_POSITION 30 +#define GFX_ARG_DRAW_XOFFSET 31 +#define GFX_ARG_DRAW_YOFFSET 32 +#define GFX_ARG_DRAW_MASKED 33 +#define GFX_ARG_ANIM_DELAY_FIXED 34 +#define GFX_ARG_ANIM_DELAY_RANDOM 35 +#define GFX_ARG_POST_DELAY_FIXED 36 +#define GFX_ARG_POST_DELAY_RANDOM 37 +#define GFX_ARG_NAME 38 +#define GFX_ARG_SCALE_UP_FACTOR 39 +#define GFX_ARG_TILE_SIZE 40 +#define GFX_ARG_CLONE_FROM 41 +#define GFX_ARG_FADE_MODE 42 +#define GFX_ARG_FADE_DELAY 43 +#define GFX_ARG_POST_DELAY 44 +#define GFX_ARG_AUTO_DELAY 45 +#define GFX_ARG_ALIGN 46 +#define GFX_ARG_VALIGN 47 +#define GFX_ARG_SORT_PRIORITY 48 +#define GFX_ARG_CLASS 49 +#define GFX_ARG_STYLE 50 +#define GFX_ARG_ACTIVE_XOFFSET 51 +#define GFX_ARG_ACTIVE_YOFFSET 52 +#define GFX_ARG_PRESSED_XOFFSET 53 +#define GFX_ARG_PRESSED_YOFFSET 54 + +#define NUM_GFX_ARGS 55 /* values for sound configuration suffixes */ @@ -2804,7 +2806,11 @@ struct GraphicInfo int post_delay_random; /* next intervall (bored animation only) */ int step_offset; /* optional step offset of toon animations */ + int step_xoffset; /* optional step offset of toon animations */ + int step_yoffset; /* optional step offset of toon animations */ int step_delay; /* optional step delay of toon animations */ + int direction; /* optional move direction of toon animations */ + int position; /* optional draw position of toon animations */ int draw_xoffset; /* optional offset for drawing font chars */ int draw_yoffset; /* optional offset for drawing font chars */