From: Holger Schemel Date: Wed, 13 Apr 2016 19:10:51 +0000 (+0200) Subject: changed global animation sounds to stop before post delay X-Git-Tag: 4.0.0.0-rc1~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=afe0b7e62d2f17ad2fc32aafd930d48d4f61a017;p=rocksndiamonds.git changed global animation sounds to stop before post delay --- diff --git a/src/cartoons.c b/src/cartoons.c index 97e2ee43..2e074364 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -865,14 +865,15 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) if (part->anim_delay_counter == 0 && part->post_delay_counter == 0) { + StopGlobalAnimSound(part); + part->post_delay_counter = (c->post_delay_fixed + GetSimpleRandom(c->post_delay_random)); if (part->post_delay_counter > 0) return ANIM_STATE_RUNNING; - StopGlobalAnimSound(part); - + // drawing last frame not needed here -- animation not visible anymore return ANIM_STATE_RESTART; } } @@ -883,14 +884,14 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) if (part->anim_delay_counter == 0) { + StopGlobalAnimSound(part); + part->post_delay_counter = (c->post_delay_fixed + GetSimpleRandom(c->post_delay_random)); if (part->post_delay_counter > 0) return ANIM_STATE_RUNNING; - StopGlobalAnimSound(part); - // additional state "RUNNING" required to not skip drawing last frame return ANIM_STATE_RESTART | ANIM_STATE_RUNNING; } @@ -900,9 +901,6 @@ int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, int state) { part->post_delay_counter--; - if (part->post_delay_counter == 0) - StopGlobalAnimSound(part); - if (part->post_delay_counter == 0) return ANIM_STATE_RESTART;