aboutsummaryrefslogtreecommitdiff
path: root/src/noise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/noise.cpp')
-rw-r--r--src/noise.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/noise.cpp b/src/noise.cpp
index c038384db..17b5df018 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -289,8 +289,8 @@ void Noise::init(NoiseParams *np, int seed, int sx, int sy, int sz) {
this->noisebuf = NULL;
resizeNoiseBuf(sz > 1);
- this->buf = new float[sx * sy * sz];
- this->result = new float[sx * sy * sz];
+ this->buf = new float[sx * sy * sz];
+ this->result = new float[sx * sy * sz];
}
@@ -311,10 +311,13 @@ void Noise::setSize(int sx, int sy, int sz) {
this->sy = sy;
this->sz = sz;
+ this->noisebuf = NULL;
resizeNoiseBuf(sz > 1);
delete[] buf;
delete[] result;
+ this->buf = new float[sx * sy * sz];
+ this->result = new float[sx * sy * sz];
}