mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-10 15:57:37 +07:00
Sprite packing fix
This commit is contained in:
@ -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
|
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
@ -212,30 +212,27 @@ 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
|
ExecutorService executor = Executors.newFixedThreadPool(16)
|
||||||
if(false){
|
long ms = System.currentTimeMillis()
|
||||||
ExecutorService executor = Executors.newFixedThreadPool(16)
|
|
||||||
long ms = System.currentTimeMillis()
|
|
||||||
|
|
||||||
//antialias everything except UI elements
|
//antialias everything except UI elements
|
||||||
fileTree(dir: new File(rootDir, 'core/assets-raw/sprites_out/').absolutePath, include: "**/*.png").visit{ file ->
|
fileTree(dir: new File(rootDir, 'core/assets-raw/sprites_out/').absolutePath, include: "**/*.png").visit{ file ->
|
||||||
if(file.isDirectory() || (file.toString().replace("\\", "/").contains("/ui/") && file.toString().startsWith("icon-")) || file.toString().contains(".9.png")) return
|
if(file.isDirectory() || (file.toString().replace("\\", "/").contains("/ui/") && file.toString().startsWith("icon-")) || file.toString().contains(".9.png")) return
|
||||||
|
|
||||||
executor.submit{
|
executor.submit{
|
||||||
antialias(file.file)
|
antialias(file.file)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
executor.shutdown()
|
|
||||||
try{
|
|
||||||
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS)
|
|
||||||
}catch(InterruptedException e){
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
|
|
||||||
println "Time taken for AA: ${(System.currentTimeMillis() - ms) / 1000f}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
executor.shutdown()
|
||||||
|
try{
|
||||||
|
executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS)
|
||||||
|
}catch(InterruptedException e){
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
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")
|
||||||
|
|
||||||
//pack normal sprites
|
//pack normal sprites
|
||||||
|
Reference in New Issue
Block a user