Down to less than 100 errors

This commit is contained in:
Anuken
2020-03-06 14:55:06 -05:00
parent 73c0ebb75f
commit 4358658889
16 changed files with 64 additions and 58 deletions

View File

@@ -207,9 +207,9 @@ public class FloorRenderer implements Disposable{
}
if(tile.block().cacheLayer == layer && layer == CacheLayer.walls && !(tile.isDarkened() && tile.rotation() >= 5)){
tile.block().draw(tile);
tile.block().drawBase(tile);
}else if(floor.cacheLayer == layer && (world.isAccessible(tile.x, tile.y) || tile.block().cacheLayer != CacheLayer.walls || !tile.block().fillsTile)){
floor.draw(tile);
floor.drawBase(tile);
}else if(floor.cacheLayer.ordinal() < layer.ordinal() && layer != CacheLayer.walls){
floor.drawNonLayer(tile);
}

View File

@@ -186,18 +186,18 @@ public class MenuRenderer implements Disposable{
batch.beginCache();
for(Tile tile : world.tiles){
tile.floor().draw(tile);
tile.floor().drawBase(tile);
}
for(Tile tile : world.tiles){
tile.overlay().draw(tile);
tile.overlay().drawBase(tile);
}
cacheFloor = batch.endCache();
batch.beginCache();
for(Tile tile : world.tiles){
tile.block().draw(tile);
tile.block().drawBase(tile);
}
cacheWall = batch.endCache();

View File

@@ -155,7 +155,7 @@ public class MinimapRenderer implements Disposable{
private int colorFor(Tile tile){
if(tile == null) return 0;
tile = tile.link();
int bc = tile.block().minimapColor(tile);
int bc = tile.minimapColor();
Color color = Tmp.c1.set(bc == 0 ? MapIO.colorFor(tile.floor(), tile.block(), tile.overlay(), tile.team()) : bc);
color.mul(1f - Mathf.clamp(world.getDarkness(tile.x, tile.y) / 4f));

View File

@@ -50,15 +50,17 @@ public class OverlayRenderer{
}
Groups.unit.each(unit -> {
if(unit != player && unit.team() != player.team() && !rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f).setCenter(Core.camera.position.x, Core.camera.position.y).contains(unit.x(), unit.y())){
Tmp.v1.set(unit.x(), unit.y()).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
if(!unit.isLocal() && unit.team() != player.team() && !rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f).setCenter(Core.camera.position.x, Core.camera.position.y).contains(unit.x(), unit.y())){
Tmp.v1.set(unit.x(), unit.y()).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength);
Lines.stroke(1f, unit.team().color);
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 3f);
Draw.reset();
}
});
Lines.stroke(1f, unit.team().color);
Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 3f);
Draw.reset();
}
});
//mech pads are gone
/*
if(ui.hudfrag.blockfrag.currentCategory == Category.upgrade){
for(Tile mechpad : indexer.getAllied(player.team(), BlockFlag.mechPad)){
if(!(mechpad.block() instanceof MechPad)) continue;
@@ -72,7 +74,7 @@ public class OverlayRenderer{
Draw.reset();
}
}
}
}*/
}
if(player.dead()) return; //dead players don't draw
@@ -82,7 +84,7 @@ public class OverlayRenderer{
//draw config selected block
if(input.frag.config.isShown()){
Tile tile = input.frag.config.getSelectedTile();
tile.block().drawConfigure(tile);
tile.drawConfigure();
}
input.drawTop();
@@ -122,7 +124,7 @@ public class OverlayRenderer{
Tile tile = world.ltileWorld(vec.x, vec.y);
if(tile != null && tile.block() != Blocks.air && tile.team() == player.team()){
tile.block().drawSelect(tile);
tile.drawSelect();
if(Core.input.keyDown(Binding.rotateplaced) && tile.block().rotate && tile.interactable(player.team())){
control.input.drawArrow(tile.block(), tile.x, tile.y, tile.rotation(), true);
@@ -143,7 +145,7 @@ public class OverlayRenderer{
Draw.reset();
Tile tile = world.ltileWorld(v.x, v.y);
if(tile != null && tile.interactable(player.team()) && tile.block().acceptStack(tile, player.unit().item(), player.unit().stack().amount, player.unit()) > 0){
if(tile != null && tile.interactable(player.team()) && tile.acceptStack(player.unit().item(), player.unit().stack().amount, player.unit()) > 0){
Lines.stroke(3f, Pal.gray);
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));
Lines.stroke(1f, Pal.place);