diff options
author | sanine <sanine.not@pm.me> | 2022-01-26 14:43:06 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-26 14:43:06 -0600 |
commit | fc3fdd59a1b8cceb1eb3e64ac41c6621301772ff (patch) | |
tree | 1da865f4dfafd279140d7d44c391b897513b20fe /experimental/tectonics/world.c | |
parent | 5734102b0adf54933230264e0b43e74f5eabf718 (diff) |
move tectonics.c -> main.c
Diffstat (limited to 'experimental/tectonics/world.c')
-rw-r--r-- | experimental/tectonics/world.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/experimental/tectonics/world.c b/experimental/tectonics/world.c index f5b6efb..dc042ee 100644 --- a/experimental/tectonics/world.c +++ b/experimental/tectonics/world.c @@ -53,7 +53,6 @@ static void relax_points(struct world_t *world, int iterations) // approximate centroids for (int i=0; i<iterations; i++) { - printf("%02f%%\n", 100*((double)i+1)/iterations); // generate a random point and find the closest // terrain point double x = rand01(); @@ -63,7 +62,7 @@ static void relax_points(struct world_t *world, int iterations) (struct point_t){x, y}); if (closest == -1) { - printf("WARN: bad closest point!\n"); + log_msg(WARN, "bad closest point for (%f, %f)", x, y); } else { // average the centroid towards that random point @@ -109,14 +108,14 @@ void create_world(struct world_t *world, int n_points) struct point_t *pt = world->points + i; pt->x = rand01(); pt->y = rand01(); - - //quadtree_insert(&(world->tree), world->points, i); } rebuild_tree(world); - for (int i=0; i<15; i++) - relax_points(world, 10*world->n_points); + for (int i=0; i<1; i++) { + log_msg(INFO, "relaxing points - iteration %d", i+1); + relax_points(world, 50*world->n_points); + } } |