From: Holger Schemel Date: Sun, 20 Aug 2023 14:36:36 +0000 (+0200) Subject: fixed one-frame delay when global animations leave "init" state X-Git-Tag: 4.3.7.0~24 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c9f607a3507174565b5228cc03f9a31169baa8c8;p=rocksndiamonds.git fixed one-frame delay when global animations leave "init" state This fixes a bug for global animations which either have an initial delay or an initial event defined, causing a delay of one screen frame after the initial waiting state has ended and before the running state (which displays the global animation) is started. This can especially be visible if a changing CE is graphically replaced with a global animation triggered by the CE change. --- diff --git a/src/anim.c b/src/anim.c index c1fb1ee6..de94b17f 100644 --- a/src/anim.c +++ b/src/anim.c @@ -1598,7 +1598,7 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, if (part->initial_anim_sync_frame > 0) { if (part->init_delay_counter > 0) - part->initial_anim_sync_frame -= part->init_delay_counter - 1; + part->initial_anim_sync_frame -= part->init_delay_counter; else part->initial_anim_sync_frame = anim_sync_frame; } @@ -1630,9 +1630,13 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, HandleGlobalAnimDelay(part, ANIM_DELAY_INIT, "START [INIT_DELAY]"); HandleGlobalAnimEvent(part, ANIM_EVENT_START, "START [ANIM]"); - } - return ANIM_STATE_WAITING; + // continue with state ANIM_STATE_RUNNING (set below) + } + else + { + return ANIM_STATE_WAITING; + } } if (part->init_event_state)