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.
if (part->initial_anim_sync_frame > 0)
{
if (part->init_delay_counter > 0)
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;
}
else
part->initial_anim_sync_frame = anim_sync_frame;
}
HandleGlobalAnimDelay(part, ANIM_DELAY_INIT, "START [INIT_DELAY]");
HandleGlobalAnimEvent(part, ANIM_EVENT_START, "START [ANIM]");
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)
}
if (part->init_event_state)