aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-14 00:18:31 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-14 00:18:31 -0500
commitdcbf1b3ce55e70e5c9294ba5271df0a3f3c4ee79 (patch)
tree9fe6cced4617a31a002bd68923d574c936ce45a0 /src
parent17dde5ddd0387c66aefc77e210c676e39c3b653c (diff)
downloadminetest-dcbf1b3ce55e70e5c9294ba5271df0a3f3c4ee79.tar.gz
minetest-dcbf1b3ce55e70e5c9294ba5271df0a3f3c4ee79.tar.bz2
minetest-dcbf1b3ce55e70e5c9294ba5271df0a3f3c4ee79.zip
Noise: Don't assume Noise is used for 2D unless gradientMap2D is actually called
Diffstat (limited to 'src')
-rw-r--r--src/noise.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/noise.cpp b/src/noise.cpp
index 93f9651ed..5223450dc 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -382,12 +382,6 @@ Noise::Noise(NoiseParams *np_, int seed, int sx, int sy, int sz)
this->gradient_buf = NULL;
this->result = NULL;
- if (np.flags & NOISE_FLAG_DEFAULTS) {
- // By default, only 2d noise is eased.
- if (sz <= 1)
- np.flags |= NOISE_FLAG_EASED;
- }
-
allocBuffers();
}
@@ -493,7 +487,8 @@ void Noise::gradientMap2D(
int index, i, j, x0, y0, noisex, noisey;
int nlx, nly;
- Interp2dFxn interpolate = (np.flags & NOISE_FLAG_EASED) ?
+ bool eased = np.flags & (NOISE_FLAG_DEFAULTS | NOISE_FLAG_EASED);
+ Interp2dFxn interpolate = eased ?
biLinearInterpolation : biLinearInterpolationNoEase;
x0 = floor(x);