0

added the option to specify a list of chunks to update.

This commit is contained in:
Andrew Brown
2010-09-27 00:52:11 -04:00
parent 58202bd779
commit d637ddbbe1
4 changed files with 93 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ def main():
parser.add_option("-z", "--zoom", dest="zoom", help="Sets the zoom level manually instead of calculating it. This can be useful if you have outlier chunks that make your world too big. This value will make the highest zoom level contain (2**ZOOM)^2 tiles", action="store", type="int")
parser.add_option("-d", "--delete", dest="delete", help="Clear all caches. Next time you render your world, it will have to start completely over again. This is probably not a good idea for large worlds. Use this if you change texture packs and want to re-render everything.", action="store_true")
parser.add_option("--cachedir", dest="cachedir", help="Sets the directory where the Overviewer will save chunk images, which is an intermediate step before the tiles are generated. You must use the same directory each time to gain any benefit from the cache. If not set, this defaults to your world directory.")
parser.add_option("--chunklist", dest="chunklist", help="A file containing, on each line, a path to a chunkfile to update. Instead of scanning the world directory for chunks, it will just use this list. Normal caching rules still apply.")
options, args = parser.parse_args()
@@ -78,8 +79,14 @@ def main():
if options.delete:
return delete_all(cachedir, destdir)
if options.chunklist:
chunklist = open(options.chunklist, 'r')
else:
chunklist = None
# First generate the world's chunk images
w = world.WorldRenderer(worlddir, cachedir)
w = world.WorldRenderer(worlddir, cachedir, chunklist=chunklist)
w.go(options.procs)
# Now generate the tiles