diff options
author | Fabio D'Urso <fabiodurso@hotmail.it> | 2012-08-06 02:08:40 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2012-09-06 22:06:46 +0200 |
commit | 1b008f273359b8df6b64ffa94bb2828e42ffa63e (patch) | |
tree | 49644fd22394f69520ba8a6b4c0c67bf3c850d83 /splash/SplashScreen.cc | |
parent | faff947d8106048b19ba74dd483b90b8cebb16c7 (diff) |
Replaced srand/rand calls in SplashScreen with grandom calls
Diffstat (limited to 'splash/SplashScreen.cc')
-rw-r--r-- | splash/SplashScreen.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/splash/SplashScreen.cc b/splash/SplashScreen.cc index d7412469..1ae28d41 100644 --- a/splash/SplashScreen.cc +++ b/splash/SplashScreen.cc @@ -28,6 +28,7 @@ #include <string.h> #include <algorithm> #include "goo/gmem.h" +#include "goo/grandom.h" #include "SplashMath.h" #include "SplashScreen.h" @@ -253,9 +254,6 @@ void SplashScreen::buildSCDMatrix(int r) { int *region, *dist; int x, y, xx, yy, x0, x1, y0, y1, i, j, d, iMin, dMin, n; - //~ this should probably happen somewhere else - srand(123); - // generate the random space-filling curve pts = (SplashScreenPoint *)gmallocn(size * size, sizeof(SplashScreenPoint)); i = 0; @@ -267,8 +265,7 @@ void SplashScreen::buildSCDMatrix(int r) { } } for (i = 0; i < size * size; ++i) { - j = i + (int)((double)(size * size - i) * - (double)rand() / ((double)RAND_MAX + 1.0)); + j = i + (int)((double)(size * size - i) * grandom_double()); x = pts[i].x; y = pts[i].y; pts[i].x = pts[j].x; |