From 9b4f54c826ffa4f94efa866068c9d6ecdfb4b424 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:48 -0500 Subject: Second Life viewer sources 1.13.2.15 --- linden/indra/newview/llvosky.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'linden/indra/newview/llvosky.cpp') diff --git a/linden/indra/newview/llvosky.cpp b/linden/indra/newview/llvosky.cpp index 927b784..559e846 100644 --- a/linden/indra/newview/llvosky.cpp +++ b/linden/indra/newview/llvosky.cpp @@ -664,20 +664,18 @@ void LLVOSky::restoreGL() void LLVOSky::updateHaze() { - time_t timer; - time(&timer); - static LLRand WeatherRandomNumber(gmtime(&timer)->tm_mday); + static LLRandLagFib607 weather_generator(LLUUID::getRandomSeed()); if (gSavedSettings.getBOOL("FixedWeather")) { - WeatherRandomNumber.seed(8008135); + weather_generator.seed(8008135); } const F32 fo_upper_bound = 5; const F32 sca_upper_bound = 6; - const F32 fo = 1 + WeatherRandomNumber.llfrand(fo_upper_bound - 1); + const F32 fo = 1 + (F32)weather_generator() *(fo_upper_bound - 1); const static F32 upper = 0.5f / gFastLn.ln(fo_upper_bound); mHaze.setFalloff(fo); - mHaze.setG(WeatherRandomNumber.llfrand(0.0f + upper * gFastLn.ln(fo))); + mHaze.setG((F32)weather_generator() * (0.0f + upper * gFastLn.ln(fo))); LLColor3 sca; const F32 cd = mCloudDensity * 3; F32 min_r = cd - 1; @@ -691,7 +689,7 @@ void LLVOSky::updateHaze() max_r = sca_upper_bound; } - sca.mV[0] = min_r + WeatherRandomNumber.llfrand(max_r - min_r);//frand(6); + sca.mV[0] = min_r + (F32)weather_generator() * (max_r - min_r); min_r = sca.mV[0] - 0.1f; if (min_r < 0) @@ -704,7 +702,7 @@ void LLVOSky::updateHaze() max_r = sca_upper_bound; } - sca.mV[1] = min_r + WeatherRandomNumber.llfrand(max_r - min_r); + sca.mV[1] = min_r + (F32)weather_generator() * (max_r - min_r); min_r = sca.mV[1]; if (min_r < 0) @@ -717,7 +715,7 @@ void LLVOSky::updateHaze() max_r = sca_upper_bound; } - sca.mV[2] = min_r + WeatherRandomNumber.llfrand(max_r - min_r); + sca.mV[2] = min_r + (F32)weather_generator() * (max_r - min_r); sca = AIR_SCA_AVG * sca; -- cgit v1.1