changed simple "printf()" debug output to new debug log function
[rocksndiamonds.git] / src / libgame / misc.c
index e3983f6d8e98b43b7e93414e6cf2800015f5c581..b1ea74e078f22d7e01dbf225d13692f7f74e3b0c 100644 (file)
@@ -340,6 +340,9 @@ void Debug(char *mode, char *format, ...)
 {
   va_list ap;
 
+  if (!options.debug)
+    return;
+
   // if optional debug mode specified, limit debug output accordingly
   if (options.debug_mode != NULL &&
       !strEqual(options.debug_mode, mode))
@@ -571,10 +574,15 @@ void SkipUntilDelayReached(unsigned int *counter_var, unsigned int delay,
 
 #if 0
 #if DEBUG
-  printf("::: %d: %d ms", *loop_var, delay);
   if (skip_frames)
-    printf(" -> SKIP %d FRAME(S) [%d ms]", skip_frames, skip_frames * delay);
-  printf("\n");
+    Debug("internal:SkipUntilDelayReached",
+         "%d: %d ms -> SKIP %d FRAME(S) [%d ms]",
+         *loop_var, delay,
+         skip_frames, skip_frames * delay);
+  else
+    Debug("internal:SkipUntilDelayReached",
+         "%d: %d ms",
+         *loop_var, delay);
 #endif
 #endif