Skip to content

Commit

Permalink
Revert "Noise::perlinMap2D,3D: replace a loop init with a single mems…
Browse files Browse the repository at this point in the history
…et call"

This reverts commit bc1654f.
  • Loading branch information
nerzhul committed Jul 27, 2017
1 parent 2015aab commit e9d7005
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/noise.cpp
Expand Up @@ -713,7 +713,8 @@ float *Noise::perlinMap2D(float x, float y, float *persistence_map)
if (persistence_map) {
if (!persist_buf)
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++) {
Expand Down Expand Up @@ -750,8 +751,8 @@ float *Noise::perlinMap3D(float x, float y, float z, float *persistence_map)
if (persistence_map) {
if (!persist_buf)
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++) {
Expand Down

0 comments on commit e9d7005

Please sign in to comment.