textures are now only generated when actual *rendering* is done
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user