+
+static void print_init_timestamp(char *message)
+{
+#if DEBUG
+#if DEBUG_PRINT_INIT_TIMESTAMPS
+ static char *last_message = NULL;
+ static int counter_nr = 0;
+ int max_depth = DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH;
+
+ if (strEqualPrefix(message, "INIT"))
+ {
+ if (counter_nr + 1 < max_depth)
+ {
+ debug_print_timestamp(counter_nr, NULL);
+ debug_print_timestamp(counter_nr, message);
+ }
+
+ counter_nr++;
+
+ debug_print_timestamp(counter_nr, NULL);
+ }
+ else if (strEqualPrefix(message, "DONE"))
+ {
+ counter_nr--;
+
+ if (counter_nr + 1 < max_depth)
+ {
+ last_message = &message[4];
+
+ debug_print_timestamp(counter_nr, message);
+ }
+ }
+ else if (!strEqualPrefix(message, "TIME") ||
+ !strEqualSuffix(message, last_message))
+ {
+ if (counter_nr < max_depth)
+ debug_print_timestamp(counter_nr, message);
+ }
+#endif
+#endif
+}
+
+void DrawInitAnim()
+{
+ struct GraphicInfo *graphic_info_last = graphic_info;
+ int graphic = 0;
+ static unsigned long action_delay = 0;
+ unsigned long action_delay_value = GameFrameDelay;
+ int sync_frame = FrameCounter;
+ int x, y;
+
+ if (anim_initial.bitmap == NULL || window == NULL)
+ return;
+
+ if (!DelayReached(&action_delay, action_delay_value))
+ return;
+
+#if 0
+ {
+ static unsigned long last_counter = -1;
+ unsigned long current_counter = Counter();
+ unsigned long delay = current_counter - last_counter;
+
+ if (last_counter != -1 && delay > action_delay_value + 5)
+ printf("::: DrawInitAnim: DELAY TOO LONG: %ld\n", delay);
+
+ last_counter = current_counter;
+ }
+#endif
+
+ anim_initial.anim_mode = ANIM_LOOP;
+ anim_initial.anim_start_frame = 0;
+ anim_initial.offset_x = anim_initial.width;
+ anim_initial.offset_y = 0;
+
+ x = WIN_XSIZE / 2 - TILESIZE / 2;
+ y = WIN_YSIZE / 2 - TILESIZE / 2;
+
+ graphic_info = &anim_initial;
+
+ if (sync_frame % anim_initial.anim_delay == 0)
+ DrawGraphicAnimationExt(window, x, y, graphic, sync_frame, NO_MASKING);
+
+ graphic_info = graphic_info_last;
+
+ FrameCounter++;
+}
+