Single-texture font+UI packing
This commit is contained in:
@@ -15,6 +15,7 @@ import java.io.*;
|
||||
*/
|
||||
public class FontGenerator{
|
||||
|
||||
//E000 to F8FF
|
||||
public static void main(String[] args){
|
||||
Net net = Core.net = new Net();
|
||||
net.setBlock(true);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ScriptStubGenerator{
|
||||
public static void main(String[] args){
|
||||
String base = "mindustry";
|
||||
Array<String> blacklist = Array.with("plugin", "mod", "net", "io", "tools");
|
||||
Array<String> nameBlacklist = Array.with("ClientLauncher", "NetClient", "NetServer", "ClassAccess");
|
||||
Array<String> nameBlacklist = Array.with("ClassAccess");
|
||||
Array<Class<?>> whitelist = Array.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class,
|
||||
AtlasRegion.class, String.class, Mathf.class, Angles.class, Color.class, Runnable.class, Object.class, Icon.class, Tex.class,
|
||||
Sounds.class, Musics.class, Call.class, Texture.class, TextureData.class, Pixmap.class, I18NBundle.class, Interval.class, DataInput.class, DataOutput.class,
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package mindustry.tools;
|
||||
|
||||
import arc.*;
|
||||
import arc.backend.sdl.*;
|
||||
import arc.files.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.util.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
//TODO remove
|
||||
public class Upscaler{
|
||||
public static void main(String[] args){
|
||||
new SdlApplication(new ApplicationListener(){
|
||||
@Override
|
||||
public void init(){
|
||||
scale();
|
||||
}
|
||||
}, new SdlConfig(){{
|
||||
initialVisible = false;
|
||||
}});
|
||||
}
|
||||
|
||||
static void scale(){
|
||||
Core.batch = new SpriteBatch();
|
||||
Core.atlas = new TextureAtlas();
|
||||
Core.atlas.addRegion("white", Pixmaps.blankTextureRegion());
|
||||
Fi file = Core.files.local("");
|
||||
|
||||
Log.info("Upscaling icons...");
|
||||
Time.mark();
|
||||
Fi[] list = file.list();
|
||||
|
||||
for(IconSize size : IconSize.values()){
|
||||
String suffix = size == IconSize.def ? "" : "-" + size.name();
|
||||
SquareMarcher marcher = new SquareMarcher(size.size);
|
||||
|
||||
for(Fi img : list){
|
||||
if(img.extension().equals("png")){
|
||||
marcher.render(new Pixmap(img), img.sibling(img.nameWithoutExtension() + suffix + ".png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.info("Done upscaling icons in &lm{0}&lgs.", Time.elapsed()/1000f);
|
||||
Core.app.exit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user