Misc preparations for unified packing

This commit is contained in:
Anuken
2022-06-12 23:04:26 -04:00
parent 1a63a2726e
commit 0dface7cc1
10 changed files with 31 additions and 12 deletions

View File

@@ -1290,7 +1290,7 @@ public class Block extends UnlockableContent implements Senseable{
}
}
var editorBase = Core.atlas.getPixmap(fullIcon);
PixmapRegion editorBase;
if(gen.length > 1){
Pixmap base = Core.atlas.getPixmap(gen[0]).crop();
@@ -1304,6 +1304,8 @@ public class Block extends UnlockableContent implements Senseable{
packer.add(PageType.main, "block-" + name + "-full", base);
editorBase = new PixmapRegion(base);
}else{
editorBase = Core.atlas.getPixmap(gen[0]);
}
packer.add(PageType.editor, name + "-icon-editor", editorBase);

View File

@@ -41,6 +41,7 @@ public class ConstructBlock extends Block{
health = 10;
consumesTap = true;
solidifes = true;
generateIcons = false;
inEditor = false;
consBlocks[size - 1] = this;
sync = true;

View File

@@ -13,6 +13,7 @@ public class AirBlock extends Floor{
hasShadow = false;
useColor = false;
wall = this;
generateIcons = false;
needsSurface = false;
canShadow = false;
}

View File

@@ -161,8 +161,8 @@ public class Floor extends Block{
return;
}
PixmapRegion image = Core.atlas.getPixmap(icons()[0]);
PixmapRegion edge = Core.atlas.getPixmap(Core.atlas.find(name + "-edge-stencil", "edge-stencil"));
var image = Core.atlas.getPixmap(icons()[0]);
var edge = Core.atlas.getPixmap(Core.atlas.find(name + "-edge-stencil", "edge-stencil"));
Pixmap result = new Pixmap(edge.width, edge.height);
for(int x = 0; x < edge.width; x++){

View File

@@ -8,6 +8,7 @@ public class LegacyBlock extends Block{
public LegacyBlock(String name){
super(name);
inEditor = false;
generateIcons = false;
}
/** Removes this block from the world, or replaces it with something else. */