Packer reorganization
This commit is contained in:
@@ -15,9 +15,9 @@ import static io.anuke.mindustry.Vars.content;
|
||||
|
||||
public class Generators {
|
||||
|
||||
public static void generate(ImageContext context){
|
||||
public static void generate(){
|
||||
|
||||
ImageContext.generate("block-icons", () -> {
|
||||
ImagePacker.generate("block-icons", () -> {
|
||||
for(Block block : content.blocks()){
|
||||
TextureRegion[] regions = block.getBlockIcon();
|
||||
|
||||
@@ -27,19 +27,19 @@ public class Generators {
|
||||
|
||||
if(block.turretIcon){
|
||||
|
||||
Image image = ImageContext.get(block.name);
|
||||
Image image = ImagePacker.get(block.name);
|
||||
|
||||
Image read = ImageContext.create(image.width(), image.height());
|
||||
Image read = ImagePacker.create(image.width(), image.height());
|
||||
read.draw(image);
|
||||
|
||||
Image base = ImageContext.get("block-" + block.size);
|
||||
Image base = ImagePacker.get("block-" + block.size);
|
||||
|
||||
base.draw(image);
|
||||
|
||||
base.save("block-icon-" + block.name);
|
||||
}else {
|
||||
|
||||
Image image = ImageContext.get(regions[0]);
|
||||
Image image = ImagePacker.get(regions[0]);
|
||||
|
||||
for (TextureRegion region : regions) {
|
||||
image.draw(region);
|
||||
@@ -50,13 +50,13 @@ public class Generators {
|
||||
}
|
||||
});
|
||||
|
||||
ImageContext.generate("mech-icons", () -> {
|
||||
ImagePacker.generate("mech-icons", () -> {
|
||||
for(Mech mech : content.<Mech>getBy(ContentType.mech)){
|
||||
|
||||
mech.load();
|
||||
mech.weapon.load();
|
||||
|
||||
Image image = ImageContext.get(mech.region);
|
||||
Image image = ImagePacker.get(mech.region);
|
||||
|
||||
if(!mech.flying){
|
||||
image.drawCenter(mech.baseRegion);
|
||||
@@ -75,13 +75,13 @@ public class Generators {
|
||||
}
|
||||
});
|
||||
|
||||
ImageContext.generate("unit-icons", () -> {
|
||||
ImagePacker.generate("unit-icons", () -> {
|
||||
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
||||
|
||||
type.load();
|
||||
type.weapon.load();
|
||||
|
||||
Image image = ImageContext.get(type.region);
|
||||
Image image = ImagePacker.get(type.region);
|
||||
|
||||
if(!type.isFlying){
|
||||
image.draw(type.baseRegion);
|
||||
@@ -103,17 +103,17 @@ public class Generators {
|
||||
}
|
||||
});
|
||||
|
||||
ImageContext.generate("block-edges", () -> {
|
||||
ImagePacker.generate("block-edges", () -> {
|
||||
for(Block block : content.blocks()){
|
||||
if(!(block instanceof Floor)) continue;
|
||||
Floor floor = (Floor)block;
|
||||
if(floor.getIcon().length > 0 && !Core.atlas.has(floor.name + "-cliff-side")){
|
||||
Image floori = ImageContext.get(floor.getIcon()[0]);
|
||||
Image floori = ImagePacker.get(floor.getIcon()[0]);
|
||||
Color color = floori.getColor(0, 0).mul(1.3f, 1.3f, 1.3f, 1f);
|
||||
|
||||
String[] names = {"cliff-edge-2", "cliff-edge", "cliff-edge-1", "cliff-side"};
|
||||
for(String str : names){
|
||||
Image image = ImageContext.get("generic-" + str);
|
||||
Image image = ImagePacker.get("generic-" + str);
|
||||
|
||||
for(int x = 0; x < image.width(); x++){
|
||||
for(int y = 0; y < image.height(); y++){
|
||||
@@ -130,7 +130,7 @@ public class Generators {
|
||||
}
|
||||
});
|
||||
|
||||
ImageContext.generate("ore-icons", () -> {
|
||||
ImagePacker.generate("ore-icons", () -> {
|
||||
for(Block block : content.blocks()){
|
||||
if(!(block instanceof OreBlock)) continue;
|
||||
|
||||
@@ -140,8 +140,8 @@ public class Generators {
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
//get base image to draw on
|
||||
Image image = ImageContext.get(base.name + (i+1));
|
||||
Image shadow = ImageContext.get(item.name + (i+1));
|
||||
Image image = ImagePacker.get(base.name + (i+1));
|
||||
Image shadow = ImagePacker.get(item.name + (i+1));
|
||||
|
||||
int offset = 3;
|
||||
|
||||
@@ -157,7 +157,7 @@ public class Generators {
|
||||
}
|
||||
}
|
||||
|
||||
image.draw(ImageContext.get(item.name + (i+1)));
|
||||
image.draw(ImagePacker.get(item.name + (i+1)));
|
||||
image.save("ore-" + item.name + "-" + base.name + (i+1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user