Tar shader / Spritesheet split / Font cleanup

This commit is contained in:
Anuken
2019-03-10 11:11:16 -04:00
parent f861b75c7d
commit 1feb4a5e6d
33 changed files with 4717 additions and 2975 deletions

View File

@@ -16,6 +16,7 @@ import io.anuke.mindustry.world.blocks.OreBlock;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.tilesize;
@@ -26,11 +27,24 @@ public class Generators {
ImagePacker.generate("block-icons", () -> {
Image colors = new Image(256, 1);
Color outlineColor = new Color(0, 0, 0, 0.2f);
Color outlineColor = new Color(0, 0, 0, 0.3f);
for(Block block : content.blocks()){
TextureRegion[] regions = block.getGeneratedIcons();
try{
if(block instanceof Floor){
block.load();
for(TextureRegion region : block.variantRegions()){
GenRegion gen = (GenRegion)region;
if(gen.path == null) continue;
Files.copy(gen.path, Paths.get("../editor/editor-" + gen.path.getFileName()));
}
}
}catch(IOException e){
throw new RuntimeException(e);
}
if(regions.length == 0){
continue;
}
@@ -91,6 +105,8 @@ public class Generators {
image.save(block.name + "-icon-full");
}
image.save("../editor/" + block.name + "-icon-editor");
for(Icon icon : Icon.values()){
if(icon.size == 0 || (icon.size == image.width() && icon.size == image.height())) continue;
Image scaled = new Image(icon.size, icon.size);
@@ -212,7 +228,7 @@ public class Generators {
}
image.draw(ImagePacker.get(item.name + (i+1)));
image.save("ore-" + item.name + "-" + base.name + (i+1));
image.save("../blocks/environment/ore-" + item.name + "-" + base.name + (i+1));
//save icons
image.save(block.name + "-icon-full");
@@ -247,7 +263,7 @@ public class Generators {
}
}
result.save(floor.name + "-edge");
result.save("../blocks/environment/" + floor.name + "-edge");
}catch(Exception ignored){}
}