summaryrefslogtreecommitdiff
path: root/src/noise.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-05-17 00:04:51 -0400
committerkwolekr <kwolekr@minetest.net>2015-05-17 00:04:51 -0400
commit28b2476b11875f0f13335a410f1f00c6a3fd81be (patch)
tree5bf020305d9950a0b2fcd7649174178a56cfdb44 /src/noise.cpp
parentc00b6812b116c7e08eaf00c52504aa7b93a936a1 (diff)
downloadminetest-28b2476b11875f0f13335a410f1f00c6a3fd81be.tar.gz
minetest-28b2476b11875f0f13335a410f1f00c6a3fd81be.tar.bz2
minetest-28b2476b11875f0f13335a410f1f00c6a3fd81be.zip
Noise: Fix interpolation at negative coordinates
Diffstat (limited to 'src/noise.cpp')
-rw-r--r--src/noise.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/noise.cpp b/src/noise.cpp
index 8c42be3cf..826593474 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -590,8 +590,9 @@ void Noise::gradientMap2D(
int seed)
{
float v00, v01, v10, v11, u, v, orig_u;
- u32 index, i, j, x0, y0, noisex, noisey;
+ u32 index, i, j, noisex, noisey;
u32 nlx, nly;
+ s32 x0, y0;
bool eased = np.flags & (NOISE_FLAG_DEFAULTS | NOISE_FLAG_EASED);
Interp2dFxn interpolate = eased ?
@@ -655,8 +656,9 @@ void Noise::gradientMap3D(
float v000, v010, v100, v110;
float v001, v011, v101, v111;
float u, v, w, orig_u, orig_v;
- u32 index, i, j, k, x0, y0, z0, noisex, noisey, noisez;
+ u32 index, i, j, k, noisex, noisey, noisez;
u32 nlx, nly, nlz;
+ s32 x0, y0, z0;
Interp3dFxn interpolate = (np.flags & NOISE_FLAG_EASED) ?
triLinearInterpolation : triLinearInterpolationNoEase;