From: lordhavoc Date: Thu, 31 Aug 2000 15:08:25 +0000 (+0000) Subject: Very minor speedup to fractal noise generator. X-Git-Tag: RELEASE_0_2_0_RC1~1002 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=917ecb3d73929af8f1a2a4cc106de3063ab9075b;p=xonotic%2Fdarkplaces.git Very minor speedup to fractal noise generator. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@18 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/fractalnoise.c b/fractalnoise.c index b6630279..68f375ed 100644 --- a/fractalnoise.c +++ b/fractalnoise.c @@ -3,7 +3,7 @@ void fractalnoise(unsigned char *noise, int size) { - int x, y, g, g2, amplitude, amplitude2, min, max, size1 = size - 1; + int x, y, g, g2, amplitude, min, max, size1 = size - 1; int *noisebuf; #define n(x,y) noisebuf[((y)&size1)*size+((x)&size1)] noisebuf = calloc(size*size, sizeof(int)); @@ -27,10 +27,9 @@ void fractalnoise(unsigned char *noise, int size) } // brownian motion theory amplitude >>= 1; - amplitude2 = amplitude >> 1; for (y = 0;y < size;y += g) for (x = 0;x < size;x += g) - n(x,y) += (rand()&litude) - amplitude2; + n(x,y) += (rand()&litude); } // find range of noise values min = max = 0;