mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-19 16:57:15 +07:00
Cleanup
This commit is contained in:
parent
5019f200b7
commit
0900c13fa1
@ -113,6 +113,10 @@ public class FloorRenderer{
|
|||||||
cbatch.endDraw();
|
cbatch.endDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateFloor(Tile tile){
|
||||||
|
//TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
public void drawLayer(CacheLayer layer){
|
public void drawLayer(CacheLayer layer){
|
||||||
if(cache == null){
|
if(cache == null){
|
||||||
return;
|
return;
|
||||||
@ -181,8 +185,6 @@ public class FloorRenderer{
|
|||||||
|
|
||||||
if(floor.cacheLayer == layer){
|
if(floor.cacheLayer == layer){
|
||||||
floor.draw(tile);
|
floor.draw(tile);
|
||||||
}else if(floor.cacheLayer.ordinal() < layer.ordinal()){
|
|
||||||
//floor.drawNonLayer(tile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -508,9 +508,6 @@ public class Block extends BaseBlock {
|
|||||||
Draw.rect(region, tile.drawx(), tile.drawy(), rotate ? tile.getRotation() * 90 : 0);
|
Draw.rect(region, tile.drawx(), tile.drawy(), rotate ? tile.getRotation() * 90 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawNonLayer(Tile tile){
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawShadow(Tile tile){
|
public void drawShadow(Tile tile){
|
||||||
draw(tile);
|
draw(tile);
|
||||||
}
|
}
|
||||||
|
@ -126,13 +126,6 @@ public class Floor extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawNonLayer(Tile tile){
|
|
||||||
Mathf.random.setSeed(tile.pos());
|
|
||||||
|
|
||||||
drawEdges(tile, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
Mathf.random.setSeed(tile.pos());
|
Mathf.random.setSeed(tile.pos());
|
||||||
@ -168,32 +161,4 @@ public class Floor extends Block{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawEdges(Tile tile, boolean sameLayer){
|
|
||||||
if(!blend || tile.getCliffs() > 0) return;
|
|
||||||
|
|
||||||
for(int i = 0; i < 8; i++){
|
|
||||||
int dx = Geometry.d8[i].x, dy = Geometry.d8[i].y;
|
|
||||||
|
|
||||||
Tile other = tile.getNearby(dx, dy);
|
|
||||||
|
|
||||||
if(other == null) continue;
|
|
||||||
|
|
||||||
Floor floor = other.floor();
|
|
||||||
Floor cur = this;
|
|
||||||
if(floor instanceof OreBlock) floor = ((OreBlock) floor).base;
|
|
||||||
if(cur instanceof OreBlock) cur = ((OreBlock) cur).base;
|
|
||||||
|
|
||||||
if(floor.edgeRegions == null || (floor.id <= cur.id && !(tile.getElevation() != -1 && other.getElevation() > tile.getElevation())) || (!cur.blends.test(floor) && !cur.tileBlends.test(tile, other)) || (floor.cacheLayer.ordinal() > cur.cacheLayer.ordinal() && !sameLayer) ||
|
|
||||||
(sameLayer && floor.cacheLayer == cur.cacheLayer)) continue;
|
|
||||||
|
|
||||||
TextureRegion region = floor.edgeRegions[i];
|
|
||||||
|
|
||||||
Draw.rect(region,
|
|
||||||
tile.worldx() + floor.offsets[i].x * Draw.scl + Draw.scl * region.getWidth()/2f,
|
|
||||||
tile.worldy() + floor.offsets[i].y * Draw.scl + Draw.scl * region.getHeight()/2f,
|
|
||||||
region.getWidth() * Draw.scl,
|
|
||||||
region.getHeight() * Draw.scl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -36,15 +36,6 @@ public class OreBlock extends Floor{
|
|||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
|
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
|
||||||
|
|
||||||
//drawEdges(tile, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawNonLayer(Tile tile){
|
|
||||||
Mathf.random.setSeed(tile.pos());
|
|
||||||
|
|
||||||
base.drawEdges(tile, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user