Also see commit
4be294f9, which did not fix the problem in all cases,
because the next part of a multi-part global animation (activated by
a click event) will not be active before the following game frame, so
a directly following release event would still just be ignored.
Stopping processing of all following events for one game frame after
handling a click event lets the animation successfully change to the
next part, which can then be triggered by the release event.
An example where this might happen is mentioned in the above commit.
HandleGlobalAnim(ANIM_CONTINUE, game_status);
handle_click = FALSE;
+
+ // prevent ignoring release event if processed within same game frame
+ StopProcessingEvents();
}
return (click_consumed || any_event_action);
static unsigned int special_cursor_delay_value = 1000;
static boolean virtual_button_pressed = FALSE;
+static boolean stop_processing_events = FALSE;
// forward declarations for internal use
return FALSE;
}
+void StopProcessingEvents(void)
+{
+ stop_processing_events = TRUE;
+}
+
static void HandleEvents(void)
{
Event event;
ResetDelayCounter(&event_frame_delay);
+ stop_processing_events = FALSE;
+
while (NextValidEvent(&event))
{
switch (event.type)
// do not handle events for longer than standard frame delay period
if (DelayReached(&event_frame_delay, event_frame_delay_value))
break;
+
+ // do not handle any further events if triggered by a special flag
+ if (stop_processing_events)
+ break;
}
}
int FilterMouseMotionEvents(void *, Event *);
boolean NextValidEvent(Event *);
+void StopProcessingEvents(void);
void EventLoop(void);
void HandleOtherEvents(Event *);