1
0
mirror of https://github.com/ynerant/Level-Editor.git synced 2025-06-21 09:58:24 +02:00

Mis à jour les tiles de gazon

This commit is contained in:
galaxyoyo
2015-01-08 13:59:28 +01:00
parent 0eff34c418
commit 91679db18d
4 changed files with 87 additions and 10 deletions

View File

@ -25,7 +25,10 @@ public class EditorAPI
for (int x = 1; x < width; x += 16)
{
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);
}

View File

@ -24,6 +24,11 @@ public class SpriteRegister
@SuppressWarnings("unchecked")
public static void refreshAllSprites()
{
if (nameToCoords != null && !nameToCoords.isEmpty() && !sprites.isEmpty())
{
return;
}
try
{
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 y = list.get(1).intValue();
int width = list.get(2).intValue() * 16;
int height = list.get(3).intValue() * 16;
BufferedImage child = img.getSubimage(x, y, width, height);
BufferedImage child = img.getSubimage(x, y, 16, 16);
Sprite sprite = new Sprite(child);
lSprites.add(sprite);
}