Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	core/assets/logicids.dat
	core/src/mindustry/content/Blocks.java
	gradle.properties
This commit is contained in:
Anuken
2021-09-28 18:45:09 -04:00
53 changed files with 450 additions and 146 deletions

View File

@@ -117,10 +117,30 @@ public class BlockRenderer{
lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated
}
invalidateTile(event.tile);
recordIndex(event.tile);
});
}
public void invalidateTile(Tile tile){
int avgx = (int)(camera.position.x / tilesize);
int avgy = (int)(camera.position.y / tilesize);
int rangex = (int)(camera.width / tilesize / 2) + 3;
int rangey = (int)(camera.height / tilesize / 2) + 3;
if(Math.abs(avgx - tile.x) <= rangex && Math.abs(avgy - tile.y) <= rangey){
lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated
}
}
public void removeFloorIndex(Tile tile){
if(indexFloor(tile)) floorTree.remove(tile);
}
public void addFloorIndex(Tile tile){
if(indexFloor(tile)) floorTree.insert(tile);
}
boolean indexBlock(Tile tile){
var block = tile.block();
return tile.isCenter() && block != Blocks.air && block.cacheLayer == CacheLayer.normal;

View File

@@ -10,7 +10,7 @@ import static mindustry.Vars.*;
public class CacheLayer{
public static CacheLayer
water, mud, tar, slag, space, normal, walls;
water, mud, cryofluid, tar, slag, space, normal, walls;
public static CacheLayer[] all = {};
@@ -37,6 +37,7 @@ public class CacheLayer{
mud = new ShaderLayer(Shaders.mud),
tar = new ShaderLayer(Shaders.tar),
slag = new ShaderLayer(Shaders.slag),
cryofluid = new ShaderLayer(Shaders.cryofluid),
space = new ShaderLayer(Shaders.space),
normal = new CacheLayer(),
walls = new CacheLayer()

View File

@@ -21,7 +21,7 @@ public class Shaders{
public static UnitBuildShader build;
public static DarknessShader darkness;
public static LightShader light;
public static SurfaceShader water, mud, tar, slag, space, caustics;
public static SurfaceShader water, mud, tar, slag, cryofluid, space, caustics;
public static PlanetShader planet;
public static CloudShader clouds;
public static PlanetGridShader planetGrid;
@@ -48,6 +48,7 @@ public class Shaders{
mud = new SurfaceShader("mud");
tar = new SurfaceShader("tar");
slag = new SurfaceShader("slag");
cryofluid = new SurfaceShader("cryofluid");
space = new SpaceShader("space");
caustics = new SurfaceShader("caustics"){
@Override