Switched from gdx-packer to arc-packer

This commit is contained in:
Anuken 2020-01-22 19:16:56 -05:00
parent 78b2fe64a3
commit eb8479f7f7
3 changed files with 16 additions and 14 deletions

View File

@ -1,4 +1,8 @@
buildscript{
ext{
arcExtVersion = "e287fdce0449a87fb15599c67b5167ac0273bcb6"
}
repositories{
mavenLocal()
mavenCentral()
@ -10,8 +14,9 @@ buildscript{
dependencies{
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.Arc:packer:$arcExtVersion"
classpath "com.github.Anuken.Arc:arc-core:$arcExtVersion"
}
}
@ -308,10 +313,8 @@ project(":annotations"){
apply plugin: "java"
dependencies{
def arcVersion = "e287fdce0449a87fb15599c67b5167ac0273bcb6"
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")
}
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=460d616ccc09942f462108337d0e6bf2bed8ded8
archash=1bb6b5430668b3c15657c2efbde5ec3d7bc11651

View File

@ -3,12 +3,9 @@ apply plugin: "java"
sourceCompatibility = 1.8
sourceSets.main.java.srcDirs = ["src/"]
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.tools.texturepacker.TexturePacker
import com.badlogic.gdx.utils.IntArray
import com.badlogic.gdx.utils.IntIntMap
import com.badlogic.gdx.utils.IntMap
import arc.struct.*
import arc.graphics.*
import arc.packer.*
import javax.imageio.ImageIO
import java.awt.*
@ -16,7 +13,7 @@ import java.awt.image.BufferedImage
import java.util.List
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit
def genFolder = "../core/assets-raw/sprites_out/generated/"
def doAntialias = !project.hasProperty("disableAntialias")
@ -87,7 +84,8 @@ def antialias = { File file ->
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
sum.set(0)
@ -103,7 +101,8 @@ def antialias = { File file ->
total += 1f
}
sum.mul((float) (1f / total))
fm = (float)(1f / total)
sum.mul(fm, fm, fm, fm)
int result = Color.argb8888(sum)
out.setRGB(x, y, result)
sum.set(0)