renamed is_transparent (more like other function names), and exposed it to other C files
This commit is contained in:
@@ -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);
|
PyObject *block = PyInt_FromLong(b);
|
||||||
int ret = PySequence_Contains(tup, block);
|
int ret = PySequence_Contains(tup, block);
|
||||||
Py_DECREF(block);
|
Py_DECREF(block);
|
||||||
@@ -199,9 +200,9 @@ chunk_render(PyObject *self, PyObject *args) {
|
|||||||
|
|
||||||
|
|
||||||
if ( (x != 0) && (y != 15) && (z != 127) &&
|
if ( (x != 0) && (y != 15) && (z != 127) &&
|
||||||
!isTransparent(transparent_blocks, getArrayByte3D(blocks_py, x-1, y, z)) &&
|
!is_transparent(transparent_blocks, getArrayByte3D(blocks_py, x-1, y, z)) &&
|
||||||
!isTransparent(transparent_blocks, getArrayByte3D(blocks_py, x, y, z+1)) &&
|
!is_transparent(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, y+1, z))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ PyObject *alpha_over_wrap(PyObject *self, PyObject *args);
|
|||||||
PyObject *brightness(PyObject *img, double factor);
|
PyObject *brightness(PyObject *img, double factor);
|
||||||
|
|
||||||
/* in iterate.c */
|
/* in iterate.c */
|
||||||
|
int is_transparent(PyObject* tup, unsigned char b);
|
||||||
PyObject *chunk_render(PyObject *self, PyObject *args);
|
PyObject *chunk_render(PyObject *self, PyObject *args);
|
||||||
int init_chunk_render(void);
|
int init_chunk_render(void);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user