Sprite packing fix

This commit is contained in:
Anuken
2021-06-03 11:37:33 -04:00
parent 17873d93cc
commit 1313ed2761
3 changed files with 18 additions and 25 deletions

View File

@ -4,9 +4,5 @@
flattenPaths: true, flattenPaths: true,
maxWidth: 4096, maxWidth: 4096,
maxHeight: 4096, maxHeight: 4096,
fast: true, fast: true
edgePadding: false,
bleed: false,
debug: true
} }

View File

@ -385,7 +385,7 @@ public class Renderer implements ApplicationListener{
lines[i + 3] = (byte)255; lines[i + 3] = (byte)255;
} }
Pixmap fullPixmap = new Pixmap(w, h); Pixmap fullPixmap = new Pixmap(w, h);
Buffers.copy(lines, 0, fullPixmap.getPixels(), lines.length); Buffers.copy(lines, 0, fullPixmap.pixels, lines.length);
Fi file = screenshotDirectory.child("screenshot-" + Time.millis() + ".png"); Fi file = screenshotDirectory.child("screenshot-" + Time.millis() + ".png");
PixmapIO.writePng(file, fullPixmap); PixmapIO.writePng(file, fullPixmap);
fullPixmap.dispose(); fullPixmap.dispose();

View File

@ -212,8 +212,6 @@ task pack(dependsOn: [classes, configurations.runtimeClasspath]){
delete "../core/assets-raw/sprites_out/ui/icons" delete "../core/assets-raw/sprites_out/ui/icons"
} }
//disabled until the elusive sprite packing bug is fixed
if(false){
ExecutorService executor = Executors.newFixedThreadPool(16) ExecutorService executor = Executors.newFixedThreadPool(16)
long ms = System.currentTimeMillis() long ms = System.currentTimeMillis()
@ -234,7 +232,6 @@ task pack(dependsOn: [classes, configurations.runtimeClasspath]){
} }
println "Time taken for AA: ${(System.currentTimeMillis() - ms) / 1000f}" println "Time taken for AA: ${(System.currentTimeMillis() - ms) / 1000f}"
}
println("\n\nPacking normal 4096 sprites...\n\n") println("\n\nPacking normal 4096 sprites...\n\n")