]> git.itanic.dy.fi Git - sdl-planets/commitdiff
main loop: Modify debug prints
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 31 Mar 2010 19:44:23 +0000 (22:44 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Wed, 31 Mar 2010 19:44:23 +0000 (22:44 +0300)
 - Change the ordering of the fields

 - Add the counter of the simulation steps

 - Flush the stdout buffer out after each print.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index 21841e481817494b65bad270f3933f38bc27ef18..bfdd295459548a0c0400533f8dbf5a2ffc49ebe0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -225,10 +225,11 @@ static void loop(SDL_Surface *screen, int num_of_planets, double total_mass,
                }
 
 
                }
 
 
-               printf("  \rFrames/s: %.2f, planets: %d"
-                      ", scale %.2f, zoom %.2f, steps/s: %.2f, %ld",
-                      last_fps, planets, time_scale,
-                      camera.zoom, last_sps, step_count);
+               printf("  \rFrames/s: %.2f, steps/s: %.2f, planets: %d"
+                      ", scale %.2f, zoom %.2f, step %d",
+                      last_fps, last_sps, planets, time_scale,
+                      camera.zoom, step_count);
+               fflush(stdout);
 
 
                framecount++;
 
 
                framecount++;