0

textures are now only generated when actual *rendering* is done

This commit is contained in:
Aaron Griffith
2011-05-13 12:30:13 -04:00
parent d2c9b80239
commit 93424c296d
5 changed files with 63 additions and 48 deletions

View File

@@ -26,6 +26,8 @@ import collections
import json
import logging
import util
import textures
import c_overviewer
import cPickle
import stat
import errno
@@ -59,14 +61,22 @@ def pool_initializer(rendernode):
logging.debug("Child process {0}".format(os.getpid()))
#stash the quadtree objects in a global variable after fork() for windows compat.
global child_rendernode
child_rendernode = rendernode
child_rendernode = rendernode
# make sure textures are generated for this process
# and initialize c_overviewer
textures.generate()
c_overviewer.init_chunk_render()
# load biome data in each process, if needed
for quadtree in rendernode.quadtrees:
if quadtree.world.useBiomeData:
import textures
# make sure we've at least *tried* to load the color arrays in this process...
textures.prepareBiomeData(quadtree.world.worlddir)
if not textures.grasscolor or not textures.foliagecolor:
raise Exception("Can't find grasscolor.png or foliagecolor.png")
# only load biome data once
break
#http://docs.python.org/library/itertools.html
def roundrobin(iterables):