0

fixed uninitialized texture pointer, and bumped extension version

This commit is contained in:
Aaron Griffith
2011-05-31 20:05:45 -04:00
parent 9d4b48b5ae
commit 8565919c89
3 changed files with 5 additions and 2 deletions

View File

@@ -26,7 +26,7 @@
// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 6
#define OVERVIEWER_EXTENSION_VERSION 7
/* Python PIL, and numpy headers */
#include <Python.h>

View File

@@ -66,6 +66,7 @@ rendermode_normal_start(void *data, RenderState *state) {
self->leaf_texture = PyObject_GetAttrString(state->textures, "biome_leaf_texture");
self->grass_texture = PyObject_GetAttrString(state->textures, "biome_grass_texture");
self->tall_grass_texture = PyObject_GetAttrString(state->textures, "biome_tall_grass_texture");
self->tall_fern_texture = PyObject_GetAttrString(state->textures, "biome_tall_fern_texture");
facemasks_py = PyObject_GetAttrString(state->chunk, "facemasks");
/* borrowed reference, needs to be incref'd if we keep it */
@@ -81,6 +82,7 @@ rendermode_normal_start(void *data, RenderState *state) {
self->leaf_texture = NULL;
self->grass_texture = NULL;
self->tall_grass_texture = NULL;
self->tall_fern_texture = NULL;
self->facemask_top = NULL;
}
@@ -102,6 +104,7 @@ rendermode_normal_finish(void *data, RenderState *state) {
Py_XDECREF(self->leaf_texture);
Py_XDECREF(self->grass_texture);
Py_XDECREF(self->tall_grass_texture);
Py_XDECREF(self->tall_fern_texture);
Py_XDECREF(self->facemask_top);
}

View File

@@ -1678,7 +1678,7 @@ def generate(path=None):
load_water()
# generate biome (still grayscale) leaf, grass textures
global biome_grass_texture, biome_leaf_texture, biome_tall_grass_texture
global biome_grass_texture, biome_leaf_texture, biome_tall_grass_texture, biome_tall_fern_texture
biome_grass_texture = _build_block(terrain_images[0], terrain_images[38], 2)
biome_leaf_texture = _build_block(terrain_images[52], terrain_images[52], 18)
biome_tall_grass_texture = _build_block(terrain_images[39], terrain_images[39], 31)