1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-15 22:05:07 -05:00

Noise: Don't assume Noise is used for 2D unless gradientMap2D is actually called

This commit is contained in:
kwolekr 2014-12-14 00:18:31 -05:00
parent 17dde5ddd0
commit dcbf1b3ce5

View File

@ -382,12 +382,6 @@ Noise::Noise(NoiseParams *np_, int seed, int sx, int sy, int sz)
this->gradient_buf = NULL; this->gradient_buf = NULL;
this->result = 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(); allocBuffers();
} }
@ -493,7 +487,8 @@ void Noise::gradientMap2D(
int index, i, j, x0, y0, noisex, noisey; int index, i, j, x0, y0, noisex, noisey;
int nlx, nly; 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; biLinearInterpolation : biLinearInterpolationNoEase;
x0 = floor(x); x0 = floor(x);