{
int frame = 0;
+ if (delay < 1) // delay must be at least 1
+ delay = 1;
+
sync_frame += start_frame * delay;
if (mode & ANIM_LOOP) // looping animation
if (isClickablePart(part2, mask))
{
part2->triggered = TRUE;
- *click_consumed = clickConsumed(part); // click was on "part"!
+ *click_consumed |= clickConsumed(part); // click was on "part"!
#if DEBUG_ANIM_EVENTS
printf("::: => %d.%d TRIGGERED BY %s OF %d.%d\n",
static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event)
{
boolean click_consumed = FALSE;
+ boolean anything_clicked = FALSE;
boolean any_part_clicked = FALSE;
boolean any_event_action = FALSE;
int mode_nr;
+ int i;
// check game modes in reverse draw order (to stop when clicked)
for (mode_nr = NUM_GAME_MODES - 1; mode_nr >= 0; mode_nr--)
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
- click_consumed = clickConsumed(part);
+ anything_clicked = part->clicked = TRUE;
+ click_consumed |= clickConsumed(part);
}
// always handle "unclick:any" events (releasing anywhere on screen) ...
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
- click_consumed = clickConsumed(part);
+ anything_clicked = part->clicked = TRUE;
+ click_consumed |= clickConsumed(part);
}
// ... but only handle the first (topmost) clickable animation
any_event_action = TRUE;
// determine if mouse clicks should be blocked from other animations
- any_part_clicked = clickConsumed(part);
+ any_part_clicked |= clickConsumed(part);
if (isClickablePart(part, ANIM_EVENT_SELF))
{
part->old_anim_nr + 1, part->old_nr + 1);
#endif
- part->clicked = TRUE;
- click_consumed = clickConsumed(part);
+ anything_clicked = part->clicked = TRUE;
+ click_consumed |= clickConsumed(part);
}
// check if this click is defined to trigger other animations
}
}
- if (click_consumed)
+ if (anything_clicked)
{
handle_click = TRUE;
- HandleGlobalAnim(ANIM_CONTINUE, game_status);
+ for (i = 0; i < NUM_GAME_MODES; i++)
+ HandleGlobalAnim(ANIM_CONTINUE, i);
handle_click = FALSE;
+
+ // prevent ignoring release event if processed within same game frame
+ StopProcessingEvents();
}
return (click_consumed || any_event_action);