summaryrefslogtreecommitdiff
path: root/src/noise.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/noise.h')
-rw-r--r--src/noise.h24
1 files changed, 22 insertions, 2 deletions
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 * \