mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 17:57:56 +07:00
Sector preset shadow fixes
This commit is contained in:
@ -233,6 +233,8 @@ public class World{
|
|||||||
}else{
|
}else{
|
||||||
sector.planet.generator.generate(tiles, sector);
|
sector.planet.generator.generate(tiles, sector);
|
||||||
}
|
}
|
||||||
|
//just in case
|
||||||
|
state.rules.sector = sector;
|
||||||
});
|
});
|
||||||
|
|
||||||
//postgenerate for bases
|
//postgenerate for bases
|
||||||
@ -458,13 +460,13 @@ public class World{
|
|||||||
float prev = Mathf.round(angle, step);
|
float prev = Mathf.round(angle, step);
|
||||||
float next = prev + step;
|
float next = prev + step;
|
||||||
//raw line length to be translated
|
//raw line length to be translated
|
||||||
float length = tiles.width/2f;
|
float length = state.getSector().getSize()/2f;
|
||||||
float rawDst = Intersector.distanceLinePoint(Tmp.v1.trns(prev, length), Tmp.v2.trns(next, length), Tmp.v3.set(x - tiles.width/2, y - tiles.height/2).rotate(offset)) / Mathf.sqrt3 - 1;
|
float rawDst = Intersector.distanceLinePoint(Tmp.v1.trns(prev, length), Tmp.v2.trns(next, length), Tmp.v3.set(x - tiles.width/2, y - tiles.height/2).rotate(offset)) / Mathf.sqrt3 - 1;
|
||||||
|
|
||||||
//noise
|
//noise
|
||||||
rawDst += Noise.noise(x, y, 11f, 7f) + Noise.noise(x, y, 22f, 15f);
|
rawDst += Noise.noise(x, y, 11f, 7f) + Noise.noise(x, y, 22f, 15f);
|
||||||
|
|
||||||
int circleDst = (int)(rawDst - (tiles.width / 2 - circleBlend));
|
int circleDst = (int)(rawDst - (length - circleBlend));
|
||||||
if(circleDst > 0){
|
if(circleDst > 0){
|
||||||
dark = Math.max(circleDst / 1f, dark);
|
dark = Math.max(circleDst / 1f, dark);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=bae3e678b96297aed5ca6dbaabcc652da62fa904
|
archash=73139e9d6d21c0fc8200e1231bf30b1d8d3d6800
|
||||||
|
Reference in New Issue
Block a user