{
ResetDelayCounterExt(&part->step_delay, anim_sync_frame);
- part->initial_anim_sync_frame = (g->anim_global_sync ? 0 : anim_sync_frame);
+ part->init_delay_value =
+ (c->init_delay_fixed + GetSimpleRandom(c->init_delay_random));
+
+ part->initial_anim_sync_frame =
+ (g->anim_global_sync ? 0 : anim_sync_frame + part->init_delay_value);
+
part->step_frames = 0;
if (c->direction & MV_HORIZONTAL)
part->step_yoffset = c->step_yoffset;
}
+ if (part->init_delay_value > 0)
+ {
+ part->init_delay_value--;
+
+ return ANIM_STATE_WAITING;
+ }
+
if ((part->x <= -g->width && part->step_xoffset <= 0) ||
(part->x >= FULL_SXSIZE && part->step_xoffset >= 0) ||
(part->y <= -g->height && part->step_yoffset <= 0) ||
{
struct GlobalAnimPartControlInfo *part;
struct GraphicInfo *c = &anim->control_info;
- struct GraphicInfo *cp;
boolean skip = FALSE;
#if 0
for (i = 0; i < num_parts; i++)
{
part = &anim->part[i];
- cp = &part->control_info;
switch (action)
{
break;
}
- if (skip)
- continue;
-
- if (part->state & ANIM_STATE_RESTART)
- {
-#if 0
- printf("::: RESTART %d.%d\n", part->anim_nr, part->nr);
-#endif
-
- if (!(part->state & ANIM_STATE_WAITING))
- {
#if 0
- printf("::: WAITING %d.%d\n", part->anim_nr, part->nr);
+ printf("::: LOOPING ...\n");
#endif
- ResetDelayCounterExt(&part->init_delay, anim_sync_frame);
-
- part->init_delay_value =
- (cp->init_delay_fixed + GetSimpleRandom(cp->init_delay_random));
-
- part->state |= ANIM_STATE_WAITING;
- }
-
- if (!DelayReachedExt(&part->init_delay, part->init_delay_value,
- anim_sync_frame))
- return;
+ if (skip)
+ continue;
#if 0
- printf("::: RUNNING %d.%d\n", part->anim_nr, part->nr);
+ printf("::: DO PART (1) %d.%d [%d, %d, %d] [%d] [%d / %d]\n",
+ part->anim_nr, part->nr,
+ part->state & ANIM_STATE_RESTART,
+ part->state & ANIM_STATE_WAITING,
+ part->state & ANIM_STATE_RUNNING,
+ anim->state & ANIM_STATE_RUNNING,
+ part->step_frames, part->step_frames_value);
#endif
- part->state = ANIM_STATE_RESTART | ANIM_STATE_RUNNING;
- }
+ part->state = HandleGlobalAnim_Part(part, part->state);
#if 0
- printf("::: DO PART %d.%d [%d, %d, %d] [%d]\n", part->anim_nr, part->nr,
- part->restart, part->waiting, part->running,
- anim->running);
+ printf("::: DO PART (2) %d.%d [%d, %d, %d] [%d] [%d / %d]\n",
+ part->anim_nr, part->nr,
+ part->state & ANIM_STATE_RESTART,
+ part->state & ANIM_STATE_WAITING,
+ part->state & ANIM_STATE_RUNNING,
+ anim->state & ANIM_STATE_RUNNING,
+ part->step_frames, part->step_frames_value);
#endif
-
- part->state = HandleGlobalAnim_Part(part, part->state);
}
return;
part = &anim->part[anim->active_part_nr];
- if (anim->state & ANIM_STATE_RESTART)
- {
- if (!(anim->state & ANIM_STATE_WAITING))
- {
- cp = &part->control_info;
-
- ResetDelayCounterExt(&part->init_delay, anim_sync_frame);
-
- part->init_delay_value =
- (cp->init_delay_fixed + GetSimpleRandom(cp->init_delay_random));
-
- anim->state |= ANIM_STATE_WAITING;
- }
-
- if (!DelayReachedExt(&part->init_delay, part->init_delay_value,
- anim_sync_frame))
- return;
-
- anim->state = ANIM_STATE_RESTART | ANIM_STATE_RUNNING;
- }
-
part->state = ANIM_STATE_RUNNING;
anim->state = HandleGlobalAnim_Part(part, anim->state);