diff --git a/gmap.py b/gmap.py index e03f744..26ad620 100755 --- a/gmap.py +++ b/gmap.py @@ -39,12 +39,18 @@ def main(): results = world.render_chunks_async(chunks, False, options.procs) if options.procs > 1: for i, (col, row, filename) in enumerate(chunks): - results[col, row].wait() if i > 0: if 1000 % i == 0 or i % 1000 == 0: print "{0}/{1} chunks rendered".format(i, len(chunks)) results['pool'].join() + print "Done" + # Compat-change for windows (which can't pass result objects to + # subprocesses) + chunkmap = {} + for col, row, filename in chunks: + chunkmap[col, row] = results[col, row].get() + del results print "Writing out html file" if not os.path.exists(destdir): @@ -57,7 +63,7 @@ def main(): tiledir = os.path.join(destdir, "tiles") if not os.path.exists(tiledir): os.mkdir(tiledir) - world.generate_quadtree(results, mincol, maxcol, minrow, maxrow, tiledir, options.procs) + world.generate_quadtree(chunkmap, mincol, maxcol, minrow, maxrow, tiledir, options.procs) print "DONE" diff --git a/world.py b/world.py index 6208a26..130d867 100644 --- a/world.py +++ b/world.py @@ -273,10 +273,9 @@ def render_worldtile(chunkmap, colstart, colend, rowstart, rowend, oldhash): imghash = hashlib.md5() for row in xrange(rowstart-16, rowend+1): for col in xrange(colstart, colend+1): - chunkresult = chunkmap.get((col, row), None) - if not chunkresult: + chunkfile = chunkmap.get((col, row), None) + if not chunkfile: continue - chunkfile = chunkresult.get() tilelist.append((col, row, chunkfile)) # Get the hash of this image and add it to our hash for this tile imghash.update(