From e2dde5e6e0ddf2b98492b58602e5f27390869bd3 Mon Sep 17 00:00:00 2001 From: Alejandro Aguilera Date: Mon, 7 Nov 2011 16:21:03 +0100 Subject: [PATCH] Add lily pads to biome tinting. Fix pumpkin and melon stem. --- overviewer_core/src/rendermode-normal.c | 11 ++++++++-- overviewer_core/textures.py | 29 +++++++++++-------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/overviewer_core/src/rendermode-normal.c b/overviewer_core/src/rendermode-normal.c index e37a47a..24bf665 100644 --- a/overviewer_core/src/rendermode-normal.c +++ b/overviewer_core/src/rendermode-normal.c @@ -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; diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index b984f69..918940a 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -2509,23 +2509,20 @@ 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() - img = Image.new("RGBA", (16,16), bgcolor) - composite.alpha_over(img, t, (0, int(16 - 16*((data + 1)/8.))), t) - img = build_sprite(t) - if data & 7 == 7: - # fully grown stem gets brown color! - # there is a conditional in rendermode-normal to not - # tint the data value 7 - img = tintTexture(img, (211,169,116)) - return img + + # not fully grown stem or no pumpkin/melon touching it, + # straight up stem + t = terrain_images[111].copy() + img = Image.new("RGBA", (16,16), bgcolor) + composite.alpha_over(img, t, (0, int(16 - 16*((data + 1)/8.))), t) + img = build_sprite(t) + if data & 7 == 7: + # fully grown stem gets brown color! + # 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