diff --git a/core/assets-raw/sprites/blocks/grassblock1.png b/core/assets-raw/sprites/blocks/grassblock1.png index 9738aee34f..cceb8b43d1 100644 Binary files a/core/assets-raw/sprites/blocks/grassblock1.png and b/core/assets-raw/sprites/blocks/grassblock1.png differ diff --git a/core/assets-raw/sprites/blocks/grassblock2.png b/core/assets-raw/sprites/blocks/grassblock2.png index 74fd93f2dc..a66ee2ab2b 100644 Binary files a/core/assets-raw/sprites/blocks/grassblock2.png and b/core/assets-raw/sprites/blocks/grassblock2.png differ diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index a27c266698..7821e9a67d 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 6faf3734d4..31620f8108 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -59,6 +59,7 @@ public class Renderer extends RendererModule{ }); clearColor = Hue.lightness(0.4f); + clearColor.a = 1f; } @Override @@ -320,7 +321,6 @@ public class Renderer extends RendererModule{ shieldHits.addAll(x, y, 0f); } - void drawOverlay(){ //draw tutorial placement point diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 1553f12dd9..0c16291e07 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -72,6 +72,16 @@ public class World extends Module{ return !wallSolid(x, y-1) || !wallSolid(x, y+1) || !wallSolid(x-1, y) ||!wallSolid(x+1, y); } + public boolean blends(Block block, int x, int y){ + return !floorBlends(x, y-1, block) || !floorBlends(x, y+1, block) + || !floorBlends(x-1, y, block) ||!floorBlends(x+1, y, block); + } + + public boolean floorBlends(int x, int y, Block block){ + Tile tile = tile(x, y); + return tile == null || tile.floor().id <= block.id; + } + public Map getMap(){ return currentMap; } diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index c0236c48fc..9e64ad3f0a 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -148,81 +148,6 @@ public class BlockRenderer{ requestidx ++; } - /* - public void drawBlocks(boolean top){ - int crangex = (int) (camera.viewportWidth / (chunksize * tilesize)) + 1; - int crangey = (int) (camera.viewportHeight / (chunksize * tilesize)) + 1; - - int rangex = (int) (camera.viewportWidth * camera.zoom / tilesize / 2)+2; - int rangey = (int) (camera.viewportHeight * camera.zoom / tilesize / 2)+2; - - boolean noshadows = Settings.getBool("noshadows"); - - boolean drawTiles = Settings.getBool("drawblocks"); - - if(!drawTiles) return; - - Layer[] layers = Layer.values(); - - int start = (top ? 4 : (noshadows ? 1 : 0)); - int end = (top ? 4 + layers.length-1 : 4); - - //0 = shadows - //1 = cache blocks - //2 = normal blocks - //3+ = layers - for(int l = start; l < end; l++){ - if(l == 0){ - Graphics.surface(renderer.shadowSurface); - } - - Layer layer = l >= 3 ? layers[l - 3] : null; - - boolean expand = layer == Layer.power; - int expandr = (expand ? 3 : 0); - - if(l == 1){ - Graphics.end(); - drawCache(1, crangex, crangey); - Graphics.begin(); - }else{ - for(int x = -rangex - expandr; x <= rangex + expandr; x++){ - for(int y = -rangey - expandr; y <= rangey + expandr; y++){ - int worldx = Mathf.scl(camera.position.x, tilesize) + x; - int worldy = Mathf.scl(camera.position.y, tilesize) + y; - boolean expanded = (x < -rangex || x > rangex || y < -rangey || y > rangey); - - if(world.tile(worldx, worldy) != null){ - Tile tile = world.tile(worldx, worldy); - if(l == 0 && !expanded){ - if(tile.block() != Blocks.air && world.isAccessible(worldx, worldy)){ - tile.block().drawShadow(tile); - } - }else if(!(tile.block() instanceof StaticBlock) && - (!expanded || tile.block().expanded)){ - if(l == 2){ - tile.block().draw(tile); - }else{ - if(tile.block().layer == layer) - tile.block().drawLayer(tile); - - if(tile.block().layer2 == layer) - tile.block().drawLayer2(tile); - } - } - } - } - } - } - - if(l == 0){ - Draw.color(0, 0, 0, 0.15f); - Graphics.flushSurface(); - Draw.color(); - } - } - }*/ - public void drawFloor(){ int chunksx = world.width() / chunksize, chunksy = world.height() / chunksize; @@ -315,7 +240,9 @@ public class BlockRenderer{ for(int tiley = cy * chunksize; tiley < (cy + 1) * chunksize; tiley++){ Tile tile = world.tile(tilex, tiley); if(floor){ - tile.floor().draw(tile); + if(!(tile.block() instanceof StaticBlock)){ + tile.floor().draw(tile); + } }else if(tile.block() instanceof StaticBlock){ tile.block().draw(tile); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Floor.java b/core/src/io/anuke/mindustry/world/blocks/types/Floor.java index 0f3a1c7484..2a0af96661 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/Floor.java @@ -12,6 +12,7 @@ import io.anuke.ucore.util.Mathf; public class Floor extends Block{ protected Predicate blends = block -> block != this; + protected boolean blend = true; public Floor(String name) { super(name); @@ -24,6 +25,7 @@ public class Floor extends Block{ Draw.rect(variants > 0 ? (name() + MathUtils.random(1, variants)) : name(), tile.worldx(), tile.worldy()); + if(blend) for(int dx = -1; dx <= 1; dx ++){ for(int dy = -1; dy <= 1; dy ++){