Upgradeable cores

This commit is contained in:
Anuken
2020-06-27 19:16:39 -04:00
parent 313cadb763
commit 80332e37d5
63 changed files with 365 additions and 290 deletions

View File

@@ -192,21 +192,21 @@ public class BlockRenderer implements Disposable{
Tile tile = world.rawTile(x, y);
Block block = tile.block();
//link to center
if(tile.entity != null) tile = tile.entity.tile();
if(tile.build != null) tile = tile.build.tile();
if(block != Blocks.air && block.cacheLayer == CacheLayer.normal && (tile.entity == null || !processedEntities.contains(tile.entity.id()))){
if(block != Blocks.air && block.cacheLayer == CacheLayer.normal && (tile.build == null || !processedEntities.contains(tile.build.id()))){
if(block.expanded || !expanded){
tileview.add(tile);
if(tile.entity != null) processedEntities.add(tile.entity.id());
if(tile.build != null) processedEntities.add(tile.build.id());
}
//lights are drawn even in the expanded range
if(tile.entity != null){
if(tile.build != null){
lightview.add(tile);
}
if(tile.entity != null && tile.entity.power != null && tile.entity.power.links.size > 0){
for(Building other : tile.entity.getPowerConnections(outArray2)){
if(tile.build != null && tile.build.power != null && tile.build.power.links.size > 0){
for(Building other : tile.build.getPowerConnections(outArray2)){
if(other.block() instanceof PowerNode){ //TODO need a generic way to render connections!
tileview.add(other.tile());
}
@@ -229,7 +229,7 @@ public class BlockRenderer implements Disposable{
for(int i = 0; i < tileview.size; i++){
Tile tile = tileview.items[i];
Block block = tile.block();
Building entity = tile.entity;
Building entity = tile.build;
Draw.z(Layer.block);
@@ -260,7 +260,7 @@ public class BlockRenderer implements Disposable{
//draw lights
for(int i = 0; i < lightview.size; i++){
Tile tile = lightview.items[i];
Building entity = tile.entity;
Building entity = tile.build;
if(entity != null){
entity.drawLight();

View File

@@ -8,7 +8,8 @@ import arc.struct.*;
import arc.util.pooling.*;
public class Trail{
private final int length;
public int length;
private final Seq<Vec3> points;
private float lastX = -1, lastY = -1;