Fix initial zoomout processing (unnecessary updates), extra tile invalidates

This commit is contained in:
Mike Primm 2011-08-15 06:43:08 +08:00 committed by mikeprimm
parent 6860d8952f
commit 4cb5b9a956
6 changed files with 53 additions and 19 deletions

View file

@ -105,12 +105,21 @@ public class DynmapWorld {
}
}
private static final String COORDSTART = "-0123456789";
private static class PNGFileFilter implements FilenameFilter {
String prefix;
String suffix;
public PNGFileFilter(String pre, MapType.ImageFormat fmt) { prefix = pre; suffix = "." + fmt.getFileExt(); }
public PNGFileFilter(String pre, MapType.ImageFormat fmt) {
if((pre != null) && (pre.length() > 0))
prefix = pre;
suffix = "." + fmt.getFileExt();
}
public boolean accept(File f, String n) {
if(n.endsWith(suffix) && n.startsWith(prefix)) {
if(n.endsWith(suffix)) {
if((prefix != null) && (!n.startsWith(prefix)))
return false;
if((prefix == null) && (COORDSTART.indexOf(n.charAt(0)) < 0))
return false;
File fn = new File(f, n);
return fn.isFile();
}