diff --git a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java index 394cff4f..619597fc 100644 --- a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java +++ b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java @@ -132,17 +132,18 @@ public class TileSetBundler public TileSetBundler (File configFile) throws IOException { - this(configFile, false); + this(configFile, false, false); } /** * Constructs a tileset bundler with the specified bundler config * file and whether to keep pngs as-is or if not, re-encode them. */ - public TileSetBundler (File configFile, boolean keepRawPngs) + public TileSetBundler (File configFile, boolean keepRawPngs, boolean uncompressed) throws IOException { _keepRawPngs = keepRawPngs; + _uncompressed = uncompressed; // we parse our configuration with a digester Digester digester = new Digester(); @@ -352,7 +353,7 @@ public class TileSetBundler File target, TileSetBundle bundle, ImageProvider improv, String imageBase, long newestMod) throws IOException { - return createBundleJar(target, bundle, improv, imageBase, _keepRawPngs); + return createBundleJar(target, bundle, improv, imageBase, _keepRawPngs, _uncompressed); } /** @@ -367,14 +368,14 @@ public class TileSetBundler */ public static boolean createBundleJar ( File target, TileSetBundle bundle, ImageProvider improv, String imageBase, - boolean keepOriginalPngs) + boolean keepOriginalPngs, boolean uncompressed) throws IOException { // now we have to create the actual bundle file FileOutputStream fout = new FileOutputStream(target); Manifest manifest = new Manifest(); JarOutputStream jar = new JarOutputStream(fout, manifest); - jar.setLevel(Deflater.BEST_COMPRESSION); + jar.setLevel(uncompressed ? Deflater.NO_COMPRESSION : Deflater.BEST_COMPRESSION); try { // write all of the image files to the bundle, converting the @@ -516,4 +517,7 @@ public class TileSetBundler /** Whether we should keep pngs as-is rather than re-encoding. */ protected boolean _keepRawPngs; + + /** Normally we compress the jar, but if we want to leave them uncompressed, we set this. */ + protected boolean _uncompressed; } diff --git a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundlerTask.java b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundlerTask.java index b186c621..cb8d741b 100644 --- a/src/java/com/threerings/media/tile/bundle/tools/TileSetBundlerTask.java +++ b/src/java/com/threerings/media/tile/bundle/tools/TileSetBundlerTask.java @@ -75,6 +75,15 @@ public class TileSetBundlerTask extends Task _keepRawPngs = keep; } + /** + * Note whether we are supposed to leave the jar uncompressed rather than the normal process + * of zipping it at maximum compression. + */ + public void setUncompressed (boolean uncompressed) + { + _uncompressed = uncompressed; + } + /** * Performs the actual work of the task. */ @@ -146,7 +155,7 @@ public class TileSetBundlerTask extends Task protected TileSetBundler createBundler () throws IOException { - return new TileSetBundler(_config, _keepRawPngs); + return new TileSetBundler(_config, _keepRawPngs, _uncompressed); } /** @@ -173,4 +182,7 @@ public class TileSetBundlerTask extends Task /** Whether we should keep raw pngs rather than reencoding them in the bundle. */ protected boolean _keepRawPngs; + + /** Whether we should keep the bundle jars uncompressed rather than zipped. */ + protected boolean _uncompressed; }