Not to freak out completely if we encounter an error trimming a tileset
image. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1671 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: ComponentBundlerTask.java,v 1.11 2002/06/21 18:44:28 mdb Exp $
|
// $Id: ComponentBundlerTask.java,v 1.12 2002/09/11 19:31:40 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.cast.bundle.tools;
|
package com.threerings.cast.bundle.tools;
|
||||||
|
|
||||||
@@ -181,17 +181,29 @@ public class ComponentBundlerTask extends Task
|
|||||||
return ImageIO.read(new File(path));
|
return ImageIO.read(new File(path));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
TrimmedTileSet tset =
|
|
||||||
TrimmedTileSet.trimTileSet(aset, jout);
|
|
||||||
tset.setImagePath(ipath);
|
|
||||||
|
|
||||||
// also write our trimmed tileset to the jar file
|
TrimmedTileSet tset = null;
|
||||||
String tpath = composePath(
|
try {
|
||||||
info, BundleUtil.TILESET_EXTENSION);
|
tset = TrimmedTileSet.trimTileSet(aset, jout);
|
||||||
jout.putNextEntry(new JarEntry(tpath));
|
tset.setImagePath(ipath);
|
||||||
ObjectOutputStream oout = new ObjectOutputStream(jout);
|
} catch (Throwable t) {
|
||||||
oout.writeObject(tset);
|
System.err.println(
|
||||||
oout.flush();
|
"Failure trimming tileset " +
|
||||||
|
"[class=" + info[0] + ", name=" + info[1] +
|
||||||
|
", action=" + info[2] +
|
||||||
|
", srcimg=" + aset.getImagePath() +
|
||||||
|
", error=" + t.getMessage() + "].");
|
||||||
|
}
|
||||||
|
|
||||||
|
// then write our trimmed tileset to the jar file
|
||||||
|
if (tset != null) {
|
||||||
|
String tpath = composePath(
|
||||||
|
info, BundleUtil.TILESET_EXTENSION);
|
||||||
|
jout.putNextEntry(new JarEntry(tpath));
|
||||||
|
ObjectOutputStream oout = new ObjectOutputStream(jout);
|
||||||
|
oout.writeObject(tset);
|
||||||
|
oout.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user