more C code fixes. Activated caching.
Also removed some code that I accidentially left in. Also added a traceback printing decorator around get_chunk() because the C code can potentially swallow those exceptions.
This commit is contained in:
@@ -214,21 +214,19 @@ cave_start(void *data, RenderState *state, PyObject *support) {
|
||||
return 1;
|
||||
|
||||
/* if there's skylight we are in the surface! */
|
||||
self->skylight = get_chunk_data(state, CURRENT, SKYLIGHT);
|
||||
self->left_skylight = get_chunk_data(state, DOWN_LEFT, SKYLIGHT);
|
||||
self->right_skylight = get_chunk_data(state, DOWN_RIGHT, SKYLIGHT);
|
||||
self->up_left_skylight = get_chunk_data(state, UP_LEFT, SKYLIGHT);
|
||||
self->up_right_skylight = get_chunk_data(state, UP_RIGHT, SKYLIGHT);
|
||||
self->skylight = get_chunk_data(state, CURRENT, SKYLIGHT, 1);
|
||||
self->left_skylight = get_chunk_data(state, DOWN_LEFT, SKYLIGHT, 1);
|
||||
self->right_skylight = get_chunk_data(state, DOWN_RIGHT, SKYLIGHT, 1);
|
||||
self->up_left_skylight = get_chunk_data(state, UP_LEFT, SKYLIGHT, 1);
|
||||
self->up_right_skylight = get_chunk_data(state, UP_RIGHT, SKYLIGHT, 1);
|
||||
|
||||
if (self->only_lit) {
|
||||
self->blocklight = get_chunk_data(state, CURRENT, BLOCKLIGHT);
|
||||
self->left_blocklight = get_chunk_data(state, DOWN_LEFT, BLOCKLIGHT);
|
||||
self->right_blocklight = get_chunk_data(state, DOWN_RIGHT, BLOCKLIGHT);
|
||||
self->up_left_blocklight = get_chunk_data(state, UP_LEFT, BLOCKLIGHT);
|
||||
self->up_right_blocklight = get_chunk_data(state, UP_RIGHT, BLOCKLIGHT);
|
||||
self->blocklight = get_chunk_data(state, CURRENT, BLOCKLIGHT, 1);
|
||||
self->left_blocklight = get_chunk_data(state, DOWN_LEFT, BLOCKLIGHT, 1);
|
||||
self->right_blocklight = get_chunk_data(state, DOWN_RIGHT, BLOCKLIGHT, 1);
|
||||
self->up_left_blocklight = get_chunk_data(state, UP_LEFT, BLOCKLIGHT, 1);
|
||||
self->up_right_blocklight = get_chunk_data(state, UP_RIGHT, BLOCKLIGHT, 1);
|
||||
}
|
||||
// Non-existant neighboring blocks is not an error
|
||||
PyErr_Clear();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user