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
cursor_inside_playfield = (motion->x >= SX && motion->x < SX + SXSIZE &&
motion->y >= SY && motion->y < SY + SYSIZE);
+ // set correct mouse x/y position (for pointer class global animations)
+ // (this is required in rare cases where the mouse x/y position calculated
+ // from raw values (to apply logical screen size scaling corrections) does
+ // not match the final mouse event x/y position -- this may happen because
+ // the SDL renderer's viewport position is internally represented as float,
+ // but only accessible as integer, which may lead to rounding errors)
+ gfx.mouse_x = motion->x;
+ gfx.mouse_y = motion->y;
+
// do no reset mouse cursor before all pending events have been processed
if (gfx.cursor_mode == cursor_mode_last &&
((game_status == GAME_MODE_TITLE &&
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;
}
}