changed "go" methods in world and quadtree to something more descriptive
This commit is contained in:
@@ -365,7 +365,9 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
|
|||||||
logging.error("To change north-direction of an existing render, use --forcerender")
|
logging.error("To change north-direction of an existing render, use --forcerender")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
w.go(options.procs)
|
# A couple other things we need to figure out about the world:
|
||||||
|
w.determine_bounds()
|
||||||
|
w.find_true_spawn()
|
||||||
|
|
||||||
logging.info("Rending the following tilesets: %s", ",".join(options.rendermode))
|
logging.info("Rending the following tilesets: %s", ",".join(options.rendermode))
|
||||||
|
|
||||||
@@ -394,9 +396,9 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
|
|||||||
qtree = quadtree.QuadtreeGen(w, destdir, rendermode=rendermode, **qtree_args)
|
qtree = quadtree.QuadtreeGen(w, destdir, rendermode=rendermode, **qtree_args)
|
||||||
q.append(qtree)
|
q.append(qtree)
|
||||||
|
|
||||||
# do quadtree-level preprocessing
|
# Make sure the quadtrees are the correct depth
|
||||||
for qtree in q:
|
for qtree in q:
|
||||||
qtree.go(options.procs)
|
qtree.check_depth()
|
||||||
|
|
||||||
# create the distributed render
|
# create the distributed render
|
||||||
r = rendernode.RenderNode(q, options)
|
r = rendernode.RenderNode(q, options)
|
||||||
|
|||||||
@@ -196,8 +196,11 @@ class QuadtreeGen(object):
|
|||||||
except OSError, e:
|
except OSError, e:
|
||||||
pass # doesn't exist maybe?
|
pass # doesn't exist maybe?
|
||||||
|
|
||||||
def go(self, procs):
|
def check_depth(self):
|
||||||
"""Processing before tile rendering"""
|
"""Ensure the current quadtree is the correct depth. If it's not,
|
||||||
|
employ some simple re-arranging of tiles to save on computation.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
curdepth = self._get_cur_depth()
|
curdepth = self._get_cur_depth()
|
||||||
if curdepth != -1:
|
if curdepth != -1:
|
||||||
|
|||||||
@@ -298,10 +298,11 @@ class World(object):
|
|||||||
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
|
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
|
||||||
self.spawn = (disp_spawnX, spawnY, disp_spawnZ)
|
self.spawn = (disp_spawnX, spawnY, disp_spawnZ)
|
||||||
|
|
||||||
def go(self, procs):
|
def determine_bounds(self):
|
||||||
"""Scan the world directory, to fill in
|
"""Scan the world directory, to fill in
|
||||||
self.{min,max}{col,row} for use later in quadtree.py. This
|
self.{min,max}{col,row} for use later in quadtree.py.
|
||||||
also does other world-level processing."""
|
|
||||||
|
"""
|
||||||
|
|
||||||
logging.info("Scanning chunks")
|
logging.info("Scanning chunks")
|
||||||
# find the dimensions of the map, in region files
|
# find the dimensions of the map, in region files
|
||||||
@@ -340,8 +341,6 @@ class World(object):
|
|||||||
self.minrow = minrow
|
self.minrow = minrow
|
||||||
self.maxrow = maxrow
|
self.maxrow = maxrow
|
||||||
|
|
||||||
self.find_true_spawn()
|
|
||||||
|
|
||||||
def _get_north_rotations(self):
|
def _get_north_rotations(self):
|
||||||
if self.north_direction == 'upper-left':
|
if self.north_direction == 'upper-left':
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user