while (1) {
planets = 0;
gravitations = 0;
+ optimizations = 0;
gravitize_planet_tree(planet_root, step_time);
printf(" \rfps: %.2f, steps/s: %.2f, planets: %d"
", scale %.2f, zoom %.2f, step %ld, visible %d,"
- " depth %ld, c:%ld, mass %.f, area: %.f, g: %.2f",
+ " depth %ld, c:%ld, area: %.f, g: %.f %.f",
last_fps, last_sps, planets, status.time_scale,
camera.zoom, step_count, visible_planets,
planet_root->tree.depth, planet_root->tree.children,
- planet_root->tree_mass, planet_root->tree_area,
- gravitations / (float) planets);
+ planet_root->tree_area,
+ gravitations / (float) planets,
+ optimizations / (float) planets);
fflush(stdout);
#include "utils.h"
struct quadtree_ops planet_ops;
-int gravitations;
+int gravitations, optimizations;
static void putpixel(struct SDL_Surface *screen, const int x, const int y,
const unsigned char r, const unsigned char g,
* OK, the node is far enough. We can approximate the
* entire tree as a single entity.
*/
+ optimizations += pt->tree.children;
gravitize_planet_with_tree(p, pt, time);
return;
}
SDL_Surface *screen;
};
-extern int gravitations;
+extern int gravitations, optimizations;
#define list_to_planet(list_head) container_of((list_head), struct planet, list)