Fix problem with not replacing non-blank tiles with newly blank ones

This commit is contained in:
Mike Primm 2011-10-04 12:25:27 +08:00 committed by mikeprimm
parent c5287b8427
commit c857a1d002

View File

@ -1124,13 +1124,14 @@ public class IsoHDPerspective implements HDPerspective {
long crc = hashman.calculateTileHash(argb_buf[i]);
boolean tile_update = false;
String prefix = shaderstate[i].getMap().getPrefix();
if(rendered[i]) {
renderone = true;
MapType.ImageFormat fmt = shaderstate[i].getMap().getImageFormat();
String fname = tile.getFilename(prefix, fmt);
File f = new File(tile.getDynmapWorld().worldtilepath, fname);
FileLockManager.getWriteLock(f);
try {
if(rendered[i])
renderone = true;
if((!f.exists()) || (crc != hashman.getImageHashCode(tile.getKey(), prefix, tile.tx, tile.ty))) {
/* Wrap buffer as buffered image */
Debug.debug("saving image " + f.getPath());
@ -1191,7 +1192,6 @@ public class IsoHDPerspective implements HDPerspective {
MapManager.mapman.updateStatistics(tile, prefix, true, tile_update, !rendered[i]);
}
}
}
return renderone;
}