diff --git a/res/character_spritesheet.dat b/res/.mci similarity index 100% rename from res/character_spritesheet.dat rename to res/.mci diff --git a/res/character_spritesheet.mci b/res/character_spritesheet.mci new file mode 100644 index 0000000..6f93cd5 Binary files /dev/null and b/res/character_spritesheet.mci differ diff --git a/res/tiles/dirt.dat b/res/tiles/dirt.mci similarity index 100% rename from res/tiles/dirt.dat rename to res/tiles/dirt.mci diff --git a/res/tiles/gravel.dat b/res/tiles/gravel.mci similarity index 100% rename from res/tiles/gravel.dat rename to res/tiles/gravel.mci diff --git a/res/tiles/ice.dat b/res/tiles/ice.mci similarity index 100% rename from res/tiles/ice.dat rename to res/tiles/ice.mci diff --git a/res/tiles/lava.dat b/res/tiles/lava.mci similarity index 100% rename from res/tiles/lava.dat rename to res/tiles/lava.mci diff --git a/res/tiles/null.dat b/res/tiles/null.mci similarity index 100% rename from res/tiles/null.dat rename to res/tiles/null.mci diff --git a/res/tiles/water.dat b/res/tiles/water.mci similarity index 100% rename from res/tiles/water.dat rename to res/tiles/water.mci diff --git a/res/tileset.txt b/res/tileset.txt index 23e1cbb..dbdbebd 100644 --- a/res/tileset.txt +++ b/res/tileset.txt @@ -8,7 +8,7 @@ # [keywords] # # The image path is relative to res/ folder. -# Do not include the file extension (always PNG). +# Do not include the file extension (always MCI). # If image path is null, it won't render. # # The OPTIONAL case-insensitive keywords are: diff --git a/src/game/Game.java b/src/game/Game.java index e662bc9..563f0a2 100644 --- a/src/game/Game.java +++ b/src/game/Game.java @@ -817,7 +817,7 @@ public int charId(boolean down, boolean right, boolean up, boolean left) { // loads a bufferedimage in by filename public BufferedImage getImage(String name) throws Exception { - byte[] imagedata = decompress(Files.readAllBytes(new File("../res/" + name + ".dat").toPath())); + byte[] imagedata = decompress(Files.readAllBytes(new File("../res/" + name + ".mci").toPath())); int xmax = imagedata[0]; int ymax = (imagedata.length - 1) / xmax; BufferedImage b = new BufferedImage(xmax, ymax, BufferedImage.TYPE_INT_ARGB); @@ -830,6 +830,7 @@ public BufferedImage getImage(String name) throws Exception { return b; } + // decompresses the data into a byte array public static byte[] decompress(byte[] data) throws IOException, DataFormatException { Inflater inflater = new Inflater(); inflater.setInput(data); @@ -881,6 +882,7 @@ class Tile { } class Colors { + // all of the colors in the images public static final int[] colors = new int[] { 0xff747474, 0xff24188c, diff --git a/src/tileeditor/Main.java b/src/tileeditor/Main.java index 41d5a2c..40f269b 100644 --- a/src/tileeditor/Main.java +++ b/src/tileeditor/Main.java @@ -94,7 +94,7 @@ public class Main { public static void main(String[] args) { fc.setAcceptAllFileFilterUsed(true); fc.setMultiSelectionEnabled(false); - fc.setFileFilter(new FileNameExtensionFilter(".dat File", "dat")); + fc.setFileFilter(new FileNameExtensionFilter("Mooncat Compressed Image (.mci)", "mci")); refresh(); frame = new JFrame("Tile Editor"); panel1 = new JPanel() { @@ -260,8 +260,8 @@ public static void save() { colormap[0] = (byte)xmax; File f = fc.getSelectedFile(); String filePath = f.getAbsolutePath(); - if(!filePath.endsWith(".dat")) { - f = new File(filePath + ".dat"); + if(!filePath.endsWith(".mci")) { + f = new File(filePath + ".mci"); } Files.write(f.toPath(), compress(colormap)); } catch(Exception e) {