polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 80d81f1133d46c8243abf01ea393bb5a71e3b06b
parent 9d9f850c2cd7c0015f101818ee3134d5ac91766c
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 26 Oct 2018 23:55:12 -0700

small refactor in update

Diffstat:
Msrc/update.c | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/update.c b/src/update.c @@ -61,7 +61,6 @@ static void movement(struct game *game, struct node *node, float speed_mult) { } } -void update_terrain(struct game *game) { static void remap_samples(struct point *points, int n_samples, double size) { @@ -83,6 +82,7 @@ static void remap_samples(struct point *points, int n_samples, } } +void update_terrain(struct game *game) { static int first = 1; static float last_scale = -1.0; @@ -134,8 +134,14 @@ static void remap_samples(struct point *points, int n_samples, /* struct point *samples = */ /* uniform_samples(n_samples, game->terrain.size); */ + static const double pdist = 42.0; + struct point *samples = - poisson_disk_samples(42.0, game->terrain.size, 30, &n_samples); + poisson_disk_samples(pdist, game->terrain.size, 30, &n_samples); + + /* remap_samples(samples, n_samples, game->terrain.size); */ + + /* draw_samples(samples, pdist, n_samples, game->terrain.size); */ terrain->samples = samples; terrain->n_samples = n_samples;