diff options
author | Richard Linden <none@none> | 2013-01-03 18:59:06 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2013-01-03 18:59:06 -0800 |
commit | 05abd7a7b878de089514e74a27eaa2f3e5628f84 (patch) | |
tree | 4aaacf16d3e707c09d9c116d202fa5c24a662049 /indra/newview/noise.h | |
parent | 1d44f4d863217c8e5d18a0073e02e4360bc65e07 (diff) |
MAINT-2195 FIX Terrain textures are different for each session
seed the random number generator in noise.h with a known value when initializing
the perlin noise system and then back to a random value when done
Diffstat (limited to 'indra/newview/noise.h')
-rw-r--r-- | indra/newview/noise.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/noise.h b/indra/newview/noise.h index 0923bffcf2..b3efad73c5 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -310,6 +310,8 @@ static void normalize3(F32 v[3]) static void init(void) { + // we want repeatable noise (e.g. for stable terrain texturing), so seed with known value + srand(42); int i, j, k; for (i = 0 ; i < B ; i++) { @@ -340,6 +342,9 @@ static void init(void) for (j = 0 ; j < 3 ; j++) g3[B + i][j] = g3[i][j]; } + + // reintroduce entropy + srand(time(NULL)); // Flawfinder: ignore } #undef B |