0

renamed is_transparent (more like other function names), and exposed it to other C files

This commit is contained in:
Aaron Griffith
2011-03-21 06:18:51 -04:00
parent 88d5f15131
commit cd34d6052b
2 changed files with 6 additions and 4 deletions

View File

@@ -54,7 +54,8 @@ int init_chunk_render(void) {
}
static inline int isTransparent(PyObject* tup, unsigned char b) {
inline int
is_transparent(PyObject* tup, unsigned char b) {
PyObject *block = PyInt_FromLong(b);
int ret = PySequence_Contains(tup, block);
Py_DECREF(block);
@@ -199,9 +200,9 @@ chunk_render(PyObject *self, PyObject *args) {
if ( (x != 0) && (y != 15) && (z != 127) &&
!isTransparent(transparent_blocks, getArrayByte3D(blocks_py, x-1, y, z)) &&
!isTransparent(transparent_blocks, getArrayByte3D(blocks_py, x, y, z+1)) &&
!isTransparent(transparent_blocks, getArrayByte3D(blocks_py, x, y+1, z))) {
!is_transparent(transparent_blocks, getArrayByte3D(blocks_py, x-1, y, z)) &&
!is_transparent(transparent_blocks, getArrayByte3D(blocks_py, x, y, z+1)) &&
!is_transparent(transparent_blocks, getArrayByte3D(blocks_py, x, y+1, z))) {
continue;
}

View File

@@ -36,6 +36,7 @@ PyObject *alpha_over_wrap(PyObject *self, PyObject *args);
PyObject *brightness(PyObject *img, double factor);
/* in iterate.c */
int is_transparent(PyObject* tup, unsigned char b);
PyObject *chunk_render(PyObject *self, PyObject *args);
int init_chunk_render(void);