}
}
+static void HandleGlobalAnimEvent(struct GlobalAnimPartControlInfo *part,
+ int event_value, char *info_text)
+{
+#if DEBUG_ANIM_EVENTS
+ printf("::: %d.%d %s\n", part->old_anim_nr + 1, part->old_nr + 1, info_text);
+#endif
+
+ boolean anything_clicked = FALSE;
+ boolean any_event_action = FALSE;
+
+ // check if this event is defined to trigger other animations
+ InitGlobalAnim_Triggered(part, &anything_clicked, &any_event_action,
+ event_value);
+}
+
static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part,
int state)
{
if (part->init_delay_counter == 0 &&
!part->init_event_state)
+ {
PlayGlobalAnimSoundAndMusic(part);
+
+ HandleGlobalAnimEvent(part, ANIM_EVENT_START, "START [ANIM]");
+ }
+ else
+ {
+ HandleGlobalAnimEvent(part, ANIM_EVENT_INIT, "START [INIT_DELAY/EVENT]");
+ }
}
if (part->clicked &&
part->init_event_state = FALSE;
PlayGlobalAnimSoundAndMusic(part);
+
+ HandleGlobalAnimEvent(part, ANIM_EVENT_START, "START [ANIM]");
}
return ANIM_STATE_WAITING;
{
StopGlobalAnimSoundAndMusic(part);
+ HandleGlobalAnimEvent(part, ANIM_EVENT_END, "END [ANIM/OFF-SCREEN]");
+
part->post_delay_counter =
(c->post_delay_fixed + GetSimpleRandom(c->post_delay_random));
StopGlobalAnimSoundAndMusic(part);
+ HandleGlobalAnimEvent(part, ANIM_EVENT_END, "END [ANIM_DELAY/EVENT]");
+
part->post_delay_counter =
(c->post_delay_fixed + GetSimpleRandom(c->post_delay_random));
part->post_delay_counter--;
if (part->post_delay_counter == 0)
+ {
+ HandleGlobalAnimEvent(part, ANIM_EVENT_POST, "END [POST_DELAY]");
+
return ANIM_STATE_RESTART;
+ }
return ANIM_STATE_WAITING;
}
#define ANIM_EVENT_SELF (1 << 16)
#define ANIM_EVENT_ANY (1 << 17)
#define ANIM_EVENT_CLICK (1 << 18)
+#define ANIM_EVENT_INIT (1 << 19)
+#define ANIM_EVENT_START (1 << 20)
+#define ANIM_EVENT_END (1 << 21)
+#define ANIM_EVENT_POST (1 << 22)
// anim number: bits 0-7
// part number: bits 8-15