diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 1c67a5b1b9..cc968367a1 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -581,7 +581,7 @@ public class World{ for(GenerateFilter filter : filters){ filter.randomize(); - input.begin(filter, width(), height(), (x, y) -> tiles.getn(x, y)); + input.begin(width(), height(), (x, y) -> tiles.getn(x, y)); filter.apply(tiles, input); } } diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index 31af738182..8124e1c459 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -158,7 +158,7 @@ public class MapGenerateDialog extends BaseDialog{ long[] writeTiles = new long[editor.width() * editor.height()]; for(GenerateFilter filter : filters){ - input.begin(filter, editor.width(), editor.height(), editor::tile); + input.begin(editor.width(), editor.height(), editor::tile); //write to buffer for(int x = 0; x < editor.width(); x++){ @@ -414,7 +414,7 @@ public class MapGenerateDialog extends BaseDialog{ } for(var filter : copy){ - input.begin(filter, editor.width(), editor.height(), (x, y) -> unpack(buffer1[Mathf.clamp(x / scaling, 0, pixmap.width -1) + w* Mathf.clamp(y / scaling, 0, pixmap.height -1)])); + input.begin(editor.width(), editor.height(), (x, y) -> unpack(buffer1[Mathf.clamp(x / scaling, 0, pixmap.width -1) + w* Mathf.clamp(y / scaling, 0, pixmap.height -1)])); //read from buffer1 and write to buffer2 pixmap.each((px, py) -> { diff --git a/core/src/mindustry/maps/filters/GenerateFilter.java b/core/src/mindustry/maps/filters/GenerateFilter.java index cdddad9099..03921b7e55 100644 --- a/core/src/mindustry/maps/filters/GenerateFilter.java +++ b/core/src/mindustry/maps/filters/GenerateFilter.java @@ -100,14 +100,12 @@ public abstract class GenerateFilter{ //utility generation functions - //TODO would be nice if these functions used the seed and ditched "in" completely; simplex should be stateless - protected float noise(GenerateInput in, float scl, float mag){ - return (float)Simplex.noise2d(seed, 1f, 0f, 1f / scl, in.x, in.y) * mag; + return Simplex.noise2d(seed, 1f, 0f, 1f / scl, in.x, in.y) * mag; } protected float noise(GenerateInput in, float scl, float mag, float octaves, float persistence){ - return (float)Simplex.noise2d(seed, octaves, persistence, 1f / scl, in.x, in.y) * mag; + return Simplex.noise2d(seed, octaves, persistence, 1f / scl, in.x, in.y) * mag; } protected float rnoise(float x, float y, float scl, float mag){ @@ -141,7 +139,7 @@ public abstract class GenerateFilter{ this.y = y; } - public void begin(GenerateFilter filter, int width, int height, TileProvider buffer){ + public void begin(int width, int height, TileProvider buffer){ this.buffer = buffer; this.width = width; this.height = height; diff --git a/gradle.properties b/gradle.properties index 98aca3389a..70d530c757 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,4 @@ kapt.include.compile.classpath=false kotlin.stdlib.default.dependency=false #needed for android compilation android.useAndroidX=true -archash=3a84b1671d1d53c9f4513e0a4a701913acd87f62 +archash=f9bf8552f839d87fa561adafa3085d83a044be9f