From 0900c13fa1c39cc5d52feea2da7953d5a1b828b5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 4 Jan 2019 15:11:58 -0500 Subject: [PATCH] Cleanup --- .../mindustry/graphics/FloorRenderer.java | 6 ++-- core/src/io/anuke/mindustry/world/Block.java | 3 -- .../anuke/mindustry/world/blocks/Floor.java | 35 ------------------- .../mindustry/world/blocks/OreBlock.java | 9 ----- 4 files changed, 4 insertions(+), 49 deletions(-) diff --git a/core/src/io/anuke/mindustry/graphics/FloorRenderer.java b/core/src/io/anuke/mindustry/graphics/FloorRenderer.java index 6f08fa9441..97165b9a00 100644 --- a/core/src/io/anuke/mindustry/graphics/FloorRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/FloorRenderer.java @@ -113,6 +113,10 @@ public class FloorRenderer{ cbatch.endDraw(); } + public void updateFloor(Tile tile){ + //TODO: implement + } + public void drawLayer(CacheLayer layer){ if(cache == null){ return; @@ -181,8 +185,6 @@ public class FloorRenderer{ if(floor.cacheLayer == layer){ floor.draw(tile); - }else if(floor.cacheLayer.ordinal() < layer.ordinal()){ - //floor.drawNonLayer(tile); } } } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 561eb9e90e..2adfdb9de2 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -508,9 +508,6 @@ public class Block extends BaseBlock { Draw.rect(region, tile.drawx(), tile.drawy(), rotate ? tile.getRotation() * 90 : 0); } - public void drawNonLayer(Tile tile){ - } - public void drawShadow(Tile tile){ draw(tile); } diff --git a/core/src/io/anuke/mindustry/world/blocks/Floor.java b/core/src/io/anuke/mindustry/world/blocks/Floor.java index 1ee216c81e..398ede082f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/Floor.java @@ -126,13 +126,6 @@ public class Floor extends Block{ } } - @Override - public void drawNonLayer(Tile tile){ - Mathf.random.setSeed(tile.pos()); - - drawEdges(tile, true); - } - @Override public void draw(Tile tile){ Mathf.random.setSeed(tile.pos()); @@ -168,32 +161,4 @@ public class Floor extends Block{ 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); - } - } - } \ No newline at end of file diff --git a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java index 6aa0a436ce..ad35028343 100644 --- a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java @@ -36,15 +36,6 @@ public class OreBlock extends Floor{ @Override public void draw(Tile tile){ 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); } }