From 05abd7a7b878de089514e74a27eaa2f3e5628f84 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 3 Jan 2013 18:59:06 -0800 Subject: 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 --- indra/newview/noise.h | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3