0

I think this should fix windows support

This commit is contained in:
Andrew Brown
2010-09-14 18:12:02 -04:00
parent 0003950c5e
commit 44fc65d753
2 changed files with 10 additions and 5 deletions

10
gmap.py
View File

@@ -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"