From 1cd8351054c6f0b120e603e0e25b85da385f185a Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 7 Jan 2013 16:42:00 -0500 Subject: Fix MapgenV6::getGroundLevelAtPoint() --- src/noise.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/noise.h') diff --git a/src/noise.h b/src/noise.h index 9fb6d48a1..e725b4e47 100644 --- a/src/noise.h +++ b/src/noise.h @@ -132,8 +132,28 @@ inline float easeCurve(float t) { return t * t * t * (t * (6.f * t - 15.f) + 10.f); } -#define NoisePerlin2D(np, x, y, s) ((np)->offset + (np)->scale * \ - noise2d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \ +#define NoisePerlin2D(np, x, y, s) \ + ((np)->offset + (np)->scale * noise2d_perlin( \ + (float)(x) / (np)->spread.X, \ + (float)(y) / (np)->spread.Y, \ + (s) + (np)->seed, (np)->octaves, (np)->persist)) + +#define NoisePerlin2DNoTxfm(np, x, y, s) \ + (noise2d_perlin( \ + (float)(x) / (np)->spread.X, \ + (float)(y) / (np)->spread.Y, \ + (s) + (np)->seed, (np)->octaves, (np)->persist)) + +#define NoisePerlin2DPosOffset(np, x, xoff, y, yoff, s) \ + ((np)->offset + (np)->scale * noise2d_perlin( \ + (float)(xoff) + (float)(x) / (np)->spread.X, \ + (float)(yoff) + (float)(y) / (np)->spread.Y, \ + (s) + (np)->seed, (np)->octaves, (np)->persist)) + +#define NoisePerlin2DNoTxfmPosOffset(np, x, xoff, y, yoff, s) \ + (noise2d_perlin( \ + (float)(xoff) + (float)(x) / (np)->spread.X, \ + (float)(yoff) + (float)(y) / (np)->spread.Y, \ (s) + (np)->seed, (np)->octaves, (np)->persist)) #define NoisePerlin3D(np, x, y, z, s) ((np)->offset + (np)->scale * \ -- cgit v1.2.3