From bebf3f959948b1099bec22babc8072a30d1a7072 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 28 May 2002 05:34:06 +0000 Subject: [PATCH] massive speedup to noise_diamondsquare (not that it /really/ matters:) --- libs/video/renderer/gl/noisetextures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/video/renderer/gl/noisetextures.c b/libs/video/renderer/gl/noisetextures.c index e3c3f2ea4..0db4e3cd1 100644 --- a/libs/video/renderer/gl/noisetextures.c +++ b/libs/video/renderer/gl/noisetextures.c @@ -58,7 +58,7 @@ noise_diamondsquare (unsigned char *noise, unsigned int size, int *noisebuf; unsigned int gridpower, sizepower, g, g2, x, y; -#define n(x, y) noisebuf[((y) & size1) * size + ((x) & size1)] +#define n(x, y) noisebuf[(((y) & size1) << sizepower) + ((x) & size1)] for (sizepower = 0; (1 << sizepower) < size; sizepower++); if (size != (1 << sizepower))