0

added check to textures.py prepareBiomeData so it will only run once per process

This commit is contained in:
Aaron Griffith
2011-01-01 15:43:45 -08:00
parent 0136cc1eba
commit b2d8c415ca

View File

@@ -753,12 +753,16 @@ grasscolor = None
foliagecolor = None foliagecolor = None
def prepareBiomeData(worlddir): def prepareBiomeData(worlddir):
global grasscolor, foliagecolor
# skip if the color files are already loaded
if grasscolor and foliagecolor:
return
biomeDir = os.path.join(worlddir, "EXTRACTEDBIOMES") biomeDir = os.path.join(worlddir, "EXTRACTEDBIOMES")
if not os.path.exists(biomeDir): if not os.path.exists(biomeDir):
raise Exception("EXTRACTEDBIOMES not found") raise Exception("EXTRACTEDBIOMES not found")
global grasscolor, foliagecolor
# try to find the biome color images. If _find_file can't locate them # try to find the biome color images. If _find_file can't locate them
# then try looking in the EXTRACTEDBIOMES folder # then try looking in the EXTRACTEDBIOMES folder
try: try: