MakeTiles: impl generation of different-sized tiles

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@734 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-07-17 20:30:36 +00:00
parent 3c31e19ed1
commit 4c623c92c3
2 changed files with 15 additions and 1 deletions

View file

@ -50,6 +50,12 @@
<arg file="graphics/tiles.rc" />
<arg file="${builddir}/tiles.png" />
</java>
<java classname="micropolisj.build_tool.MakeTiles" classpath="${builddir}"
fork="true" dir="graphics">
<sysproperty key="tile_size" value="32" />
<arg file="graphics/tiles.rc" />
<arg file="${builddir}/tiles_32x32.png" />
</java>
<copy todir="${builddir}" file="graphics/tiles.rc" />
</target>

View file

@ -16,11 +16,19 @@ public class MakeTiles
static final Charset UTF8 = Charset.forName("UTF-8");
static final int NTILES = 960;
static final int TILE_SIZE = 16;
static int TILE_SIZE = 16;
public static void main(String [] args)
throws Exception
{
if (args.length != 2) {
throw new Exception("Wrong number of arguments");
}
if (System.getProperty("tile_size") != null) {
TILE_SIZE = Integer.parseInt(System.getProperty("tile_size"));
}
File recipeFile = new File(args[0]);
File outputFile = new File(args[1]);