Switched from gdx-packer to arc-packer
This commit is contained in:
11
build.gradle
11
build.gradle
@@ -1,4 +1,8 @@
|
|||||||
buildscript{
|
buildscript{
|
||||||
|
ext{
|
||||||
|
arcExtVersion = "e287fdce0449a87fb15599c67b5167ac0273bcb6"
|
||||||
|
}
|
||||||
|
|
||||||
repositories{
|
repositories{
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -10,8 +14,9 @@ buildscript{
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8'
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8'
|
||||||
classpath "com.badlogicgames.gdx:gdx-tools:1.9.10"
|
|
||||||
classpath "com.github.anuken:packr:-SNAPSHOT"
|
classpath "com.github.anuken:packr:-SNAPSHOT"
|
||||||
|
classpath "com.github.Anuken.Arc:packer:$arcExtVersion"
|
||||||
|
classpath "com.github.Anuken.Arc:arc-core:$arcExtVersion"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,10 +313,8 @@ project(":annotations"){
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
def arcVersion = "e287fdce0449a87fb15599c67b5167ac0273bcb6"
|
|
||||||
|
|
||||||
compile 'com.squareup:javapoet:1.11.0'
|
compile 'com.squareup:javapoet:1.11.0'
|
||||||
compile "com.github.Anuken.Arc:arc-core:$arcVersion"
|
compile "com.github.Anuken.Arc:arc-core:$arcExtVersion"
|
||||||
compile files("${System.getProperty('java.home')}/../lib/tools.jar")
|
compile files("${System.getProperty('java.home')}/../lib/tools.jar")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=460d616ccc09942f462108337d0e6bf2bed8ded8
|
archash=1bb6b5430668b3c15657c2efbde5ec3d7bc11651
|
||||||
|
|||||||
@@ -3,12 +3,9 @@ apply plugin: "java"
|
|||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
sourceSets.main.java.srcDirs = ["src/"]
|
sourceSets.main.java.srcDirs = ["src/"]
|
||||||
|
|
||||||
|
import arc.struct.*
|
||||||
import com.badlogic.gdx.graphics.Color
|
import arc.graphics.*
|
||||||
import com.badlogic.gdx.tools.texturepacker.TexturePacker
|
import arc.packer.*
|
||||||
import com.badlogic.gdx.utils.IntArray
|
|
||||||
import com.badlogic.gdx.utils.IntIntMap
|
|
||||||
import com.badlogic.gdx.utils.IntMap
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO
|
import javax.imageio.ImageIO
|
||||||
import java.awt.*
|
import java.awt.*
|
||||||
@@ -87,7 +84,8 @@ def antialias = { File file ->
|
|||||||
suma.a += color.a
|
suma.a += color.a
|
||||||
}
|
}
|
||||||
|
|
||||||
suma.mul(suma.a <= 0.001f ? 0f : (float) (1f / suma.a))
|
float fm = suma.a <= 0.001f ? 0f : (float) (1f / suma.a)
|
||||||
|
suma.mul(fm, fm, fm, fm)
|
||||||
|
|
||||||
float total = 0
|
float total = 0
|
||||||
sum.set(0)
|
sum.set(0)
|
||||||
@@ -103,7 +101,8 @@ def antialias = { File file ->
|
|||||||
total += 1f
|
total += 1f
|
||||||
}
|
}
|
||||||
|
|
||||||
sum.mul((float) (1f / total))
|
fm = (float)(1f / total)
|
||||||
|
sum.mul(fm, fm, fm, fm)
|
||||||
int result = Color.argb8888(sum)
|
int result = Color.argb8888(sum)
|
||||||
out.setRGB(x, y, result)
|
out.setRGB(x, y, result)
|
||||||
sum.set(0)
|
sum.set(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user