forked from Mirrorlandia_minetest/minetest
Noise: Make buffer size parameters unsigned
This commit is contained in:
parent
eaef678e0b
commit
5d1d7c17ea
@ -460,7 +460,7 @@ float NoisePerlin3D(NoiseParams *np, float x, float y, float z, int seed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Noise::Noise(NoiseParams *np_, int seed, int sx, int sy, int sz)
|
Noise::Noise(NoiseParams *np_, int seed, u32 sx, u32 sy, u32 sz)
|
||||||
{
|
{
|
||||||
memcpy(&np, np_, sizeof(np));
|
memcpy(&np, np_, sizeof(np));
|
||||||
this->seed = seed;
|
this->seed = seed;
|
||||||
@ -512,7 +512,7 @@ void Noise::allocBuffers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Noise::setSize(int sx, int sy, int sz)
|
void Noise::setSize(u32 sx, u32 sy, u32 sz)
|
||||||
{
|
{
|
||||||
this->sx = sx;
|
this->sx = sx;
|
||||||
this->sy = sy;
|
this->sy = sy;
|
||||||
|
10
src/noise.h
10
src/noise.h
@ -149,18 +149,18 @@ class Noise {
|
|||||||
public:
|
public:
|
||||||
NoiseParams np;
|
NoiseParams np;
|
||||||
int seed;
|
int seed;
|
||||||
int sx;
|
u32 sx;
|
||||||
int sy;
|
u32 sy;
|
||||||
int sz;
|
u32 sz;
|
||||||
float *noise_buf;
|
float *noise_buf;
|
||||||
float *gradient_buf;
|
float *gradient_buf;
|
||||||
float *persist_buf;
|
float *persist_buf;
|
||||||
float *result;
|
float *result;
|
||||||
|
|
||||||
Noise(NoiseParams *np, int seed, int sx, int sy, int sz=1);
|
Noise(NoiseParams *np, int seed, u32 sx, u32 sy, u32 sz=1);
|
||||||
~Noise();
|
~Noise();
|
||||||
|
|
||||||
void setSize(int sx, int sy, int sz=1);
|
void setSize(u32 sx, u32 sy, u32 sz=1);
|
||||||
void setSpreadFactor(v3f spread);
|
void setSpreadFactor(v3f spread);
|
||||||
void setOctaves(int octaves);
|
void setOctaves(int octaves);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user