int step_xoffset, step_yoffset;
unsigned int initial_anim_sync_frame;
- unsigned int step_frames, step_frames_value;
unsigned int step_delay, step_delay_value;
unsigned int init_delay, init_delay_value;
part->control_info.x = ARG_UNDEFINED_VALUE;
part->control_info.y = ARG_UNDEFINED_VALUE;
- part->step_frames = 0;
- part->step_frames_value = graphic_info[control].step_frames;
-
part->step_delay = 0;
part->step_delay_value = graphic_info[control].step_delay;
part->graphic_info = graphic_info[graphic];
part->control_info = graphic_info[control];
- part->step_frames = 0;
- part->step_frames_value = graphic_info[control].step_frames;
-
part->step_delay = 0;
part->step_delay_value = graphic_info[control].step_delay;
int part_first, part_last;
int part_nr;
- if (anim->state != ANIM_STATE_RUNNING)
+ if (!(anim->state & ANIM_STATE_RUNNING))
continue;
part_first = part_last = anim->active_part_nr;
int sync_frame;
int frame;
- if (part->state != ANIM_STATE_RUNNING)
+ if (!(part->state & ANIM_STATE_RUNNING))
continue;
if (part->x < 0)
part->init_delay_value =
(c->init_delay_fixed + GetSimpleRandom(c->init_delay_random));
+ part->anim_delay_value =
+ (c->anim_delay_fixed + GetSimpleRandom(c->anim_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)
{
int pos_bottom = FULL_SYSIZE - g->height;
(part->y >= FULL_SYSIZE && part->step_yoffset >= 0))
return ANIM_STATE_RESTART;
- if (part->step_frames_value != ARG_UNDEFINED_VALUE &&
- part->step_frames >= part->step_frames_value)
- return ANIM_STATE_RESTART;
+ if (part->anim_delay_value > 0)
+ {
+ part->anim_delay_value--;
+
+ if (part->anim_delay_value == 0)
+ return ANIM_STATE_RESTART | ANIM_STATE_RUNNING;
+ }
if (!DelayReachedExt(&part->step_delay, part->step_delay_value,
anim_sync_frame))
part->x += part->step_xoffset;
part->y += part->step_yoffset;
- part->step_frames++;
-
return ANIM_STATE_RUNNING;
}
break;
}
-#if 0
- printf("::: LOOPING ...\n");
-#endif
-
if (skip)
continue;
-#if 0
- 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 = HandleGlobalAnim_Part(part, part->state);
-
-#if 0
- 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
}
return;
if (skip)
return;
- if (anim->state == ANIM_STATE_RESTART) // directly after restart
+ if (anim->state & ANIM_STATE_RESTART) // directly after restart
anim->active_part_nr = getGlobalAnimationPart(anim);
part = &anim->part[anim->active_part_nr];
anim->state = HandleGlobalAnim_Part(part, anim->state);
- if (anim->state == ANIM_STATE_RESTART)
+ if (anim->state & ANIM_STATE_RESTART)
anim->part_counter++;
}
{ ".step_offset", "4", TYPE_INTEGER },
{ ".step_xoffset", ARG_UNDEFINED, TYPE_INTEGER },
{ ".step_yoffset", ARG_UNDEFINED, TYPE_INTEGER },
- { ".step_frames", ARG_UNDEFINED, TYPE_INTEGER },
{ ".step_delay", "1", TYPE_INTEGER },
{ ".direction", ARG_UNDEFINED, TYPE_STRING },
{ ".position", ARG_UNDEFINED, TYPE_STRING },
g->step_offset = parameter[GFX_ARG_STEP_OFFSET];
g->step_xoffset = parameter[GFX_ARG_STEP_XOFFSET];
g->step_yoffset = parameter[GFX_ARG_STEP_YOFFSET];
- g->step_frames = parameter[GFX_ARG_STEP_FRAMES];
g->step_delay = parameter[GFX_ARG_STEP_DELAY];
g->direction = parameter[GFX_ARG_DIRECTION];
g->position = parameter[GFX_ARG_POSITION];
#define GFX_ARG_STEP_OFFSET 25
#define GFX_ARG_STEP_XOFFSET 26
#define GFX_ARG_STEP_YOFFSET 27
-#define GFX_ARG_STEP_FRAMES 28
-#define GFX_ARG_STEP_DELAY 29
-#define GFX_ARG_DIRECTION 30
-#define GFX_ARG_POSITION 31
-#define GFX_ARG_DRAW_XOFFSET 32
-#define GFX_ARG_DRAW_YOFFSET 33
-#define GFX_ARG_DRAW_MASKED 34
-#define GFX_ARG_DRAW_ORDER 35
-#define GFX_ARG_INIT_DELAY_FIXED 36
-#define GFX_ARG_INIT_DELAY_RANDOM 37
-#define GFX_ARG_ANIM_DELAY_FIXED 38
-#define GFX_ARG_ANIM_DELAY_RANDOM 39
-#define GFX_ARG_POST_DELAY_FIXED 40
-#define GFX_ARG_POST_DELAY_RANDOM 41
-#define GFX_ARG_NAME 42
-#define GFX_ARG_SCALE_UP_FACTOR 43
-#define GFX_ARG_TILE_SIZE 44
-#define GFX_ARG_CLONE_FROM 45
-#define GFX_ARG_FADE_MODE 46
-#define GFX_ARG_FADE_DELAY 47
-#define GFX_ARG_POST_DELAY 48
-#define GFX_ARG_AUTO_DELAY 49
-#define GFX_ARG_ALIGN 50
-#define GFX_ARG_VALIGN 51
-#define GFX_ARG_SORT_PRIORITY 52
-#define GFX_ARG_CLASS 53
-#define GFX_ARG_STYLE 54
-#define GFX_ARG_ACTIVE_XOFFSET 55
-#define GFX_ARG_ACTIVE_YOFFSET 56
-#define GFX_ARG_PRESSED_XOFFSET 57
-#define GFX_ARG_PRESSED_YOFFSET 58
-
-#define NUM_GFX_ARGS 59
+#define GFX_ARG_STEP_DELAY 28
+#define GFX_ARG_DIRECTION 29
+#define GFX_ARG_POSITION 30
+#define GFX_ARG_DRAW_XOFFSET 31
+#define GFX_ARG_DRAW_YOFFSET 32
+#define GFX_ARG_DRAW_MASKED 33
+#define GFX_ARG_DRAW_ORDER 34
+#define GFX_ARG_INIT_DELAY_FIXED 35
+#define GFX_ARG_INIT_DELAY_RANDOM 36
+#define GFX_ARG_ANIM_DELAY_FIXED 37
+#define GFX_ARG_ANIM_DELAY_RANDOM 38
+#define GFX_ARG_POST_DELAY_FIXED 39
+#define GFX_ARG_POST_DELAY_RANDOM 40
+#define GFX_ARG_NAME 41
+#define GFX_ARG_SCALE_UP_FACTOR 42
+#define GFX_ARG_TILE_SIZE 43
+#define GFX_ARG_CLONE_FROM 44
+#define GFX_ARG_FADE_MODE 45
+#define GFX_ARG_FADE_DELAY 46
+#define GFX_ARG_POST_DELAY 47
+#define GFX_ARG_AUTO_DELAY 48
+#define GFX_ARG_ALIGN 49
+#define GFX_ARG_VALIGN 50
+#define GFX_ARG_SORT_PRIORITY 51
+#define GFX_ARG_CLASS 52
+#define GFX_ARG_STYLE 53
+#define GFX_ARG_ACTIVE_XOFFSET 54
+#define GFX_ARG_ACTIVE_YOFFSET 55
+#define GFX_ARG_PRESSED_XOFFSET 56
+#define GFX_ARG_PRESSED_YOFFSET 57
+
+#define NUM_GFX_ARGS 58
/* values for sound configuration suffixes */
int init_delay_fixed; /* optional initial delay values for global */
int init_delay_random; /* animations (pause interval before start) */
- int anim_delay_fixed; /* optional delay values for bored and */
- int anim_delay_random; /* sleeping player animations (animation */
- int post_delay_fixed; /* intervall and following pause before */
- int post_delay_random; /* next intervall (bored animation only) */
+ int anim_delay_fixed; /* optional delay values for bored/sleeping */
+ int anim_delay_random; /* and global animations (animation length) */
+ int post_delay_fixed; /* optional delay values after bored/global */
+ int post_delay_random; /* animations (pause before next animation) */
int step_offset; /* optional step offset of toon animations */
int step_xoffset; /* optional step offset of toon animations */
int step_yoffset; /* optional step offset of toon animations */
- int step_frames; /* optional step frames of toon animations */
int step_delay; /* optional step delay of toon animations */
int direction; /* optional move direction of toon animations */
int position; /* optional draw position of toon animations */