added support for busy animation on non-loading screens
[rocksndiamonds.git] / src / libgame / system.c
index f186c143d298cfd4c933e19938e8b226d13b5d41..f9cc4fe894708219c0f1af1e383c251c10608fab 100644 (file)
@@ -103,7 +103,7 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir,
   program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout;
   program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr;
 
-  program.system_uuid = NULL;
+  program.api_thread_count = 0;
 
   program.headless = FALSE;
 }
@@ -130,7 +130,7 @@ void InitRuntimeInfo()
   runtime.uses_touch_device = FALSE;
 #endif
 
-  runtime.api_server = setup.api_server;
+  runtime.use_api_server = setup.use_api_server;
 }
 
 void SetWindowTitle(void)
@@ -273,7 +273,7 @@ void InitGfxClipRegion(boolean enabled, int x, int y, int width, int height)
   gfx.clip_height = height;
 }
 
-void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void))
+void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(boolean))
 {
   gfx.draw_busy_anim_function = draw_busy_anim_function;
 }
@@ -1845,6 +1845,24 @@ void PushUserEvent(int code, int value1, int value2)
   SDL_PushEvent((SDL_Event *)&event);
 }
 
+boolean PendingEscapeKeyEvent(void)
+{
+  if (PendingEvent())
+  {
+    Event event;
+
+    // check if any key press event is pending
+    if (SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN, SDL_KEYDOWN) != 1)
+      return FALSE;
+
+    // check if pressed key is "Escape" key
+    if (event.key.keysym.sym == KSYM_Escape)
+      return TRUE;
+  }
+
+  return FALSE;
+}
+
 
 // ============================================================================
 // joystick functions