0

Draw ice in the same way is done with water and glass and shade it like water.

This commit is contained in:
Alejandro Aguilera
2011-08-03 11:04:03 +02:00
parent f7e1867588
commit a2b156c85f
3 changed files with 17 additions and 11 deletions

View File

@@ -174,7 +174,7 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
data = (check_adjacent_blocks(state, x, y, z, state->block) ^ 0x0f);
return data;
}
} else if (state->block == 20) { /* glass */
} else if ((state->block == 20) || (state->block == 79)) { /* glass and ice */
/* an aditional bit for top is added to the 4 bits of check_adjacent_blocks */
if ((z != 127) && (getArrayByte3D(state->blocks, x, y, z+1) == 20)) {
data = 0;
@@ -413,10 +413,13 @@ chunk_render(PyObject *self, PyObject *args) {
unsigned char ancilData = getArrayByte3D(state.blockdata_expanded, state.x, state.y, state.z);
state.block_data = ancilData;
/* block that need pseudo ancildata:
* grass, water, glass, chest, restone wire,
* ice, fence and portal. */
if ((state.block == 2) || (state.block == 9) ||
(state.block == 20) || (state.block == 54) ||
(state.block == 55) || (state.block == 85) ||
(state.block == 90)) {
(state.block == 55) || (state.block == 79) ||
(state.block == 85) || (state.block == 90)) {
ancilData = generate_pseudo_data(&state, ancilData);
state.block_pdata = ancilData;
} else {

View File

@@ -293,7 +293,7 @@ rendermode_lighting_draw(void *data, RenderState *state, PyObject *src, PyObject
self = (RenderModeLighting *)data;
x = state->x, y = state->y, z = state->z;
if (state->block == 9) { /* special case for water */
if ((state->block == 9) || (state->block == 79)) { /* special case for water and ice */
/* looks like we need a new case for lighting, there are
* blocks that are transparent and need per-face shading
* if the face is drawn. */