mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add initial Lua biomedef support, fixed biome selection
This commit is contained in:
parent
11afcbff69
commit
96898c1794
8 changed files with 419 additions and 197 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue