diff --git a/core/assets/sounds/build.ogg b/core/assets/sounds/build.ogg index 8235d41eb9..e39daef50b 100644 Binary files a/core/assets/sounds/build.ogg and b/core/assets/sounds/build.ogg differ diff --git a/core/src/mindustry/audio/SoundControl.java b/core/src/mindustry/audio/SoundControl.java index dde449ecae..d407198f94 100644 --- a/core/src/mindustry/audio/SoundControl.java +++ b/core/src/mindustry/audio/SoundControl.java @@ -179,7 +179,7 @@ public class SoundControl{ float avol = Core.settings.getInt("ambientvol", 100) / 100f; sounds.each((sound, data) -> { - data.curVolume = Mathf.lerpDelta(data.curVolume, data.volume * avol, 0.2f); + data.curVolume = Mathf.lerpDelta(data.curVolume, data.volume * avol, 0.11f); boolean play = data.curVolume > 0.01f; float pan = Mathf.zero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total); diff --git a/core/src/mindustry/editor/MapEditor.java b/core/src/mindustry/editor/MapEditor.java index b603182e43..79609b22fb 100644 --- a/core/src/mindustry/editor/MapEditor.java +++ b/core/src/mindustry/editor/MapEditor.java @@ -18,7 +18,7 @@ import mindustry.world.*; import static mindustry.Vars.*; public class MapEditor{ - public static final int[] brushSizes = {1, 2, 3, 4, 5, 9, 15, 20}; + public static final float[] brushSizes = {1, 1.5f, 2, 3, 4, 5, 9, 15, 20}; public StringMap tags = new StringMap(); public MapRenderer renderer = new MapRenderer(); @@ -28,7 +28,7 @@ public class MapEditor{ private DrawOperation currentOp; private boolean loading; - public int brushSize = 1; + public float brushSize = 1; public int rotation; public Block drawBlock = Blocks.stone; public Team drawTeam = Team.sharded; @@ -227,8 +227,9 @@ public class MapEditor{ } public void drawCircle(int x, int y, Cons drawer){ - for(int rx = -brushSize; rx <= brushSize; rx++){ - for(int ry = -brushSize; ry <= brushSize; ry++){ + int clamped = (int)brushSize; + for(int rx = -clamped; rx <= clamped; rx++){ + for(int ry = -clamped; ry <= clamped; ry++){ if(Mathf.within(rx, ry, brushSize - 0.5f + 0.0001f)){ int wx = x + rx, wy = y + ry; @@ -243,8 +244,9 @@ public class MapEditor{ } public void drawSquare(int x, int y, Cons drawer){ - for(int rx = -brushSize; rx <= brushSize; rx++){ - for(int ry = -brushSize; ry <= brushSize; ry++){ + int clamped = (int)brushSize; + for(int rx = -clamped; rx <= clamped; rx++){ + for(int ry = -clamped; ry <= clamped; ry++){ int wx = x + rx, wy = y + ry; if(wx < 0 || wy < 0 || wx >= width() || wy >= height()){ diff --git a/core/src/mindustry/editor/MapView.java b/core/src/mindustry/editor/MapView.java index 4b603ddb28..e1e0512c43 100644 --- a/core/src/mindustry/editor/MapView.java +++ b/core/src/mindustry/editor/MapView.java @@ -38,7 +38,8 @@ public class MapView extends Element implements GestureListener{ for(int i = 0; i < MapEditor.brushSizes.length; i++){ float size = MapEditor.brushSizes[i]; - brushPolygons[i] = Geometry.pixelCircle(size, (index, x, y) -> Mathf.dst(x, y, index, index) <= index - 0.5f); + float mod = size % 1f; + brushPolygons[i] = Geometry.pixelCircle(size, (index, x, y) -> Mathf.dst(x, y, index - mod, index - mod) <= size - 0.5f); } Core.input.getInputProcessors().insert(0, new GestureDetector(20, 0.5f, 2, 0.15f, this)); diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index 81b59a632f..c151562835 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -94,6 +94,10 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{ if(!within(tile, finalPlaceDst)) return; + if(!headless){ + Vars.control.sound.loop(Sounds.build, tile, 0.51f); + } + if(!(tile.build instanceof ConstructBuild cb)){ if(!current.initialized && !current.breaking && Build.validPlace(current.block, team, current.x, current.y, current.rotation)){ boolean hasAll = infinite || current.isRotation(team) || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item, Math.min(Mathf.round(i.amount * state.rules.buildCostMultiplier), 1))); diff --git a/core/src/mindustry/maps/filters/DistortFilter.java b/core/src/mindustry/maps/filters/DistortFilter.java index 8b6d80e8e1..c1d6baa69e 100644 --- a/core/src/mindustry/maps/filters/DistortFilter.java +++ b/core/src/mindustry/maps/filters/DistortFilter.java @@ -27,7 +27,7 @@ public class DistortFilter extends GenerateFilter{ @Override public void apply(GenerateInput in){ - Tile tile = in.tile(in.x + noise(in, scl, mag) - mag / 2f, in.y + noise(in, scl, mag) - mag / 2f); + Tile tile = in.tile(in.x + noise(in, scl, mag) - mag / 2f, in.y + noise(1, in, scl, mag) - mag / 2f); in.floor = tile.floor(); if(!tile.block().synthetic() && !in.block.synthetic()) in.block = tile.block(); diff --git a/core/src/mindustry/maps/filters/GenerateFilter.java b/core/src/mindustry/maps/filters/GenerateFilter.java index fea59ed405..9182fc6857 100644 --- a/core/src/mindustry/maps/filters/GenerateFilter.java +++ b/core/src/mindustry/maps/filters/GenerateFilter.java @@ -99,6 +99,10 @@ public abstract class GenerateFilter{ //utility generation functions + protected float noise(int seedOffset, GenerateInput in, float scl, float mag){ + return Simplex.noise2d(seedOffset + seed, 1f, 0f, 1f / scl, in.x, in.y) * mag; + } + protected float noise(GenerateInput in, float scl, float mag){ return Simplex.noise2d(seed, 1f, 0f, 1f / scl, in.x, in.y) * mag; } diff --git a/gradle.properties b/gradle.properties index 545947379a..ba07db3e96 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=bd75f040406626ad933b54f1c06d16c1c0af8d14 +archash=29844ef3821ab99a0212dfb676463cb37d870a1b