Better mod sprite packing

This commit is contained in:
Anuken
2022-04-19 12:21:54 -04:00
parent a74c5ef943
commit 415402e61b
3 changed files with 61 additions and 6 deletions

View File

@@ -26,6 +26,20 @@ public class MultiPacker implements Disposable{
return null;
}
public void printStats(){
for(PageType type : PageType.all){
var packer = packers[type.ordinal()];
Log.debug("[Atlas] [&ly@&fr]", type);
Log.debug("[Atlas] - " + (packer.getPages().size > 1 ? "&fb&lr" : "&lg") + "@ page@&r", packer.getPages().size, packer.getPages().size > 1 ? "s" : "");
int i = 0;
for(var page : packer.getPages()){
Log.debug("[Atlas] - [@] @x@", i, page.getPixmap().width, page.getPixmap().height);
i ++;
}
}
}
public PixmapPacker getPacker(PageType type){
return packers[type.ordinal()];
}
@@ -78,10 +92,12 @@ public class MultiPacker implements Disposable{
//rubble page - scorch textures for unit deaths & wrecks
//ui page (sprites5.png) - content icons, white icons, fonts and UI elements
public enum PageType{
main(4096),
//main page can be massive.
main(8192),
environment(4096, 2048),
editor(4096, 2048),
rubble,
rubble(4096, 2048),
ui(4096);
public static final PageType[] all = values();