Name cleanup
This commit is contained in:
@@ -14,7 +14,6 @@
|
|||||||
63730=magmarock|block-magmarock-medium
|
63730=magmarock|block-magmarock-medium
|
||||||
63729=sand|block-sand-medium
|
63729=sand|block-sand-medium
|
||||||
63728=darksand|block-darksand-medium
|
63728=darksand|block-darksand-medium
|
||||||
63727=holostone|block-holostone-medium
|
|
||||||
63726=grass|block-grass-medium
|
63726=grass|block-grass-medium
|
||||||
63725=salt|block-salt-medium
|
63725=salt|block-salt-medium
|
||||||
63724=snow|block-snow-medium
|
63724=snow|block-snow-medium
|
||||||
@@ -285,7 +284,6 @@
|
|||||||
63451=scepter|unit-scepter-medium
|
63451=scepter|unit-scepter-medium
|
||||||
63450=reign|unit-reign-medium
|
63450=reign|unit-reign-medium
|
||||||
63449=dirt|block-dirt-medium
|
63449=dirt|block-dirt-medium
|
||||||
63448=dirtwall|block-dirtwall-medium
|
|
||||||
63447=stone-wall|block-stone-wall-medium
|
63447=stone-wall|block-stone-wall-medium
|
||||||
63446=spore-wall|block-spore-wall-medium
|
63446=spore-wall|block-spore-wall-medium
|
||||||
63445=ice-wall|block-ice-wall-medium
|
63445=ice-wall|block-ice-wall-medium
|
||||||
@@ -295,7 +293,6 @@
|
|||||||
63441=salt-wall|block-salt-wall-medium
|
63441=salt-wall|block-salt-wall-medium
|
||||||
63440=shale-wall|block-shale-wall-medium
|
63440=shale-wall|block-shale-wall-medium
|
||||||
63439=dirt-wall|block-dirt-wall-medium
|
63439=dirt-wall|block-dirt-wall-medium
|
||||||
63438=holostone-wall|block-holostone-wall-medium
|
|
||||||
63437=basalt|block-basalt-medium
|
63437=basalt|block-basalt-medium
|
||||||
63436=dacite|block-dacite-medium
|
63436=dacite|block-dacite-medium
|
||||||
63435=boulder|block-boulder-medium
|
63435=boulder|block-boulder-medium
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import arc.*;
|
|||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
|
import arc.math.geom.Geometry.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.struct.ObjectIntMap.*;
|
import arc.struct.ObjectIntMap.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@@ -554,10 +555,6 @@ public class World{
|
|||||||
return dark;
|
return dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Raycaster{
|
|
||||||
boolean accept(int x, int y);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class Context implements WorldContext{
|
private class Context implements WorldContext{
|
||||||
|
|
||||||
Context(){
|
Context(){
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class LoadRenderer implements Disposable{
|
|||||||
bars = new Bar[]{
|
bars = new Bar[]{
|
||||||
new Bar("s_proc#", OS.cores / 16f, OS.cores < 4),
|
new Bar("s_proc#", OS.cores / 16f, OS.cores < 4),
|
||||||
new Bar("c_aprog", () -> assets != null, () -> assets.getProgress(), () -> false),
|
new Bar("c_aprog", () -> assets != null, () -> assets.getProgress(), () -> false),
|
||||||
new Bar("g_vtype", graphics.getGLVersion().type == Type.GLES ? 0.5f : 1f, graphics.getGLVersion().type == Type.GLES),
|
new Bar("g_vtype", graphics.getGLVersion().type == GlType.GLES ? 0.5f : 1f, graphics.getGLVersion().type == GlType.GLES),
|
||||||
new Bar("s_mem#", () -> true, () -> Core.app.getJavaHeap() / 1024f / 1024f / 200f, () -> Core.app.getJavaHeap() > 1024 * 1024 * 110),
|
new Bar("s_mem#", () -> true, () -> Core.app.getJavaHeap() / 1024f / 1024f / 200f, () -> Core.app.getJavaHeap() > 1024 * 1024 * 110),
|
||||||
new Bar("v_ver#", () -> Version.build != 0, () -> Version.build == -1 ? 0.3f : (Version.build - 103f) / 10f, () -> !Version.modifier.equals("release")),
|
new Bar("v_ver#", () -> Version.build != 0, () -> Version.build == -1 ? 0.3f : (Version.build - 103f) / 10f, () -> !Version.modifier.equals("release")),
|
||||||
new Bar("s_osv", OS.isWindows ? 0.35f : OS.isLinux ? 0.9f : OS.isMac ? 0.5f : 0.2f, OS.isMac),
|
new Bar("s_osv", OS.isWindows ? 0.35f : OS.isLinux ? 0.9f : OS.isMac ? 0.5f : 0.2f, OS.isMac),
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import mindustry.type.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class Shaders{
|
public class Shaders{
|
||||||
public static BlockBuild blockbuild;
|
public static BlockBuildShader blockbuild;
|
||||||
public static @Nullable ShieldShader shield;
|
public static @Nullable ShieldShader shield;
|
||||||
public static BuildBeamShader buildBeam;
|
public static BuildBeamShader buildBeam;
|
||||||
public static UnitBuild build;
|
public static UnitBuildShader build;
|
||||||
public static DarknessShader darkness;
|
public static DarknessShader darkness;
|
||||||
public static LightShader light;
|
public static LightShader light;
|
||||||
public static SurfaceShader water, mud, tar, slag, space;
|
public static SurfaceShader water, mud, tar, slag, space;
|
||||||
@@ -31,7 +31,7 @@ public class Shaders{
|
|||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
mesh = new MeshShader();
|
mesh = new MeshShader();
|
||||||
blockbuild = new BlockBuild();
|
blockbuild = new BlockBuildShader();
|
||||||
try{
|
try{
|
||||||
shield = new ShieldShader();
|
shield = new ShieldShader();
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
@@ -40,7 +40,7 @@ public class Shaders{
|
|||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
buildBeam = new BuildBeamShader();
|
buildBeam = new BuildBeamShader();
|
||||||
build = new UnitBuild();
|
build = new UnitBuildShader();
|
||||||
darkness = new DarknessShader();
|
darkness = new DarknessShader();
|
||||||
light = new LightShader();
|
light = new LightShader();
|
||||||
water = new SurfaceShader("water");
|
water = new SurfaceShader("water");
|
||||||
@@ -142,12 +142,12 @@ public class Shaders{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class UnitBuild extends LoadShader{
|
public static class UnitBuildShader extends LoadShader{
|
||||||
public float progress, time;
|
public float progress, time;
|
||||||
public Color color = new Color();
|
public Color color = new Color();
|
||||||
public TextureRegion region;
|
public TextureRegion region;
|
||||||
|
|
||||||
public UnitBuild(){
|
public UnitBuildShader(){
|
||||||
super("unitbuild", "default");
|
super("unitbuild", "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,11 +162,11 @@ public class Shaders{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BlockBuild extends LoadShader{
|
public static class BlockBuildShader extends LoadShader{
|
||||||
public float progress;
|
public float progress;
|
||||||
public TextureRegion region = new TextureRegion();
|
public TextureRegion region = new TextureRegion();
|
||||||
|
|
||||||
public BlockBuild(){
|
public BlockBuildShader(){
|
||||||
super("blockbuild", "default");
|
super("blockbuild", "default");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ public class Build{
|
|||||||
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate) || //same block, same rotation
|
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate) || //same block, same rotation
|
||||||
!check.interactable(team) || //cannot interact
|
!check.interactable(team) || //cannot interact
|
||||||
!check.floor().placeableOn || //solid wall
|
!check.floor().placeableOn || //solid wall
|
||||||
|
(!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement)
|
||||||
!((type.canReplace(check.block()) || //can replace type
|
!((type.canReplace(check.block()) || //can replace type
|
||||||
//controversial change: allow rebuilding damaged blocks
|
//controversial change: allow rebuilding damaged blocks
|
||||||
//this could be buggy and abuse-able, so I'm not enabling it yet
|
//this could be buggy and abuse-able, so I'm not enabling it yet
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
package mindustry.world.meta;
|
|
||||||
|
|
||||||
import arc.struct.*;
|
|
||||||
import mindustry.gen.*;
|
|
||||||
|
|
||||||
public class Producers{
|
|
||||||
private Seq<Produce> producers = new Seq<>();
|
|
||||||
|
|
||||||
public void add(Produce prod){
|
|
||||||
producers.add(prod);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Produce{
|
|
||||||
void add(Building entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=e00afb8e4fb58902255b782b074e2836c027df9a
|
archash=eb0aebaca471905f03b9bf7103cc68a9589ef700
|
||||||
|
|||||||
@@ -4,18 +4,26 @@ import arc.files.*;
|
|||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
|
import java.nio.*;
|
||||||
|
import java.nio.charset.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import static mindustry.tools.ScriptMainGenerator.*;
|
import static mindustry.tools.ScriptMainGenerator.*;
|
||||||
|
|
||||||
//experimental
|
//experimental
|
||||||
public class BindingsGenerator{
|
public class BindingsGenerator{
|
||||||
//list of touchy class names that lead to conflicts; all typedefs and procs containing these are ignored
|
//list of touchy class names that lead to conflicts or should not be referenced; all typedefs and procs containing these are ignored
|
||||||
static Seq<String> ignored = Seq.with(".Entry", ".MapIterator");
|
static Seq<String> ignored = Seq.with(".Entry", ".MapIterator", "arc.freetype.FreeType.Glyph", "FrameBufferBuilder", "Spliterator",
|
||||||
|
"java.util.function", "java.util.stream", "ArrayList", "Constable", "Optional", "java.lang.reflect", "rhino.Context", "arc.graphics.GL20", "arc.graphics.GL30");
|
||||||
|
static ObjectSet<Class<?>> classSet = new ObjectSet<>();
|
||||||
|
static ObjectSet<String> keywords = ObjectSet.with("object", "string");
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception{
|
public static void main(String[] args) throws Exception{
|
||||||
|
|
||||||
Seq<String> blacklist = Seq.with("mindustry.tools", "arc.backend");
|
//37800
|
||||||
|
Seq<String> blacklist = Seq.with("mindustry.tools", "arc.backend", "arc.maps", "arc.util.serialization.Xml", "arc.fx", "arc.net", "arc.Net", "arc.freetype");
|
||||||
Seq<Class<?>> classes = Seq.withArrays(
|
Seq<Class<?>> classes = Seq.withArrays(
|
||||||
getClasses("mindustry"),
|
getClasses("mindustry"),
|
||||||
getClasses("arc")
|
getClasses("arc")
|
||||||
@@ -24,15 +32,54 @@ public class BindingsGenerator{
|
|||||||
classes.removeAll(type -> type.isSynthetic() || type.isAnonymousClass() || type.getCanonicalName() == null || Modifier.isPrivate(type.getModifiers())
|
classes.removeAll(type -> type.isSynthetic() || type.isAnonymousClass() || type.getCanonicalName() == null || Modifier.isPrivate(type.getModifiers())
|
||||||
|| blacklist.contains(s -> type.getName().startsWith(s)));
|
|| blacklist.contains(s -> type.getName().startsWith(s)));
|
||||||
|
|
||||||
classes.add(Enum.class);
|
classes.addAll(Enum.class, FloatBuffer.class, IntBuffer.class, ByteBuffer.class, StringBuilder.class,
|
||||||
|
Comparator.class, Comparable.class, Reader.class, Writer.class, PrintStream.class, PrintWriter.class, File.class, Charset.class,
|
||||||
|
ClassLoader.class, DoubleBuffer.class, CharBuffer.class, Locale.class,
|
||||||
|
LongBuffer.class, DataInputStream.class, DataOutputStream.class);
|
||||||
classes.distinct();
|
classes.distinct();
|
||||||
|
|
||||||
classes = sorted(classes);
|
classes = sorted(classes);
|
||||||
classes.removeAll(BindingsGenerator::ignore);
|
classes.removeAll(BindingsGenerator::ignore);
|
||||||
|
classes.removeAll(c -> !Modifier.isPublic(c.getModifiers()));
|
||||||
|
|
||||||
|
ObjectMap<String, Seq<Class<?>>> similars = new ObjectMap<>();
|
||||||
|
classes.each(c -> similars.get(c.getSimpleName(), Seq::new).add(c));
|
||||||
|
similars.each((key, val) -> {
|
||||||
|
if(val.size > 1){
|
||||||
|
Log.info("\n" + key + ":\n" + val.toString("\n", v -> "- " + v.getCanonicalName()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
classSet = classes.asSet();
|
||||||
|
classSet.addAll(Object.class, Number.class, Integer.class, Double.class, Short.class, Float.class, Byte.class, Long.class, String.class, Boolean.class, Throwable.class, Exception.class);
|
||||||
|
classSet.addAll(int.class, float.class, long.class, char.class, byte.class, boolean.class, double.class, short.class);
|
||||||
|
|
||||||
|
/*
|
||||||
|
//Cons<Class<?>> logger = c -> {
|
||||||
|
//if(!c.isPrimitive() && !c.isArray() && !ignore(c) && Modifier.isPublic(c.getModifiers()) && classSet.add(c)){
|
||||||
|
// Log.info(c);
|
||||||
|
//}
|
||||||
|
//};
|
||||||
|
|
||||||
|
for(Class<?> type : classes){
|
||||||
|
for(Field f : type.getDeclaredFields()){
|
||||||
|
if(Modifier.isPublic(f.getModifiers())){
|
||||||
|
logger.get(f.getType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Method f : type.getDeclaredMethods()){
|
||||||
|
if(Modifier.isPublic(f.getModifiers())){
|
||||||
|
logger.get(f.getReturnType());
|
||||||
|
for(Class<?> c : f.getParameterTypes()){
|
||||||
|
logger.get(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
result.append("import jnim, jnim/java/lang\n\n{.experimental: \"codeReordering\".}\n\n");
|
result.append("import jnim, jnim/java/lang\n\n{.experimental: \"codeReordering\".}\n{.push hint[ConvFromXtoItselfNotNeeded]: off.}\n\n");
|
||||||
|
|
||||||
for(Class<?> type : classes){
|
for(Class<?> type : classes){
|
||||||
result.append("jclassDef ").append(type.getCanonicalName()).append(" of `")
|
result.append("jclassDef ").append(type.getCanonicalName()).append(" of `")
|
||||||
@@ -44,17 +91,29 @@ public class BindingsGenerator{
|
|||||||
for(Class<?> type : classes){
|
for(Class<?> type : classes){
|
||||||
|
|
||||||
Seq<Executable> exec = new Seq<>();
|
Seq<Executable> exec = new Seq<>();
|
||||||
|
Seq<Method> methods = Seq.with(type.getDeclaredMethods());
|
||||||
|
|
||||||
exec.addAll(type.getDeclaredMethods());
|
methods.removeAll(m -> ignore(m.getReturnType()) || !discovered(m.getReturnType()));
|
||||||
|
|
||||||
|
exec.addAll(methods);
|
||||||
exec.addAll(type.getDeclaredConstructors());
|
exec.addAll(type.getDeclaredConstructors());
|
||||||
|
|
||||||
exec.removeAll(e -> !Modifier.isPublic(e.getModifiers()));
|
exec.removeAll(e -> !Modifier.isPublic(e.getModifiers()) || keywords.contains(e.getName()));
|
||||||
exec.removeAll(e -> Structs.contains(e.getParameterTypes(), BindingsGenerator::ignore));
|
exec.removeAll(e -> Structs.contains(e.getParameterTypes(), BindingsGenerator::ignore));
|
||||||
|
exec.removeAll(e -> Structs.contains(e.getParameterTypes(), p -> !discovered(p)));
|
||||||
|
|
||||||
Seq<Field> fields = Seq.select(type.getDeclaredFields(), f -> Modifier.isPublic(f.getModifiers()));
|
Seq<Field> fields = Seq.select(type.getDeclaredFields(), f ->
|
||||||
|
Modifier.isPublic(f.getModifiers()) &&
|
||||||
|
!keywords.contains(f.getName()) &&
|
||||||
|
!ignore(f.getType()) && Modifier.isPublic(f.getType().getModifiers()) &&
|
||||||
|
!(f.getType().isArray() &&
|
||||||
|
f.getType().getComponentType().isArray())
|
||||||
|
);
|
||||||
|
|
||||||
|
if(exec.size + fields.size <= 0) continue;
|
||||||
|
|
||||||
result.append("jclassImpl ").append(type.getCanonicalName()).append(" of `")
|
result.append("jclassImpl ").append(type.getCanonicalName()).append(" of `")
|
||||||
.append(repr(type.getSuperclass())).append("`").append(exec.size + fields.size > 0 ? ":" : "").append("\n");
|
.append(repr(type.getSuperclass())).append("`").append(":").append("\n");
|
||||||
|
|
||||||
for(Field field : fields){
|
for(Field field : fields){
|
||||||
result.append(" proc `").append(field.getName()).append("`");
|
result.append(" proc `").append(field.getName()).append("`");
|
||||||
@@ -67,6 +126,28 @@ public class BindingsGenerator{
|
|||||||
|
|
||||||
for(Executable method : exec){
|
for(Executable method : exec){
|
||||||
String mname = method.getName().equals("<init>") || method.getName().equals(type.getName()) ? "new" : method.getName();
|
String mname = method.getName().equals("<init>") || method.getName().equals(type.getName()) ? "new" : method.getName();
|
||||||
|
|
||||||
|
if(method instanceof Method){
|
||||||
|
Method m = (Method)method;
|
||||||
|
|
||||||
|
//if a field by the same name exists, use it to prevent ambiguity
|
||||||
|
if(method.getParameterCount() == 0 && fields.contains(f -> f.getName().equals(method.getName()))){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if this is a less specific method that was overridden by another method
|
||||||
|
if(methods.contains(other ->
|
||||||
|
other != m &&
|
||||||
|
m.getName().equals(other.getName()) &&
|
||||||
|
m.getParameterCount() == other.getParameterCount() &&
|
||||||
|
Arrays.equals(m.getParameterTypes(), other.getParameterTypes()) &&
|
||||||
|
m.getReturnType().isAssignableFrom(other.getReturnType())
|
||||||
|
)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
result.append(" proc `").append(mname).append("`");
|
result.append(" proc `").append(mname).append("`");
|
||||||
|
|
||||||
if(method.getParameterCount() > 0){
|
if(method.getParameterCount() > 0){
|
||||||
@@ -92,22 +173,26 @@ public class BindingsGenerator{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//result.append(" {.");
|
if(Modifier.isStatic(method.getModifiers())){
|
||||||
//if(Modifier.isStatic(field.getModifiers())) result.append(", `static`");
|
//result.append(" {.`static`.}");
|
||||||
//if(Modifier.isStatic(field.getModifiers())) result.append(", `final`");
|
}
|
||||||
//result.append(".}\n");
|
|
||||||
result.append("\n");
|
result.append("\n");
|
||||||
}
|
}
|
||||||
result.append("\n");
|
result.append("\n");
|
||||||
}
|
}
|
||||||
|
result.append("{.pop.}\n");
|
||||||
|
|
||||||
Fi.get("/home/anuke/Projects/Nimdustry-java/mindustry_bindings.nim").writeString(result.toString());
|
Fi.get("/home/anuke/Projects/Nimdustry-java/mindustry_bindings.nim").writeString(result.toString());
|
||||||
//Fi.get(OS.userhome).child("mindustry.nim").writeString(result.toString());
|
Log.info("Done. Classes found: @", classes.size);
|
||||||
Log.info(result);
|
}
|
||||||
|
|
||||||
|
static boolean discovered(Class<?> type){
|
||||||
|
return classSet.contains(type) || (type.isArray() && discovered(type.getComponentType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean ignore(Class<?> type){
|
static boolean ignore(Class<?> type){
|
||||||
if(type == null) return false;
|
if(type == null) return false;
|
||||||
|
if(type.isArray() && type.getComponentType().isArray()) return true;
|
||||||
return ignored.contains(s -> type.getCanonicalName().contains(s)) || ignore(type.getSuperclass());
|
return ignored.contains(s -> type.getCanonicalName().contains(s)) || ignore(type.getSuperclass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,13 +221,16 @@ public class BindingsGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
static String repr(Class type){
|
static String repr(Class type){
|
||||||
return type == null ? "JVMObject" : type.getSimpleName();
|
if(type == null || type.equals(Object.class)) return "JVMObject";
|
||||||
|
if(type.equals(String.class)) return "string";
|
||||||
|
if(!Modifier.isPublic(type.getModifiers())) return "Object";
|
||||||
|
return type.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
static String str(Class type){
|
static String str(Class type){
|
||||||
if(type.isArray()){
|
if(type.equals(Object.class)) return "JVMObject";
|
||||||
return "seq[" + str(type.getComponentType()) + "]";
|
if(type.equals(String.class)) return "string";
|
||||||
}
|
if(type.isArray()) return "seq[" + str(type.getComponentType()) + "]";
|
||||||
if(type.isPrimitive()) return "j" + type.getSimpleName();
|
if(type.isPrimitive()) return "j" + type.getSimpleName();
|
||||||
return type.getSimpleName();
|
return type.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import arc.*;
|
|||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
|
import arc.graphics.Pixmap.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
@@ -43,7 +44,7 @@ public class Generators{
|
|||||||
if(!fi.extEquals("png")) return;
|
if(!fi.extEquals("png")) return;
|
||||||
|
|
||||||
Pixmap pix = new Pixmap(fi);
|
Pixmap pix = new Pixmap(fi);
|
||||||
pix.setBlending(Pixmap.Blending.sourceOver);
|
pix.setBlending(PixmapBlending.sourceOver);
|
||||||
pix.each((x, y) -> {
|
pix.each((x, y) -> {
|
||||||
int value = pix.getPixel(x, y);
|
int value = pix.getPixel(x, y);
|
||||||
pix.draw(x, y, paletteMap.get(value, value));
|
pix.draw(x, y, paletteMap.get(value, value));
|
||||||
|
|||||||
Reference in New Issue
Block a user