X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fanim.c;h=c4952d700167e4516274d694648cf70c51262ecc;hb=cb0ddc73cbd791f57009f4b2e9037069fb6cdff0;hp=7f6691f0fac1f6c82a4fc7909fa457c97b3b9175;hpb=58fc601f4e35d990c69afc015ed3f1061f7f5c87;p=rocksndiamonds.git diff --git a/src/anim.c b/src/anim.c index 7f6691f0..c4952d70 100644 --- a/src/anim.c +++ b/src/anim.c @@ -124,7 +124,8 @@ struct GlobalAnimPartControlInfo unsigned int initial_anim_sync_frame; unsigned int anim_random_frame; - unsigned int step_delay, step_delay_value; + + DelayCounter step_delay; int init_delay_counter; int anim_delay_counter; @@ -410,7 +411,8 @@ static void InitToonControls(void) int sound = SND_UNDEFINED; int music = MUS_UNDEFINED; int graphic = IMG_TOON_1 + i; - int control = graphic; + + control = graphic; part->nr = part_nr; part->anim_nr = anim_nr; @@ -436,8 +438,8 @@ static void InitToonControls(void) part->initial_anim_sync_frame = 0; part->anim_random_frame = -1; - part->step_delay = 0; - part->step_delay_value = graphic_info[control].step_delay; + part->step_delay.count = 0; + part->step_delay.value = graphic_info[control].step_delay; part->state = ANIM_STATE_INACTIVE; part->last_anim_status = -1; @@ -543,8 +545,8 @@ static void InitGlobalAnimControls(void) part->initial_anim_sync_frame = 0; part->anim_random_frame = -1; - part->step_delay = 0; - part->step_delay_value = graphic_info[control].step_delay; + part->step_delay.count = 0; + part->step_delay.value = graphic_info[control].step_delay; part->state = ANIM_STATE_INACTIVE; part->last_anim_status = -1; @@ -1175,12 +1177,12 @@ static boolean isClickedPart(struct GlobalAnimPartControlInfo *part, static boolean clickBlocked(struct GlobalAnimPartControlInfo *part) { - return (part->control_info.style & STYLE_BLOCK ? TRUE : FALSE); + return ((part->control_info.style & STYLE_BLOCK) ? TRUE : FALSE); } static boolean clickConsumed(struct GlobalAnimPartControlInfo *part) { - return (part->control_info.style & STYLE_PASSTHROUGH ? FALSE : TRUE); + return ((part->control_info.style & STYLE_PASSTHROUGH) ? FALSE : TRUE); } static void InitGlobalAnim_Triggered(struct GlobalAnimPartControlInfo *part, @@ -1531,8 +1533,7 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, // special case to prevent expiring loop sounds when playing PlayGlobalAnimSoundIfLoop(part); - if (!DelayReachedExt(&part->step_delay, part->step_delay_value, - anim_sync_frame)) + if (!DelayReachedExt(&part->step_delay, anim_sync_frame)) return ANIM_STATE_RUNNING; #if 0