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) */
(((state->block == 104) || (state->block == 105)) && (state->block_data != 7)) ||
/* vines */
state->block == 106)
state->block == 106 ||
/* lily pads */
state->block == 111)
{
/* do the biome stuff! */
PyObject *facemask = mask;
@@ -240,6 +242,10 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
/* vines */
color = PySequence_GetItem(self->grasscolor, index);
break;
case 111:
/* lily padas */
color = PySequence_GetItem(self->grasscolor, index);
break;
default:
break;
};
@@ -270,7 +276,8 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
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;
g = 118;

View File

@@ -2509,7 +2509,7 @@ block(blockid=103, top_index=137, side_index=136, solid=True)
def stem(blockid, data, north):
# the ancildata value indicates how much of the texture
# is shown.
if data & 7 == 0:
# not fully grown stem or no pumpkin/melon touching it,
# straight up stem
t = terrain_images[111].copy()
@@ -2518,14 +2518,11 @@ def stem(blockid, data, north):
img = build_sprite(t)
if data & 7 == 7:
# 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
img = tintTexture(img, (211,169,116))
return img
else: # fully grown, and a pumpking/melon touching it,
# corner stem
return None
# vines
# TODO multiple sides of a block can contain vines! At the moment