X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fanim.c;h=cb2dc8816789d722f60e419e35dc54fd784d7bb5;hp=cb415db928da6663342e55362da38db7ead0caf5;hb=912fcafbd1601312dcf94837380480638fa3f4b3;hpb=f7e45f228121112b91865808415ce4dabbcfd664 diff --git a/src/anim.c b/src/anim.c index cb415db9..cb2dc881 100644 --- a/src/anim.c +++ b/src/anim.c @@ -19,6 +19,9 @@ #include "screens.h" +#define DEBUG_ANIM_EVENTS 0 + + // values for global toon animation definition #define NUM_GLOBAL_TOON_ANIMS 1 #define NUM_GLOBAL_TOON_PARTS MAX_NUM_TOONS @@ -113,6 +116,7 @@ struct GlobalAnimPartControlInfo boolean init_event_state; boolean anim_event_state; + boolean triggered; boolean clickable; boolean clicked; @@ -1095,9 +1099,14 @@ static void InitGlobalAnim_Triggered(struct GlobalAnimPartControlInfo *part, if (isClickablePart(part2, mask)) { - part2->clicked = TRUE; + part2->triggered = TRUE; *anything_clicked = clickConsumed(part); // click was on "part"! +#if DEBUG_ANIM_EVENTS + printf("::: => %d.%d TRIGGERED BY %d.%d\n", + part2->old_anim_nr + 1, part2->old_nr + 1, + part->old_anim_nr + 1, part->old_nr + 1); +#endif #if 0 printf("::: %d.%d TRIGGER CLICKED [%d]\n", anim2_nr, part2_nr, part2->control_info.anim_event_action); @@ -1600,6 +1609,10 @@ static void InitGlobalAnim_Clickable(void) { struct GlobalAnimPartControlInfo *part = &anim->part[part_nr]; + if (part->triggered) + part->clicked = TRUE; + + part->triggered = FALSE; part->clickable = FALSE; } } @@ -1646,6 +1659,11 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, boolean clicked) // always handle "any" click events (clicking anywhere on screen) ... if (isClickablePart(part, ANIM_EVENT_ANY)) { +#if DEBUG_ANIM_EVENTS + printf("::: => %d.%d TRIGGERED BY ANY\n", + part->old_anim_nr + 1, part->old_nr + 1); +#endif + part->clicked = TRUE; anything_clicked = clickConsumed(part); } @@ -1670,6 +1688,11 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, boolean clicked) if (isClickablePart(part, ANIM_EVENT_SELF)) { +#if DEBUG_ANIM_EVENTS + printf("::: => %d.%d TRIGGERED BY SELF\n", + part->old_anim_nr + 1, part->old_nr + 1); +#endif + part->clicked = TRUE; anything_clicked = clickConsumed(part); }