This commit is contained in:
Anuken 2019-01-04 15:11:58 -05:00
parent 5019f200b7
commit 0900c13fa1
4 changed files with 4 additions and 49 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}