diff options
Diffstat (limited to 'src/noise.cpp')
-rw-r--r-- | src/noise.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/noise.cpp b/src/noise.cpp index 5cb4be29a..3874848ad 100644 --- a/src/noise.cpp +++ b/src/noise.cpp @@ -287,7 +287,7 @@ Noise::Noise(NoiseParams *np, int seed, int sx, int sy) { this->seed = seed; this->sx = sx; this->sy = sy; - this->sz = 0; + this->sz = 1; this->noisebuf = new float[nlx * nly]; this->buf = new float[sx * sy]; this->result = new float[sx * sy]; @@ -538,3 +538,16 @@ float *Noise::perlinMap3D(float x, float y, float z) { return result; } + + +void Noise::transformNoiseMap() { + int i = 0; + for (int z = 0; z != sz; z++) { + for (int y = 0; y != sy; y++) { + for (int x = 0; x != sx; x++) { + result[i] = result[i] * np->scale + np->offset; + i++; + } + } + } +} |