Map editor bugfixes / Re-added build noise

This commit is contained in:
Anuken
2021-09-09 17:04:55 -04:00
parent a3ede6cf0b
commit cbe188abab
8 changed files with 21 additions and 10 deletions

View File

@@ -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();

View File

@@ -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;
}