Cleanup
This commit is contained in:
@@ -10,7 +10,7 @@ import mindustry.world.blocks.environment.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class DrawOperation{
|
||||
static final int
|
||||
static final byte
|
||||
opFloor = 0,
|
||||
opBlock = 1,
|
||||
opRotation = 2,
|
||||
|
||||
@@ -146,7 +146,7 @@ public class EditorSpriteCache implements Disposable{
|
||||
index += vertexSize * 4;
|
||||
}
|
||||
|
||||
/** Renders the cached mesh. The shader must already have the correct view matrix (usually u_projectionViewMatrix) set as a uniform. */
|
||||
/** Renders the cached mesh. The shader must already have the correct view matrix set as a uniform. */
|
||||
public void render(Shader shader){
|
||||
if(mesh == null) throw new IllegalStateException("Cache is empty, call build() first.");
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ public class MapEditor{
|
||||
y = Mathf.clamp(y, (drawBlock.size - 1) / 2, height() - drawBlock.size / 2 - 1);
|
||||
if(!hasOverlap(x, y)){
|
||||
tile(x, y).setBlock(drawBlock, drawTeam, rotation);
|
||||
addTileOp(TileOp.get((short)x, (short)y, (byte)DrawOperation.opTeam, (byte)drawTeam.id));
|
||||
addTileOp(TileOp.get((short)x, (short)y, DrawOperation.opTeam, (byte)drawTeam.id));
|
||||
}
|
||||
}else{
|
||||
boolean isFloor = drawBlock.isFloor() && drawBlock != Blocks.air;
|
||||
@@ -166,13 +166,13 @@ public class MapEditor{
|
||||
}
|
||||
}else if(!(tile.block().isMultiblock() && !drawBlock.isMultiblock())){
|
||||
if(drawBlock.rotate && tile.build != null && tile.build.rotation != rotation){
|
||||
addTileOp(TileOp.get(tile.x, tile.y, (byte)DrawOperation.opRotation, (byte)rotation));
|
||||
addTileOp(TileOp.get(tile.x, tile.y, DrawOperation.opRotation, (byte)rotation));
|
||||
}
|
||||
|
||||
tile.setBlock(drawBlock, drawTeam, rotation);
|
||||
|
||||
if(drawBlock.synthetic()){
|
||||
addTileOp(TileOp.get(tile.x, tile.y, (byte)DrawOperation.opTeam, (byte)drawTeam.id));
|
||||
addTileOp(TileOp.get(tile.x, tile.y, DrawOperation.opTeam, (byte)drawTeam.id));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,6 +128,10 @@ public class MapRenderer implements Disposable{
|
||||
|
||||
void updateStatic(int x, int y){
|
||||
renderer.blocks.floor.recacheTile(x, y);
|
||||
if(x > 0) renderer.blocks.floor.recacheTile(x - 1, y);
|
||||
if(y > 0) renderer.blocks.floor.recacheTile(x, y - 1);
|
||||
if(x < world.width() - 1) renderer.blocks.floor.recacheTile(x + 1, y);
|
||||
if(y < world.height() - 1) renderer.blocks.floor.recacheTile(x, y + 1);
|
||||
}
|
||||
|
||||
void updateBlock(Tile tile){
|
||||
|
||||
@@ -9,7 +9,6 @@ import mindustry.world.*;
|
||||
public class Cliff extends Block{
|
||||
public float size = 11f;
|
||||
public @Load(value = "cliffmask#", length = 256) TextureRegion[] cliffs;
|
||||
public @Load(value = "editor-cliffmask#", length = 256) TextureRegion[] editorCliffs;
|
||||
|
||||
public Cliff(String name){
|
||||
super(name);
|
||||
|
||||
Reference in New Issue
Block a user