added pumping events when waiting for screen redraw
authorHolger Schemel <info@artsoft.org>
Mon, 22 Apr 2019 10:47:58 +0000 (12:47 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 22 Apr 2019 10:47:58 +0000 (12:47 +0200)
This is required for executing event filter to update mouse position
during actions without event handling (like fading screens).

src/libgame/sdl.c
src/libgame/system.c
src/libgame/system.h

index fca1e8b..f18b97b 100644 (file)
@@ -224,6 +224,8 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
 
 static void UpdateScreen_WithFrameDelay(SDL_Rect *rect)
 {
+  PumpEvents();                // execute event filter actions while waiting
+
   UpdateScreenExt(rect, TRUE);
 }
 
index 8c8b7d5..d6ede9f 100644 (file)
@@ -1665,6 +1665,11 @@ void PeekEvent(Event *event)
   SDL_PeepEvents(event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
 }
 
+void PumpEvents(void)
+{
+  SDL_PumpEvents();
+}
+
 void CheckQuitEvent(void)
 {
   if (SDL_QuitRequested())
index 30b3754..6c0490f 100644 (file)
@@ -1863,6 +1863,7 @@ void InitEventFilter(EventFilter);
 boolean PendingEvent(void);
 void WaitEvent(Event *event);
 void PeekEvent(Event *event);
+void PumpEvents(void);
 void CheckQuitEvent(void);
 Key GetEventKey(KeyEvent *, boolean);
 KeyMod HandleKeyModState(Key, int);