I think this should fix windows support
This commit is contained in:
10
gmap.py
10
gmap.py
@@ -39,12 +39,18 @@ def main():
|
|||||||
results = world.render_chunks_async(chunks, False, options.procs)
|
results = world.render_chunks_async(chunks, False, options.procs)
|
||||||
if options.procs > 1:
|
if options.procs > 1:
|
||||||
for i, (col, row, filename) in enumerate(chunks):
|
for i, (col, row, filename) in enumerate(chunks):
|
||||||
results[col, row].wait()
|
|
||||||
if i > 0:
|
if i > 0:
|
||||||
if 1000 % i == 0 or i % 1000 == 0:
|
if 1000 % i == 0 or i % 1000 == 0:
|
||||||
print "{0}/{1} chunks rendered".format(i, len(chunks))
|
print "{0}/{1} chunks rendered".format(i, len(chunks))
|
||||||
|
|
||||||
results['pool'].join()
|
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"
|
print "Writing out html file"
|
||||||
if not os.path.exists(destdir):
|
if not os.path.exists(destdir):
|
||||||
@@ -57,7 +63,7 @@ def main():
|
|||||||
tiledir = os.path.join(destdir, "tiles")
|
tiledir = os.path.join(destdir, "tiles")
|
||||||
if not os.path.exists(tiledir):
|
if not os.path.exists(tiledir):
|
||||||
os.mkdir(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"
|
print "DONE"
|
||||||
|
|
||||||
|
|||||||
5
world.py
5
world.py
@@ -273,10 +273,9 @@ def render_worldtile(chunkmap, colstart, colend, rowstart, rowend, oldhash):
|
|||||||
imghash = hashlib.md5()
|
imghash = hashlib.md5()
|
||||||
for row in xrange(rowstart-16, rowend+1):
|
for row in xrange(rowstart-16, rowend+1):
|
||||||
for col in xrange(colstart, colend+1):
|
for col in xrange(colstart, colend+1):
|
||||||
chunkresult = chunkmap.get((col, row), None)
|
chunkfile = chunkmap.get((col, row), None)
|
||||||
if not chunkresult:
|
if not chunkfile:
|
||||||
continue
|
continue
|
||||||
chunkfile = chunkresult.get()
|
|
||||||
tilelist.append((col, row, chunkfile))
|
tilelist.append((col, row, chunkfile))
|
||||||
# Get the hash of this image and add it to our hash for this tile
|
# Get the hash of this image and add it to our hash for this tile
|
||||||
imghash.update(
|
imghash.update(
|
||||||
|
|||||||
Reference in New Issue
Block a user