0

changed "go" methods in world and quadtree to something more descriptive

This commit is contained in:
Andrew Brown
2011-11-01 11:32:28 -04:00
parent 996b299c79
commit 96cf62bd14
3 changed files with 14 additions and 10 deletions

View File

@@ -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")
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))
@@ -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)
q.append(qtree)
# do quadtree-level preprocessing
# Make sure the quadtrees are the correct depth
for qtree in q:
qtree.go(options.procs)
qtree.check_depth()
# create the distributed render
r = rendernode.RenderNode(q, options)

View File

@@ -196,8 +196,11 @@ class QuadtreeGen(object):
except OSError, e:
pass # doesn't exist maybe?
def go(self, procs):
"""Processing before tile rendering"""
def check_depth(self):
"""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()
if curdepth != -1:

View File

@@ -298,10 +298,11 @@ class World(object):
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
self.spawn = (disp_spawnX, spawnY, disp_spawnZ)
def go(self, procs):
def determine_bounds(self):
"""Scan the world directory, to fill in
self.{min,max}{col,row} for use later in quadtree.py. This
also does other world-level processing."""
self.{min,max}{col,row} for use later in quadtree.py.
"""
logging.info("Scanning chunks")
# find the dimensions of the map, in region files
@@ -340,8 +341,6 @@ class World(object):
self.minrow = minrow
self.maxrow = maxrow
self.find_true_spawn()
def _get_north_rotations(self):
if self.north_direction == 'upper-left':
return 1