Added replacement sprites
|
After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 251 B |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 223 B |
|
After Width: | Height: | Size: 350 B |
|
After Width: | Height: | Size: 228 B |
|
After Width: | Height: | Size: 368 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 320 B |
|
After Width: | Height: | Size: 186 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 362 B |
|
After Width: | Height: | Size: 199 B |
|
After Width: | Height: | Size: 378 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 179 B |
|
After Width: | Height: | Size: 321 B |
|
After Width: | Height: | Size: 165 B |
|
After Width: | Height: | Size: 306 B |
|
After Width: | Height: | Size: 168 B |
|
After Width: | Height: | Size: 283 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 389 B |
|
After Width: | Height: | Size: 249 B |
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 226 B |
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 195 B |
|
After Width: | Height: | Size: 342 B |
|
After Width: | Height: | Size: 374 B |
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 187 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 381 B |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 461 B |
|
After Width: | Height: | Size: 427 B |
|
After Width: | Height: | Size: 464 B |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites_replacement/blocks/power/power-node.png
Normal file
|
After Width: | Height: | Size: 460 B |
|
After Width: | Height: | Size: 472 B |
BIN
core/assets-raw/sprites_replacement/blocks/power/powervoid.png
Normal file
|
After Width: | Height: | Size: 438 B |
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||