int init_delay_counter;
int state;
+
+ int last_state, last_active_part_nr;
};
struct GlobalAnimControlInfo
{
struct GlobalAnimPartControlInfo *part;
struct GraphicInfo *c = &anim->control_info;
+ int state, active_part_nr;
#if 0
printf("::: HandleGlobalAnim_Main: %d, %d => %d\n",
switch (action)
{
case ANIM_START:
- anim->state = ANIM_STATE_RESTART;
+ anim->state = anim->last_state = ANIM_STATE_RESTART;
+ anim->active_part_nr = anim->last_active_part_nr = 0;
anim->part_counter = 0;
- anim->active_part_nr = 0;
break;
if (anim->state == ANIM_STATE_INACTIVE)
return;
+ anim->state = anim->last_state;
+ anim->active_part_nr = anim->last_active_part_nr;
+
break;
case ANIM_STOP:
part->state = ANIM_STATE_INACTIVE;
}
+ anim->last_state = anim->state;
+ anim->last_active_part_nr = anim->active_part_nr;
+
return;
}
if (c->anim_mode & ANIM_ONCE &&
anim->part_counter == anim->num_parts)
anim->state = ANIM_STATE_INACTIVE;
+
+ state = anim->state;
+ active_part_nr = anim->active_part_nr;
+
+ // while the animation parts are pausing (waiting or inactive), play the base
+ // (main) animation; this corresponds to the "boring player animation" logic
+ // (!!! KLUDGE WARNING: I THINK THIS IS A MESS THAT SHOULD BE CLEANED UP !!!)
+ if (anim->has_base)
+ {
+ if (anim->state == ANIM_STATE_WAITING ||
+ anim->state == ANIM_STATE_INACTIVE)
+ {
+ anim->active_part_nr = anim->num_parts; // part nr of base animation
+ part = &anim->part[anim->active_part_nr];
+
+ if (anim->state != anim->last_state)
+ part->state = ANIM_STATE_RESTART;
+
+ anim->state = ANIM_STATE_RUNNING;
+ part->state = HandleGlobalAnim_Part(part, part->state);
+ }
+ }
+
+ anim->last_state = state;
+ anim->last_active_part_nr = active_part_nr;
}
void HandleGlobalAnim_Mode(struct GlobalAnimControlInfo *ctrl, int action)