From 1f2c1a281efcc24ab07f1b005be7367c03915aa8 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Fri, 6 Jan 2012 20:38:50 -0500 Subject: [PATCH] the rest of the render modes are now working --- overviewer_core/src/rendermode-cave.c | 22 +++++++++++----------- overviewer_core/src/rendermode-overlay.c | 4 ++-- overviewer_core/src/rendermode-spawn.c | 4 ++-- overviewer_core/src/rendermodes.c | 7 ++++--- setup.py | 4 ++-- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/overviewer_core/src/rendermode-cave.c b/overviewer_core/src/rendermode-cave.c index 5e3336c..9807ed2 100644 --- a/overviewer_core/src/rendermode-cave.c +++ b/overviewer_core/src/rendermode-cave.c @@ -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; } diff --git a/overviewer_core/src/rendermode-overlay.c b/overviewer_core/src/rendermode-overlay.c index 47c44fc..9ae4e25 100644 --- a/overviewer_core/src/rendermode-overlay.c +++ b/overviewer_core/src/rendermode-overlay.c @@ -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; diff --git a/overviewer_core/src/rendermode-spawn.c b/overviewer_core/src/rendermode-spawn.c index 275f33c..6f57085 100644 --- a/overviewer_core/src/rendermode-spawn.c +++ b/overviewer_core/src/rendermode-spawn.c @@ -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; diff --git a/overviewer_core/src/rendermodes.c b/overviewer_core/src/rendermodes.c index b22a6bf..545aad2 100644 --- a/overviewer_core/src/rendermodes.c +++ b/overviewer_core/src/rendermodes.c @@ -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 }; diff --git a/setup.py b/setup.py index d9ed66e..db2c3d9 100755 --- a/setup.py +++ b/setup.py @@ -149,8 +149,8 @@ except Exception: # used to figure out what files to compile -#render_modes = ['normal', 'overlay', 'lighting', 'smooth-lighting', 'spawn', 'cave', 'mineral'] -render_modes = ['normal', 'lighting'] +render_modes = ['normal', 'lighting', 'smooth-lighting', 'cave'] +render_modes += ['overlay', 'spawn', 'mineral'] c_overviewer_files = ['main.c', 'composite.c', 'iterate.c', 'endian.c', 'rendermodes.c'] c_overviewer_files += map(lambda mode: 'rendermode-%s.c' % (mode,), render_modes)