X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=fractalnoise.c;h=979954565c7894860897c77a1c24e60d00b356a7;hp=1bb1c55abf8eebb087a6573626583e8357ff561b;hb=HEAD;hpb=5f950f0e9c2943048fa8950737c0c47528a1fec9 diff --git a/fractalnoise.c b/fractalnoise.c index 1bb1c55a..97995456 100644 --- a/fractalnoise.c +++ b/fractalnoise.c @@ -133,7 +133,7 @@ float noise4f(float x, float y, float z, float w) float v[4]; static float noisetable[NOISE_SIZE]; static int r[NOISE_SIZE]; - // LordHavoc: this is inspired by code I saw in Quake3, however I think my + // LadyHavoc: this is inspired by code I saw in Quake3, however I think my // version is much cleaner and substantially faster as well // // the following changes were made: @@ -157,10 +157,10 @@ float noise4f(float x, float y, float z, float w) r[i] = (int)(rand() * (double)NOISE_SIZE / ((double)RAND_MAX + 1)) & NOISE_MASK; // that & is only needed if RAND_MAX is > the range of double, which isn't the case on most platforms } - frac[1][0] = x - floor(x);index[0][0] = ((int)floor(x)) & NOISE_MASK; + frac[0][1] = x - floor(x);index[0][0] = ((int)floor(x)) & NOISE_MASK; frac[1][1] = y - floor(y);index[1][0] = ((int)floor(y)) & NOISE_MASK; - frac[1][2] = z - floor(z);index[2][0] = ((int)floor(z)) & NOISE_MASK; - frac[1][3] = w - floor(w);index[3][0] = ((int)floor(w)) & NOISE_MASK; + frac[2][1] = z - floor(z);index[2][0] = ((int)floor(z)) & NOISE_MASK; + frac[3][1] = w - floor(w);index[3][0] = ((int)floor(w)) & NOISE_MASK; for (i = 0;i < 4;i++) frac[i][0] = 1 - frac[i][1]; for (i = 0;i < 4;i++)