0

Create RegionSets via the World object

This commit is contained in:
Andrew Chin
2012-01-21 19:04:21 -05:00
parent c63029a14d
commit 163dd66a38
5 changed files with 23 additions and 11 deletions

View File

@@ -277,16 +277,22 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
if not os.path.exists(destdir):
os.mkdir(destdir)
# saves us from creating the same World object over and over again
worldcache = {}
for render_name in render_things:
render = render_things[render_name]
logging.debug("Found the following render thing: %r", render)
# XXX we now construct the regionset directly
#w = world.World(render['worldpath'])
if (render['worldname'] not in worldcache):
w = world.World(render['worldname'])
worldcache[render['worldname']] = w
else:
w = worldcache[render['worldname']]
# if no dimension has been specified, just use the first one
# TODO support the case where a different dimension is specified
rset = world.RegionSet(render['worldname'])
# TODO get the correct regionset based on render['dimension']
rset = w.get_regionset(0)
logging.debug("Using RegionSet %r", rset)
# create our TileSet from this RegionSet