Added replacement sprites

This commit is contained in:
Anuken
2018-11-13 22:11:29 -05:00
parent a9df64f861
commit d824b41bbb
52 changed files with 53 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

View File

@@ -3,16 +3,16 @@ apply plugin: "java"
sourceCompatibility = 1.8 sourceCompatibility = 1.8
sourceSets.main.java.srcDirs = [ "src/" ] sourceSets.main.java.srcDirs = [ "src/" ]
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.tools.texturepacker.TexturePacker import com.badlogic.gdx.tools.texturepacker.TexturePacker
import javax.imageio.ImageIO import javax.imageio.ImageIO
import java.awt.image.BufferedImage
def outFolder = "../core/assets-raw/sprites_out/" def outFolder = "../core/assets-raw/sprites_out/"
def genFolder = "../core/assets-raw/sprites_out/generated/" def genFolder = "../core/assets-raw/sprites_out/generated/"
def scaling = "XBRZ 4x" def scaling = "XBRZ 4x"
def do4 = true
task swapColors(){ task swapColors(){
doLast{ doLast{
@@ -47,9 +47,53 @@ task swapColors(){
} }
} }
task scaleSprites4x(){
doLast{
fileTree(dir: '../core/assets-raw/sprites_out/', include: "**/*.png").visit { file ->
if(file.isDirectory() || file.toString().contains("/ui/")) return;
for(int iteration in 0..1) {
def image = ImageIO.read(file.file)
def scaled = new BufferedImage(image.getWidth() * 2, image.getHeight() * 2, BufferedImage.TYPE_INT_ARGB)
def getRGB = { int ix, int iy ->
return image.getRGB(Math.max(Math.min(ix, image.width - 1), 0), Math.max(Math.min(iy, image.height - 1), 0))
}
for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
int p = image.getRGB(x, y)
int p1 = p, p2 = p, p3 = p, p4 = p
int A = getRGB(x, y + 1),
B = getRGB(x + 1, y),
C = getRGB(x - 1, y),
D = getRGB(x, y - 1);
if (C == A && C != D && A != B) p1 = A
if (A == B && A != C && B != D) p2 = B
if (D == C && D != B && C != A) p3 = C
if (B == D && B != A && D != C) p4 = D
scaled.setRGB(x * 2, y * 2 + 1, p1)
scaled.setRGB(x * 2 + 1, y * 2 + 1, p2)
scaled.setRGB(x * 2, y * 2, p3)
scaled.setRGB(x * 2 + 1, y * 2, p4)
}
}
ImageIO.write(scaled, "png", file.file)
}
}
}
}
task scaleSprites(){ task scaleSprites(){
finalizedBy 'genSprites' finalizedBy 'genSprites'
if(do4) dependsOn 'scaleSprites4x'
doLast{ doLast{
def arguments = ["mono", "ImageResizer.exe"] def arguments = ["mono", "ImageResizer.exe"]
@@ -62,9 +106,7 @@ task scaleSprites(){
"auto", scaling, "/save", write.toString()] "auto", scaling, "/save", write.toString()]
} }
exec{ if(!do4) exec{ commandLine arguments }
commandLine arguments
}
} }
} }
@@ -73,11 +115,15 @@ task pack(){
doLast{ doLast{
copy{
from "../core/assets-raw/sprites_replacement/"
into "../core/assets-raw/sprites_out/"
}
TexturePacker.process("core/assets-raw/sprites_out/", "core/assets/sprites/", "sprites.atlas") TexturePacker.process("core/assets-raw/sprites_out/", "core/assets/sprites/", "sprites.atlas")
delete{ delete{
delete outFolder // delete outFolder
delete genFolder
} }
} }
} }