[vassalengine-svn] SF.net SVN: vassalengine:[7850] VASSAL-src/trunk/src/VASSAL/launch/ TilingHandle
Brought to you by:
rodneykinney,
uckelman
From: <uck...@us...> - 2011-09-28 22:14:17
|
Revision: 7850 http://vassalengine.svn.sourceforge.net/vassalengine/?rev=7850&view=rev Author: uckelman Date: 2011-09-28 22:14:10 +0000 (Wed, 28 Sep 2011) Log Message: ----------- isFresh() doesn't need the DataArchive. Slightly more efficient. Modified Paths: -------------- VASSAL-src/trunk/src/VASSAL/launch/TilingHandler.java Modified: VASSAL-src/trunk/src/VASSAL/launch/TilingHandler.java =================================================================== --- VASSAL-src/trunk/src/VASSAL/launch/TilingHandler.java 2011-09-28 21:42:11 UTC (rev 7849) +++ VASSAL-src/trunk/src/VASSAL/launch/TilingHandler.java 2011-09-28 22:14:10 UTC (rev 7850) @@ -94,17 +94,16 @@ this.pid = pid; } - protected boolean isFresh(DataArchive archive, + protected boolean isFresh(FileArchive archive, FileStore tcache, String iname) throws IOException { - final FileArchive fa = archive.getArchive(); final String apath = DataArchive.IMAGE_DIR + iname; // look at the first 1:1 tile final String tpath = TileUtils.tileName(iname, 0, 0, 1); // check whether the image is older than the tile - final long imtime = fa.getMTime(apath); + final long imtime = archive.getMTime(apath); return imtime > 0 && // time in archive might be goofy imtime <= tcache.getMTime(tpath); @@ -136,9 +135,11 @@ int maxpix = 0; // number of pixels in the largest image int tcount = 0; // tile count + final FileArchive fa = archive.getArchive(); + for (String iname : images) { // skip images with fresh tiles - if (isFresh(archive, tcache, iname)) continue; + if (isFresh(fa, tcache, iname)) continue; final Dimension idim; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |