0

the "waay to big" error now gives an upper bound on zoom level

This commit is contained in:
Aaron Griffith
2011-10-24 07:52:02 -04:00
parent e61291de4f
commit 79a3e0d795

View File

@@ -80,7 +80,7 @@ class QuadtreeGen(object):
if depth is None: if depth is None:
# Determine quadtree depth (midpoint is always 0,0) # Determine quadtree depth (midpoint is always 0,0)
for p in xrange(15): for p in xrange(64):
# Will 2^p tiles wide and high suffice? # Will 2^p tiles wide and high suffice?
# X has twice as many chunks as tiles, then halved since this is a # X has twice as many chunks as tiles, then halved since this is a
@@ -92,10 +92,12 @@ class QuadtreeGen(object):
if xradius >= worldobj.maxcol and -xradius <= worldobj.mincol and \ if xradius >= worldobj.maxcol and -xradius <= worldobj.mincol and \
yradius >= worldobj.maxrow and -yradius <= worldobj.minrow: yradius >= worldobj.maxrow and -yradius <= worldobj.minrow:
break break
else:
raise ValueError("Your map is waaaay too big! Use the 'zoom' option in 'settings.py'.")
if p < 15:
self.p = p self.p = p
else:
raise ValueError("Your map is waaaay too big! Use the 'zoom' option in 'settings.py'. Overviewer is estimating %i zoom levels, but you probably want less." % (p,))
else: else:
self.p = depth self.p = depth
xradius = 2**depth xradius = 2**depth