We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a641e63 commit f64f96eCopy full SHA for f64f96e
PerlinNoise.cpp
@@ -14,14 +14,14 @@ PerlinNoise::PerlinNoise( unsigned seed )
14
seed = std::mt19937::default_seed;
15
}
16
17
- // "permutation" contains all numbers in [0..255] in random order
18
- std::array<int,256> permutation;
19
- std::iota(permutation.begin(),permutation.end(),0);
20
- std::shuffle(permutation.begin(),permutation.end(),std::mt19937(seed));
+ // p[0]..p[255] contains all numbers in [0..255] in random order
+ std::iota(std::begin(p),std::begin(p)+256,0);
+
+ std::shuffle(std::begin(p),std::begin(p)+256,std::mt19937(seed));
21
22
for(int i=0; i<256; ++i)
23
{
24
- p[256+i] = p[i] = permutation[i];
+ p[256+i] = p[i];
25
26
27
0 commit comments