0

updated biome rendering to use latest Biome Extractor format

This commit is contained in:
Aaron Griffith
2011-03-03 12:27:47 -05:00
parent 1bb6d03c90
commit a6805c2e0c
4 changed files with 19 additions and 16 deletions

View File

@@ -824,9 +824,9 @@ def prepareBiomeData(worlddir):
if grasscolor and foliagecolor:
return
biomeDir = os.path.join(worlddir, "EXTRACTEDBIOMES")
biomeDir = os.path.join(worlddir, "biomes")
if not os.path.exists(biomeDir):
raise Exception("EXTRACTEDBIOMES not found")
raise Exception("biomes not found")
# try to find the biome color images. If _find_file can't locate them
# then try looking in the EXTRACTEDBIOMES folder
@@ -850,16 +850,16 @@ def getBiomeData(worlddir, chunkX, chunkY):
global currentBiomeFile, currentBiomeData
biomeFile = "%d.%d.biome" % (
int(math.floor(chunkX/8)*8),
int(math.floor(chunkY/8)*8)
biomeFile = "b.%d.%d.biome" % (
int(math.floor(chunkX/32)),
int(math.floor(chunkY/32))
)
if biomeFile == currentBiomeFile:
return currentBiomeData
currentBiomeFile = biomeFile
f = open(os.path.join(worlddir, "EXTRACTEDBIOMES", biomeFile), "rb")
f = open(os.path.join(worlddir, "biomes", biomeFile), "rb")
rawdata = f.read()
f.close()