summaryrefslogtreecommitdiff
path: root/src/noise.cpp
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2012-12-18 13:23:16 -0500
committerPerttu Ahola <celeron55@gmail.com>2013-01-21 21:41:37 +0200
commit96898c179458174f858bab6363636ef231b49865 (patch)
treeff40e2830df3bd491774714bfcc85dc9d56d3f94 /src/noise.cpp
parent11afcbff69c95915e5142bc4b55636ff6358ece9 (diff)
downloadminetest-96898c179458174f858bab6363636ef231b49865.tar.gz
minetest-96898c179458174f858bab6363636ef231b49865.tar.bz2
minetest-96898c179458174f858bab6363636ef231b49865.zip
Add initial Lua biomedef support, fixed biome selection
Diffstat (limited to 'src/noise.cpp')
-rw-r--r--src/noise.cpp15
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++;
+ }
+ }
+ }
+}