Biome data from Biome Extractor is now used if it is present.
If the BIOMEEXTRACTOR data is not available, then non-biome aware tinting will be used Open biome data in binary mode (Windows requires this)
This commit is contained in:
38
textures.py
38
textures.py
@@ -498,7 +498,7 @@ def generate_special_texture(blockID, data):
|
||||
return (img.convert("RGB"), img.split()[3])
|
||||
|
||||
if blockID == 2: # grass
|
||||
top = transform_image(tintTexture(terrain_images[0],(170,255,50)))
|
||||
top = transform_image(tintTexture(terrain_images[0],(115,175,71)))
|
||||
side1 = transform_image_side(terrain_images[3])
|
||||
side2 = transform_image_side(terrain_images[3]).transpose(Image.FLIP_LEFT_RIGHT)
|
||||
|
||||
@@ -510,7 +510,7 @@ def generate_special_texture(blockID, data):
|
||||
return (img.convert("RGB"), img.split()[3])
|
||||
|
||||
if blockID == 18: # leaves
|
||||
t = tintTexture(terrain_images[52], (170, 255, 50))
|
||||
t = tintTexture(terrain_images[52], (37, 118, 25))
|
||||
top = transform_image(t)
|
||||
side1 = transform_image_side(t)
|
||||
side2 = transform_image_side(t).transpose(Image.FLIP_LEFT_RIGHT)
|
||||
@@ -542,9 +542,29 @@ def prepareGrassTexture(color):
|
||||
img.paste(top, (0,0), top)
|
||||
return (img.convert("RGB"), img.split()[3])
|
||||
|
||||
# TODO be more intelligent about where to find these files
|
||||
grasscolor = list(Image.open("grasscolor.png").getdata())
|
||||
foliagecolor = list(Image.open("foliagecolor.png").getdata())
|
||||
|
||||
def prepareLeafTexture(color):
|
||||
t = tintTexture(terrain_images[52], color)
|
||||
top = transform_image(t)
|
||||
side1 = transform_image_side(t)
|
||||
side2 = transform_image_side(t).transpose(Image.FLIP_LEFT_RIGHT)
|
||||
|
||||
img = Image.new("RGBA", (24,24), (38,92,255,0))
|
||||
|
||||
img.paste(side1, (0,6), side1)
|
||||
img.paste(side2, (12,6), side2)
|
||||
img.paste(top, (0,0), top)
|
||||
return (img.convert("RGB"), img.split()[3])
|
||||
|
||||
#useBiomeData = os.path.exists(os.path.join(self.world, EXTRACTEDBIOMES))
|
||||
#if not useBiomeData:
|
||||
# logging.info("Notice: Not using biome data for tinting")
|
||||
|
||||
try:
|
||||
grasscolor = list(Image.open(_find_file("grasscolor.png")).getdata())
|
||||
foliagecolor = list(Image.open(_find_file("foliagecolor.png")).getdata())
|
||||
except:
|
||||
pass
|
||||
|
||||
currentBiomeFile = None
|
||||
currentBiomeData = None
|
||||
@@ -566,7 +586,7 @@ def prepareBiomeData(worlddir, chunkX, chunkY):
|
||||
|
||||
t.currentBiomeFile = biomeFile
|
||||
|
||||
f = open(os.path.join(worlddir, "EXTRACTEDBIOMES", biomeFile))
|
||||
f = open(os.path.join(worlddir, "EXTRACTEDBIOMES", biomeFile), "rb")
|
||||
rawdata = f.read()
|
||||
f.close()
|
||||
|
||||
@@ -577,7 +597,7 @@ def prepareBiomeData(worlddir, chunkX, chunkY):
|
||||
|
||||
# This set holds block ids that require special pre-computing. These are typically
|
||||
# things that require ancillary data to render properly (i.e. ladder plus orientation)
|
||||
special_blocks = set([66,59,61,62, 65,64,71,91,86])
|
||||
special_blocks = set([66,59,61,62, 65,64,71,91,86,2,18])
|
||||
|
||||
# this is a map of special blockIDs to a list of all
|
||||
# possible values for ancillary data that it might have.
|
||||
@@ -594,8 +614,8 @@ special_map[86] = range(5) # pumpkin
|
||||
# apparently pumpkins and jack-o-lanterns have ancillary data, but it's unknown
|
||||
# what that data represents. For now, assume that the range for data is 0 to 5
|
||||
# like torches
|
||||
#special_map[2] = (0,) # grass
|
||||
#special_map[18] = range(16) # leaves
|
||||
special_map[2] = (0,) # grass
|
||||
special_map[18] = range(16) # leaves
|
||||
# grass and leaves are now graysacle in terrain.png
|
||||
# we treat them as special so we can manually tint them
|
||||
# it is unknown how the specific tint (biomes) is calculated
|
||||
|
||||
Reference in New Issue
Block a user