0

Add lily pads to biome tinting. Fix pumpkin and melon stem.

This commit is contained in:
Alejandro Aguilera
2011-11-07 16:21:03 +01:00
parent 29bc7fa0ba
commit e2dde5e6e0
2 changed files with 22 additions and 18 deletions

View File

@@ -173,7 +173,9 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
* get constant brown color (see textures.py) */ * get constant brown color (see textures.py) */
(((state->block == 104) || (state->block == 105)) && (state->block_data != 7)) || (((state->block == 104) || (state->block == 105)) && (state->block_data != 7)) ||
/* vines */ /* vines */
state->block == 106) state->block == 106 ||
/* lily pads */
state->block == 111)
{ {
/* do the biome stuff! */ /* do the biome stuff! */
PyObject *facemask = mask; PyObject *facemask = mask;
@@ -240,6 +242,10 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
/* vines */ /* vines */
color = PySequence_GetItem(self->grasscolor, index); color = PySequence_GetItem(self->grasscolor, index);
break; break;
case 111:
/* lily padas */
color = PySequence_GetItem(self->grasscolor, index);
break;
default: default:
break; break;
}; };
@@ -270,7 +276,8 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
facemask = NULL; facemask = NULL;
} }
if (state->block == 18 || state->block == 106) /* leaves and vines */ if (state->block == 18 || state->block == 106 || state->block == 111)
/* leaves, vines and lyli pads */
{ {
r = 37; r = 37;
g = 118; g = 118;

View File

@@ -2509,23 +2509,20 @@ block(blockid=103, top_index=137, side_index=136, solid=True)
def stem(blockid, data, north): def stem(blockid, data, north):
# the ancildata value indicates how much of the texture # the ancildata value indicates how much of the texture
# is shown. # is shown.
if data & 7 == 0:
# not fully grown stem or no pumpkin/melon touching it, # not fully grown stem or no pumpkin/melon touching it,
# straight up stem # straight up stem
t = terrain_images[111].copy() t = terrain_images[111].copy()
img = Image.new("RGBA", (16,16), bgcolor) img = Image.new("RGBA", (16,16), bgcolor)
composite.alpha_over(img, t, (0, int(16 - 16*((data + 1)/8.))), t) composite.alpha_over(img, t, (0, int(16 - 16*((data + 1)/8.))), t)
img = build_sprite(t) img = build_sprite(t)
if data & 7 == 7: if data & 7 == 7:
# fully grown stem gets brown color! # fully grown stem gets brown color!
# there is a conditional in rendermode-normal to not # there is a conditional in rendermode-normal.c to not
# tint the data value 7 # tint the data value 7
img = tintTexture(img, (211,169,116)) img = tintTexture(img, (211,169,116))
return img return img
else: # fully grown, and a pumpking/melon touching it,
# corner stem
return None
# vines # vines
# TODO multiple sides of a block can contain vines! At the moment # TODO multiple sides of a block can contain vines! At the moment