0

support for biome coloring on side grass (closes issue #341)

This commit is contained in:
Aaron Griffith
2011-04-28 19:18:29 -04:00
parent a09d7f3d16
commit d163e7c527
3 changed files with 9 additions and 16 deletions

View File

@@ -26,7 +26,7 @@
// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 4
#define OVERVIEWER_EXTENSION_VERSION 5
/* Python PIL, and numpy headers */
#include <Python.h>

View File

@@ -120,17 +120,8 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
RenderModeNormal *self = (RenderModeNormal *)data;
/* first, check to see if we should use biome-compatible src, mask */
if (self->biome_data) {
switch (state->block) {
case 2:
src = mask = self->grass_texture;
break;
case 18:
if (self->biome_data && state->block == 18) {
src = mask = self->leaf_texture;
break;
default:
break;
};
}
/* draw the block! */
@@ -149,7 +140,8 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
case 2:
/* grass */
color = PySequence_GetItem(self->grasscolor, index);
facemask = self->facemask_top;
facemask = self->grass_texture;
alpha_over(state->img, self->grass_texture, self->grass_texture, state->imgx, state->imgy, 0, 0);
break;
case 18:
/* leaves */

View File

@@ -432,8 +432,9 @@ def generate_special_texture(blockID, data):
# all need to behandled here (and in chunkpy)
if blockID == 2: # grass
top = tintTexture(terrain_images[0],(115,175,71))
img = _build_block(top, terrain_images[3], 2)
img = _build_block(terrain_images[0], terrain_images[3], 2)
colored = tintTexture(biome_grass_texture, (115, 175, 71))
composite.alpha_over(img, colored, (0, 0), colored)
return (img.convert("RGB"), img.split()[3])
@@ -1179,7 +1180,7 @@ def tintTexture(im, c):
return i
# generate biome (still grayscale) leaf, grass textures
biome_grass_texture = _build_block(terrain_images[0], terrain_images[3], 2)
biome_grass_texture = _build_block(terrain_images[0], terrain_images[38], 2)
biome_leaf_texture = _build_block(terrain_images[52], terrain_images[52], 18)