added fix to prevent Windows from complaining about program not responding
authorHolger Schemel <info@artsoft.org>
Wed, 15 Nov 2017 20:09:05 +0000 (21:09 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 15 Nov 2017 20:09:37 +0000 (21:09 +0100)
src/init.c
src/libgame/system.c
src/libgame/system.h
src/tools.c

index 2a5807a4867de736dceaf9aece45f64b0be15eca..884ee541da6d5ca818c5359dd1d0d300404731ed 100644 (file)
@@ -97,6 +97,9 @@ void DrawInitAnim()
   int sync_frame = FrameCounter;
   int x, y;
 
+  /* prevent OS (Windows) from complaining about program not responding */
+  CheckQuitEvent();
+
   if (game_status != GAME_MODE_LOADING)
     return;
 
index 4f90a2d120835da09bda46a89f3877979b700ed5..6d2b222a5f05ecc69972e056fb7f1261a5ce0e8e 100644 (file)
@@ -1507,6 +1507,12 @@ void PeekEvent(Event *event)
 #endif
 }
 
+void CheckQuitEvent(void)
+{
+  if (SDL_QuitRequested())
+    program.exit_function(0);
+}
+
 Key GetEventKey(KeyEvent *event, boolean with_modifiers)
 {
 #if defined(TARGET_SDL2)
index b2187d78cda9ac18b57f0d6fb5cf030917aff597..216ca6a68d3a048546a99368c2fcf99b0fdb4e28 100644 (file)
@@ -1546,6 +1546,7 @@ void SetAudioMode(boolean);
 boolean PendingEvent(void);
 void NextEvent(Event *event);
 void PeekEvent(Event *event);
+void CheckQuitEvent(void);
 Key GetEventKey(KeyEvent *, boolean);
 KeyMod HandleKeyModState(Key, int);
 KeyMod GetKeyModState();
index 324bd45bf150f22d8964a81506922b8724d88410..327d8843b1cbbe6d336ab3a5cd2b80899f486f2f 100644 (file)
@@ -4866,6 +4866,9 @@ unsigned int MoveDoor(unsigned int door_state)
        SkipUntilDelayReached(&door_delay, door_delay_value, &k, last_frame);
 
        current_move_delay += max_step_delay;
+
+       /* prevent OS (Windows) from complaining about program not responding */
+       CheckQuitEvent();
       }
 
       if (door_part_done_all)