0

Merge branch 'snapshot'

Conflicts:
	overviewer_core/src/iterate.c
This commit is contained in:
Andrew Chin
2013-10-25 23:34:01 -04:00
3 changed files with 86 additions and 11 deletions

View File

@@ -273,7 +273,7 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
*/
int x = state->x, y = state->y, z = state->z;
unsigned char data = 0;
if (state->block == 2) { /* grass */
/* return 0x10 if grass is covered in snow */
if (get_data(state, BLOCKS, x, y+1, z) == 78)
@@ -543,6 +543,17 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
}
return ancilData;
} else if (state->block == 175) { /* doublePlants */
/* use bottom block data format plus one bit for top
* block (0x8)
*/
if( get_data(state, BLOCKS, x, y-1, z) == 175 ) {
data = get_data(state, DATA, x, y-1, z) | 0x8;
} else {
data = ancilData;
}
return data;
}
return 0;
@@ -689,7 +700,8 @@ chunk_render(PyObject *self, PyObject *args) {
(state.block == 85) || (state.block == 90) ||
(state.block == 101) || (state.block == 102) ||
(state.block == 111) || (state.block == 113) ||
(state.block == 139) || is_stairs(state.block)) {
(state.block == 139) || (state.block == 175) ||
is_stairs(state.block)) {
ancilData = generate_pseudo_data(&state, ancilData);
state.block_pdata = ancilData;
} else {
@@ -711,6 +723,7 @@ chunk_render(PyObject *self, PyObject *args) {
if (t != NULL && t != Py_None)
{
PyObject *src, *mask, *mask_light;
int do_rand = (state.block == 31 /*|| state.block == 38 || state.block == 175*/);
int randx = 0, randy = 0;
src = PyTuple_GetItem(t, 0);
mask = PyTuple_GetItem(t, 0);
@@ -719,7 +732,7 @@ chunk_render(PyObject *self, PyObject *args) {
if (mask == Py_None)
mask = src;
if (state.block == 31) {
if (do_rand) {
/* add a random offset to the postion of the tall grass to make it more wild */
randx = rand() % 6 + 1 - 3;
randy = rand() % 6 + 1 - 3;
@@ -729,7 +742,7 @@ chunk_render(PyObject *self, PyObject *args) {
render_mode_draw(rendermode, src, mask, mask_light);
if (state.block == 31) {
if (do_rand) {
/* undo the random offsets */
state.imgx -= randx;
state.imgy -= randy;