Skip to content
Permalink
Browse files

Revert "Noise::perlinMap2D,3D: replace a loop init with a single mems…

…et call"

This reverts commit bc1654f.
  • Loading branch information
nerzhul committed Jul 27, 2017
1 parent 2015aab commit e9d70057994172d1b1f52c1ae40842de82a55f86
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/noise.cpp
@@ -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++) {
@@ -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++) {

0 comments on commit e9d7005

Please sign in to comment.