0

Merge remote branch 'xon/dtt-c-render-region-cache' into dtt-c-render

This commit is contained in:
Aaron Griffith
2011-03-19 20:49:17 -04:00
2 changed files with 10 additions and 14 deletions

View File

@@ -651,16 +651,10 @@ def render_worldtile(quadtree, chunks, colstart, colend, rowstart, rowend, path)
# check chunk mtimes to see if they are newer
try:
#tile_mtime = os.path.getmtime(imgpath)
regionMtimes = {}
needs_rerender = False
for col, row, chunkx, chunky, regionfile in chunks:
# check region file mtime first.
# Note: we cache the value since it's actually very likely we will have multipule chunks in the same region, and syscalls are expensive
regionMtime = regionMtimes.get(regionfile,None)
if regionMtime is None:
regionMtime = os.path.getmtime(regionfile)
regionMtimes[regionfile] = regionMtime
regionMtime = world.get_region_mtime(regionfile)
if regionMtime <= tile_mtime:
continue