Removed unused shadow methods; minor tweaks

This commit is contained in:
Anuken
2019-03-29 09:07:46 -04:00
parent 532c36677c
commit 27e9901d05
7 changed files with 12 additions and 30 deletions
@@ -57,7 +57,7 @@ public class BlockRenderer{
for(int x = 0; x < world.width(); x++){
for(int y = 0; y < world.height(); y++){
Tile tile = world.rawTile(x, y);
if(tile.block() != Blocks.air){
if(tile.block().hasShadow){
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
}
}
@@ -125,7 +125,11 @@ public class BlockRenderer{
Draw.proj().setOrtho(0, 0, shadows.getWidth(), shadows.getHeight());
for(Tile tile : shadowEvents){
Draw.color(tile.block() == Blocks.air ? Color.WHITE : shadowColor);
//clear it first
Draw.color(Color.WHITE);
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
//then draw the shadow
Draw.color(!tile.block().hasShadow ? Color.WHITE : shadowColor);
Fill.rect(tile.x + 0.5f, tile.y + 0.5f, 1, 1);
}
@@ -186,7 +190,6 @@ public class BlockRenderer{
}
if(block.expanded || !expanded){
addRequest(tile, Layer.shadow);
if(block.layer != null && block.isLayer(tile)){
addRequest(tile, block.layer);
@@ -227,9 +230,7 @@ public class BlockRenderer{
BlockRequest req = requests.get(iterateidx);
Block block = req.tile.block();
if(req.layer == Layer.shadow){
block.drawShadow(req.tile);
}else if(req.layer == Layer.block){
if(req.layer == Layer.block){
block.draw(req.tile);
if(block.synthetic() && req.tile.getTeam() != player.getTeam()){
block.drawTeam(req.tile);
@@ -1,8 +1,6 @@
package io.anuke.mindustry.graphics;
public enum Layer{
/**Drawn under everything.*/
shadow,
/**Base block layer.*/
block,
/**for placement*/