Editor generation cleanup
This commit is contained in:
@@ -80,7 +80,7 @@ public class MapIO{
|
||||
@Override
|
||||
public void setBlock(Block type){
|
||||
super.setBlock(type);
|
||||
int c = colorFor(Blocks.air, block(), Blocks.air, team());
|
||||
int c = colorFor(block(), Blocks.air, Blocks.air, team());
|
||||
if(c != black){
|
||||
walls.draw(x, floors.getHeight() - 1 - y, c);
|
||||
floors.draw(x, floors.getHeight() - 1 - y + 1, shade);
|
||||
@@ -119,7 +119,7 @@ public class MapIO{
|
||||
if(overlayID != 0){
|
||||
floors.draw(x, floors.getHeight() - 1 - y, colorFor(Blocks.air, Blocks.air, content.block(overlayID), Team.derelict));
|
||||
}else{
|
||||
floors.draw(x, floors.getHeight() - 1 - y, colorFor(content.block(floorID), Blocks.air, Blocks.air, Team.derelict));
|
||||
floors.draw(x, floors.getHeight() - 1 - y, colorFor(Blocks.air, content.block(floorID), Blocks.air, Team.derelict));
|
||||
}
|
||||
if(content.block(overlayID) == Blocks.spawn){
|
||||
map.spawns ++;
|
||||
@@ -141,17 +141,17 @@ public class MapIO{
|
||||
for(int x = 0; x < pixmap.getWidth(); x++){
|
||||
for(int y = 0; y < pixmap.getHeight(); y++){
|
||||
Tile tile = tiles.getn(x, y);
|
||||
pixmap.draw(x, pixmap.getHeight() - 1 - y, colorFor(tile.floor(), tile.block(), tile.overlay(), tile.team()));
|
||||
pixmap.draw(x, pixmap.getHeight() - 1 - y, colorFor(tile.block(), tile.floor(), tile.overlay(), tile.team()));
|
||||
}
|
||||
}
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
public static int colorFor(Block floor, Block wall, Block ore, Team team){
|
||||
public static int colorFor(Block wall, Block floor, Block overlay, Team team){
|
||||
if(wall.synthetic()){
|
||||
return team.color.rgba();
|
||||
}
|
||||
return (wall.solid ? wall.mapColor : !ore.useColor ? floor.mapColor : ore.mapColor).rgba();
|
||||
return (wall.solid ? wall.mapColor : !overlay.useColor ? floor.mapColor : overlay.mapColor).rgba();
|
||||
}
|
||||
|
||||
public static Pixmap writeImage(Tiles tiles){
|
||||
|
||||
Reference in New Issue
Block a user