mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Revert "Noise::perlinMap2D,3D: replace a loop init with a single memset call"
This reverts commit bc1654feed
.
This commit is contained in:
parent
2015aaba96
commit
e9d7005799
1 changed files with 4 additions and 3 deletions
|
@ -713,7 +713,8 @@ float *Noise::perlinMap2D(float x, float y, float *persistence_map)
|
||||||
if (persistence_map) {
|
if (persistence_map) {
|
||||||
if (!persist_buf)
|
if (!persist_buf)
|
||||||
persist_buf = new float[bufsize];
|
persist_buf = new float[bufsize];
|
||||||
memset(persist_buf, 1.0f, sizeof(float) * bufsize);
|
for (size_t i = 0; i != bufsize; i++)
|
||||||
|
persist_buf[i] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t oct = 0; oct < np.octaves; oct++) {
|
for (size_t oct = 0; oct < np.octaves; oct++) {
|
||||||
|
@ -750,8 +751,8 @@ float *Noise::perlinMap3D(float x, float y, float z, float *persistence_map)
|
||||||
if (persistence_map) {
|
if (persistence_map) {
|
||||||
if (!persist_buf)
|
if (!persist_buf)
|
||||||
persist_buf = new float[bufsize];
|
persist_buf = new float[bufsize];
|
||||||
|
for (size_t i = 0; i != bufsize; i++)
|
||||||
memset(persist_buf, 1.0f, sizeof(float) * bufsize);
|
persist_buf[i] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t oct = 0; oct < np.octaves; oct++) {
|
for (size_t oct = 0; oct < np.octaves; oct++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue