]> git.lizzy.rs Git - minetest.git/commitdiff
Noise: Don't assume Noise is used for 2D unless gradientMap2D is actually called
authorkwolekr <kwolekr@minetest.net>
Sun, 14 Dec 2014 05:18:31 +0000 (00:18 -0500)
committerkwolekr <kwolekr@minetest.net>
Sun, 14 Dec 2014 05:18:31 +0000 (00:18 -0500)
src/noise.cpp

index 93f9651ed8ce4152b0f034a1e2a2974dbe5a56d7..5223450dcf25f1d6a06fd64babce115c469d44c7 100644 (file)
@@ -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);