0

the rest of the render modes are now working

This commit is contained in:
Aaron Griffith
2012-01-06 20:38:50 -05:00
parent 4eaf103213
commit 1f2c1a281e
5 changed files with 21 additions and 20 deletions

View File

@@ -237,22 +237,22 @@ rendermode_cave_start(void *data, RenderState *state, PyObject *options) {
}
/* if there's skylight we are in the surface! */
self->skylight = PyObject_GetAttrString(state->self, "skylight");
self->left_skylight = PyObject_GetAttrString(state->self, "left_skylight");
self->right_skylight = PyObject_GetAttrString(state->self, "right_skylight");
self->up_left_skylight = PyObject_GetAttrString(state->self, "up_left_skylight");
self->up_right_skylight = PyObject_GetAttrString(state->self, "up_right_skylight");
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);
if (self->only_lit) {
self->blocklight = PyObject_GetAttrString(state->self, "blocklight");
self->left_blocklight = PyObject_GetAttrString(state->self, "left_blocklight");
self->right_blocklight = PyObject_GetAttrString(state->self, "right_blocklight");
self->up_left_blocklight = PyObject_GetAttrString(state->self, "up_left_blocklight");
self->up_right_blocklight = PyObject_GetAttrString(state->self, "up_right_blocklight");
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);
}
/* colors for tinting */
self->depth_colors = PyObject_GetAttrString(state->chunk, "depth_colors");
self->depth_colors = PyObject_GetAttrString(state->support, "depth_colors");
return 0;
}

View File

@@ -30,13 +30,13 @@ rendermode_overlay_start(void *data, RenderState *state, PyObject *options) {
PyObject *facemasks_py;
RenderModeOverlay *self = (RenderModeOverlay *)data;
facemasks_py = PyObject_GetAttrString(state->chunk, "facemasks");
facemasks_py = PyObject_GetAttrString(state->support, "facemasks");
/* borrowed reference, needs to be incref'd if we keep it */
self->facemask_top = PyTuple_GetItem(facemasks_py, 0);
Py_INCREF(self->facemask_top);
Py_DECREF(facemasks_py);
self->white_color = PyObject_GetAttrString(state->chunk, "white_color");
self->white_color = PyObject_GetAttrString(state->support, "white_color");
self->get_color = get_color;
return 0;

View File

@@ -69,8 +69,8 @@ rendermode_spawn_start(void *data, RenderState *state, PyObject *options) {
/* now do custom initializations */
self = (RenderModeSpawn *)data;
self->blocklight = PyObject_GetAttrString(state->self, "blocklight");
self->skylight = PyObject_GetAttrString(state->self, "skylight");
self->blocklight = get_chunk_data(state, CURRENT, BLOCKLIGHT);
self->skylight = get_chunk_data(state, CURRENT, SKYLIGHT);
/* setup custom color */
self->parent.get_color = get_color;

View File

@@ -25,10 +25,11 @@
static RenderModeInterface *render_modes[] = {
&rendermode_normal,
&rendermode_lighting,
/*&rendermode_smooth_lighting,
&rendermode_spawn,
&rendermode_smooth_lighting,
&rendermode_cave,
&rendermode_mineral,*/
&rendermode_spawn,
&rendermode_mineral,
NULL
};