From: Holger Schemel Date: Sun, 14 Feb 2016 15:58:52 +0000 (+0100) Subject: removed global animation configuration option '.step_frames' again X-Git-Tag: 4.0.0.0-rc1~70 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d84b80f3e24a3b3e5537d7636ea2ad9809612214;p=rocksndiamonds.git removed global animation configuration option '.step_frames' again --- diff --git a/src/cartoons.c b/src/cartoons.c index 3eb9eed8..efe9ebcd 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -33,7 +33,6 @@ struct GlobalAnimPartControlInfo int step_xoffset, step_yoffset; unsigned int initial_anim_sync_frame; - unsigned int step_frames, step_frames_value; unsigned int step_delay, step_delay_value; unsigned int init_delay, init_delay_value; @@ -209,9 +208,6 @@ static void InitToonControls() part->control_info.x = ARG_UNDEFINED_VALUE; part->control_info.y = ARG_UNDEFINED_VALUE; - part->step_frames = 0; - part->step_frames_value = graphic_info[control].step_frames; - part->step_delay = 0; part->step_delay_value = graphic_info[control].step_delay; @@ -296,9 +292,6 @@ void InitGlobalAnimControls() part->graphic_info = graphic_info[graphic]; part->control_info = graphic_info[control]; - part->step_frames = 0; - part->step_frames_value = graphic_info[control].step_frames; - part->step_delay = 0; part->step_delay_value = graphic_info[control].step_delay; @@ -355,7 +348,7 @@ void DrawGlobalAnim() int part_first, part_last; int part_nr; - if (anim->state != ANIM_STATE_RUNNING) + if (!(anim->state & ANIM_STATE_RUNNING)) continue; part_first = part_last = anim->active_part_nr; @@ -383,7 +376,7 @@ void DrawGlobalAnim() int sync_frame; int frame; - if (part->state != ANIM_STATE_RUNNING) + if (!(part->state & ANIM_STATE_RUNNING)) continue; if (part->x < 0) @@ -437,11 +430,12 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) part->init_delay_value = (c->init_delay_fixed + GetSimpleRandom(c->init_delay_random)); + part->anim_delay_value = + (c->anim_delay_fixed + GetSimpleRandom(c->anim_delay_random)); + part->initial_anim_sync_frame = (g->anim_global_sync ? 0 : anim_sync_frame + part->init_delay_value); - part->step_frames = 0; - if (c->direction & MV_HORIZONTAL) { int pos_bottom = FULL_SYSIZE - g->height; @@ -529,9 +523,13 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) (part->y >= FULL_SYSIZE && part->step_yoffset >= 0)) return ANIM_STATE_RESTART; - if (part->step_frames_value != ARG_UNDEFINED_VALUE && - part->step_frames >= part->step_frames_value) - return ANIM_STATE_RESTART; + if (part->anim_delay_value > 0) + { + part->anim_delay_value--; + + if (part->anim_delay_value == 0) + return ANIM_STATE_RESTART | ANIM_STATE_RUNNING; + } if (!DelayReachedExt(&part->step_delay, part->step_delay_value, anim_sync_frame)) @@ -552,8 +550,6 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) part->x += part->step_xoffset; part->y += part->step_yoffset; - part->step_frames++; - return ANIM_STATE_RUNNING; } @@ -646,34 +642,10 @@ void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action) break; } -#if 0 - printf("::: LOOPING ...\n"); -#endif - if (skip) continue; -#if 0 - printf("::: DO PART (1) %d.%d [%d, %d, %d] [%d] [%d / %d]\n", - part->anim_nr, part->nr, - part->state & ANIM_STATE_RESTART, - part->state & ANIM_STATE_WAITING, - part->state & ANIM_STATE_RUNNING, - anim->state & ANIM_STATE_RUNNING, - part->step_frames, part->step_frames_value); -#endif - part->state = HandleGlobalAnim_Part(part, part->state); - -#if 0 - printf("::: DO PART (2) %d.%d [%d, %d, %d] [%d] [%d / %d]\n", - part->anim_nr, part->nr, - part->state & ANIM_STATE_RESTART, - part->state & ANIM_STATE_WAITING, - part->state & ANIM_STATE_RUNNING, - anim->state & ANIM_STATE_RUNNING, - part->step_frames, part->step_frames_value); -#endif } return; @@ -682,7 +654,7 @@ void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action) if (skip) return; - if (anim->state == ANIM_STATE_RESTART) // directly after restart + if (anim->state & ANIM_STATE_RESTART) // directly after restart anim->active_part_nr = getGlobalAnimationPart(anim); part = &anim->part[anim->active_part_nr]; @@ -691,7 +663,7 @@ void HandleGlobalAnim_Main(struct GlobalAnimMainControlInfo *anim, int action) anim->state = HandleGlobalAnim_Part(part, anim->state); - if (anim->state == ANIM_STATE_RESTART) + if (anim->state & ANIM_STATE_RESTART) anim->part_counter++; } diff --git a/src/conf_gfx.c b/src/conf_gfx.c index ed2d85eb..04db35ad 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -47,7 +47,6 @@ struct ConfigTypeInfo image_config_suffix[] = { ".step_offset", "4", TYPE_INTEGER }, { ".step_xoffset", ARG_UNDEFINED, TYPE_INTEGER }, { ".step_yoffset", ARG_UNDEFINED, TYPE_INTEGER }, - { ".step_frames", 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 bda77b8b..0aa2f102 100644 --- a/src/init.c +++ b/src/init.c @@ -1352,7 +1352,6 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, 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_frames = parameter[GFX_ARG_STEP_FRAMES]; g->step_delay = parameter[GFX_ARG_STEP_DELAY]; g->direction = parameter[GFX_ARG_DIRECTION]; g->position = parameter[GFX_ARG_POSITION]; diff --git a/src/main.h b/src/main.h index 9cf276a2..1e97b9c9 100644 --- a/src/main.h +++ b/src/main.h @@ -1868,39 +1868,38 @@ #define GFX_ARG_STEP_OFFSET 25 #define GFX_ARG_STEP_XOFFSET 26 #define GFX_ARG_STEP_YOFFSET 27 -#define GFX_ARG_STEP_FRAMES 28 -#define GFX_ARG_STEP_DELAY 29 -#define GFX_ARG_DIRECTION 30 -#define GFX_ARG_POSITION 31 -#define GFX_ARG_DRAW_XOFFSET 32 -#define GFX_ARG_DRAW_YOFFSET 33 -#define GFX_ARG_DRAW_MASKED 34 -#define GFX_ARG_DRAW_ORDER 35 -#define GFX_ARG_INIT_DELAY_FIXED 36 -#define GFX_ARG_INIT_DELAY_RANDOM 37 -#define GFX_ARG_ANIM_DELAY_FIXED 38 -#define GFX_ARG_ANIM_DELAY_RANDOM 39 -#define GFX_ARG_POST_DELAY_FIXED 40 -#define GFX_ARG_POST_DELAY_RANDOM 41 -#define GFX_ARG_NAME 42 -#define GFX_ARG_SCALE_UP_FACTOR 43 -#define GFX_ARG_TILE_SIZE 44 -#define GFX_ARG_CLONE_FROM 45 -#define GFX_ARG_FADE_MODE 46 -#define GFX_ARG_FADE_DELAY 47 -#define GFX_ARG_POST_DELAY 48 -#define GFX_ARG_AUTO_DELAY 49 -#define GFX_ARG_ALIGN 50 -#define GFX_ARG_VALIGN 51 -#define GFX_ARG_SORT_PRIORITY 52 -#define GFX_ARG_CLASS 53 -#define GFX_ARG_STYLE 54 -#define GFX_ARG_ACTIVE_XOFFSET 55 -#define GFX_ARG_ACTIVE_YOFFSET 56 -#define GFX_ARG_PRESSED_XOFFSET 57 -#define GFX_ARG_PRESSED_YOFFSET 58 - -#define NUM_GFX_ARGS 59 +#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_DRAW_ORDER 34 +#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 */ @@ -2822,15 +2821,14 @@ struct GraphicInfo 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 */ - int post_delay_random; /* next intervall (bored animation only) */ + int anim_delay_fixed; /* optional delay values for bored/sleeping */ + int anim_delay_random; /* and global animations (animation length) */ + int post_delay_fixed; /* optional delay values after bored/global */ + int post_delay_random; /* animations (pause before next animation) */ 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_frames; /* optional step frames 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 */