{
/* note: expect different frames for the same delay cycle! */
- if (anim.random_frame < 0)
+ if (gfx.anim_random_frame < 0)
frame = SimpleRND(num_frames);
else
- frame = anim.random_frame % num_frames;
+ frame = gfx.anim_random_frame % num_frames;
}
if (mode & ANIM_REVERSE) /* use reverse animation direction */
{
static char *direction = NULL;
+ /* !!! MEMORY LEAK HERE! FIX IT! !!! */
setString(&direction, getStringToLower(direction_raw));
return (strcmp(direction, "left") == 0 ? MV_LEFT :
if (!setup.toons)
return;
+ /* this may happen after reloading graphics and redefining "num_toons" */
+ if (toon_nr >= screen_info.num_toons)
+ anim_restart = TRUE;
+
switch(mode)
{
case ANIM_START:
toon_nr = SimpleRND(screen_info.num_toons);
}
- anim_restart = reset_delay = AnimateToon(toon_nr,anim_restart);
+ anim_restart = reset_delay = AnimateToon(toon_nr, anim_restart);
}
void InitAnimation()