big commits to a bunch of stuff. See expanded message
Added an option to enter your own zoom level. Use -z to set the map at a particular zoom level. Zoom levels define the width and height in tiles of the highest zoom level, each new zoom level is twice as wide and tall. (z=6 -> 2^6 tiles wide and tall) Implemented tile re-arrangement on map expansion. Now most tiles will get re-used if your map needs another zoom level! No longer does it need to re-generate everything. No longer creates empty directories for tiles, only creates directories if needed. Fixed some minor off-by-one logic (and the code that canceled it out to make it work)
This commit is contained in:
3
gmap.py
3
gmap.py
@@ -21,6 +21,7 @@ def main():
|
||||
cpus = 1
|
||||
parser = OptionParser(usage=helptext)
|
||||
parser.add_option("-p", "--processes", dest="procs", help="How many chunks to render in parallel. A good number for this is the number of cores in your computer. Default %s" % cpus, default=cpus, action="store", type="int")
|
||||
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")
|
||||
|
||||
options, args = parser.parse_args()
|
||||
@@ -43,7 +44,7 @@ def main():
|
||||
w.go(options.procs)
|
||||
|
||||
# Now generate the tiles
|
||||
q = quadtree.QuadtreeGen(w, destdir)
|
||||
q = quadtree.QuadtreeGen(w, destdir, depth=options.zoom)
|
||||
q.go(options.procs)
|
||||
|
||||
def delete_all(worlddir, tiledir):
|
||||
|
||||
Reference in New Issue
Block a user