Mis à jour les tiles de gazon
This commit is contained in:
parent
0eff34c418
commit
91679db18d
|
@ -25,7 +25,10 @@ public class EditorAPI
|
||||||
for (int x = 1; x < width; x += 16)
|
for (int x = 1; x < width; x += 16)
|
||||||
{
|
{
|
||||||
bytes.add((byte) 0);
|
bytes.add((byte) 0);
|
||||||
|
bytes.add((byte) 0);
|
||||||
|
bytes.add((byte) (Byte.MIN_VALUE / 2));
|
||||||
}
|
}
|
||||||
|
bytes.remove(bytes.lastIndexOf((byte) (Byte.MIN_VALUE / 2)));
|
||||||
bytes.add(Byte.MIN_VALUE);
|
bytes.add(Byte.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,11 @@ public class SpriteRegister
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static void refreshAllSprites()
|
public static void refreshAllSprites()
|
||||||
{
|
{
|
||||||
|
if (nameToCoords != null && !nameToCoords.isEmpty() && !sprites.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(SpriteRegister.class.getResourceAsStream("/assets/unknown/textures/sprites/sprites.json")));
|
BufferedReader br = new BufferedReader(new InputStreamReader(SpriteRegister.class.getResourceAsStream("/assets/unknown/textures/sprites/sprites.json")));
|
||||||
|
@ -43,9 +48,7 @@ public class SpriteRegister
|
||||||
{
|
{
|
||||||
int x = list.get(0).intValue();
|
int x = list.get(0).intValue();
|
||||||
int y = list.get(1).intValue();
|
int y = list.get(1).intValue();
|
||||||
int width = list.get(2).intValue() * 16;
|
BufferedImage child = img.getSubimage(x, y, 16, 16);
|
||||||
int height = list.get(3).intValue() * 16;
|
|
||||||
BufferedImage child = img.getSubimage(x, y, width, height);
|
|
||||||
Sprite sprite = new Sprite(child);
|
Sprite sprite = new Sprite(child);
|
||||||
lSprites.add(sprite);
|
lSprites.add(sprite);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
@ -1,11 +1,82 @@
|
||||||
{
|
{
|
||||||
"gazon": [
|
"gazon": [
|
||||||
[0,15,1,5],
|
[0,0],
|
||||||
[0,144,1,3],
|
[0,16],
|
||||||
[16,144,2,2],
|
[0,32],
|
||||||
[32,208,6,2],
|
[0,48],
|
||||||
[128,144,1,2],
|
[0,64],
|
||||||
[160,156,3,2],
|
[0,144],
|
||||||
[160,32,1,3]
|
[0,160],
|
||||||
|
[0,176],
|
||||||
|
[16,144],
|
||||||
|
[32,144],
|
||||||
|
[16,160],
|
||||||
|
[32,160],
|
||||||
|
[32,224],
|
||||||
|
[48,224],
|
||||||
|
[64,224],
|
||||||
|
[80,224],
|
||||||
|
[96,224],
|
||||||
|
[112,224],
|
||||||
|
[112,208],
|
||||||
|
[159,48],
|
||||||
|
[160,166],
|
||||||
|
[176,166],
|
||||||
|
[128,144],
|
||||||
|
[128,160],
|
||||||
|
[144,80],
|
||||||
|
[48,36],
|
||||||
|
[64,36],
|
||||||
|
[54,53],
|
||||||
|
[70,53],
|
||||||
|
[48,70],
|
||||||
|
[16,28],
|
||||||
|
[16,16],
|
||||||
|
[16,32],
|
||||||
|
[16,48],
|
||||||
|
[16,64],
|
||||||
|
[16,80],
|
||||||
|
[32,16],
|
||||||
|
[32,32],
|
||||||
|
[32,48],
|
||||||
|
[32,64],
|
||||||
|
[32,80],
|
||||||
|
[48,64],
|
||||||
|
[48,80],
|
||||||
|
[64,64],
|
||||||
|
[64,80],
|
||||||
|
[80,64],
|
||||||
|
[80,80],
|
||||||
|
[96,64],
|
||||||
|
[96,80],
|
||||||
|
[112,64],
|
||||||
|
[112,80],
|
||||||
|
[128,80],
|
||||||
|
[128,64],
|
||||||
|
[112,48],
|
||||||
|
[128,48],
|
||||||
|
[112,32],
|
||||||
|
[128,32],
|
||||||
|
[112,16],
|
||||||
|
[128,16],
|
||||||
|
[64,128],
|
||||||
|
[80,128],
|
||||||
|
[96,128],
|
||||||
|
[48,144],
|
||||||
|
[64,144],
|
||||||
|
[80,144],
|
||||||
|
[96,144],
|
||||||
|
[48,160],
|
||||||
|
[96,160],
|
||||||
|
[48,176],
|
||||||
|
[96,176],
|
||||||
|
[32,176],
|
||||||
|
[112,176],
|
||||||
|
[64,160],
|
||||||
|
[80,160],
|
||||||
|
[64,176],
|
||||||
|
[80,176],
|
||||||
|
[64,192],
|
||||||
|
[80,192]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue