0

Merge remote branch 'brownan/master' into rendermode-options

This commit is contained in:
Aaron Griffith
2011-08-26 21:06:14 -04:00
18 changed files with 463 additions and 17 deletions

View File

@@ -194,7 +194,7 @@ alpha_over_full(PyObject *dest, PyObject *src, PyObject *mask, float overall_alp
}
/* special cases */
if (in_alpha == 255 || *outmask == 0) {
if (in_alpha == 255 || (*outmask == 0 && in_alpha > 0)) {
*outmask = in_alpha;
*out = *in;

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 8
#define OVERVIEWER_EXTENSION_VERSION 10
/* Python PIL, and numpy headers */
#include <Python.h>

View File

@@ -178,9 +178,14 @@ get_lighting_coefficient(RenderModeLighting *self, RenderState *state,
/* stairs and half-blocks take the skylevel from the upper block if it's transparent */
if (local_z != 127) {
upper_block = getArrayByte3D(blocks, local_x, local_y, local_z + 1);
int upper_counter = 0;
/* but if the upper_block is one of these special half-steps, we need to look at *its* upper_block */
do {
upper_counter++;
upper_block = getArrayByte3D(blocks, local_x, local_y, local_z + upper_counter);
} while ((upper_block == 44 || upper_block == 54 || upper_block == 67) && local_z < 127);
if (is_transparent(upper_block)) {
skylevel = getArrayByte3D(skylight, local_x, local_y, local_z + 1);
skylevel = getArrayByte3D(skylight, local_x, local_y, local_z + upper_counter);
}
} else {
upper_block = 0;
@@ -188,7 +193,7 @@ get_lighting_coefficient(RenderModeLighting *self, RenderState *state,
}
/* the block has a bad blocklevel, estimate it from neigborhood
/* use given coordinates, no local ones! */
* use given coordinates, no local ones! */
blocklevel = estimate_blocklevel(self, state, x, y, z, NULL);
}