diff --git a/gradle.properties b/gradle.properties index 916af6c..b524009 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 projGroupId=io.github.over-run projArtifactId=perlinoisej projName=perlinoisej -projVersion=0.2.0 +projVersion=0.3.0 projDesc=Java implementation for STB perlin noise projVcs=Over-Run/perlinoisej projBranch=0.x diff --git a/src/main/java/io/github/overrun/perlinoisej/PerlinNoise.java b/src/main/java/io/github/overrun/perlinoisej/PerlinNoise.java index 2e21e9f..6bd5269 100644 --- a/src/main/java/io/github/overrun/perlinoisej/PerlinNoise.java +++ b/src/main/java/io/github/overrun/perlinoisej/PerlinNoise.java @@ -206,7 +206,7 @@ private static float noise3internal(float x, float y, float z, int x_wrap, int y z -= pz; w = (((z * 6 - 15) * z + 10) * z * z * z); - int seed_i = seed & 0xff; + final int seed_i = seed & 0xff; r0 = RANDTAB[x0 + seed_i] & 0xff; r1 = RANDTAB[x1 + seed_i] & 0xff; @@ -320,10 +320,11 @@ public static float noise3wrapNonpow2(float x, float y, float z, int x_wrap, int z -= pz; w = (((z * 6 - 15) * z + 10) * z * z * z); + final int seed_i = seed & 0xff; r0 = RANDTAB[x0] & 0xff; - r0 = RANDTAB[r0 + seed] & 0xff; + r0 = RANDTAB[r0 + seed_i] & 0xff; r1 = RANDTAB[x1] & 0xff; - r1 = RANDTAB[r1 + seed] & 0xff; + r1 = RANDTAB[r1 + seed_i] & 0xff; r00 = RANDTAB[r0 + y0] & 0xff; r01 = RANDTAB[r0 + y1] & 0xff;