From cd34d6052bb9dc01dc2be23dda1a7561bcef8dac Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Mon, 21 Mar 2011 06:18:51 -0400 Subject: [PATCH] renamed is_transparent (more like other function names), and exposed it to other C files --- src/iterate.c | 9 +++++---- src/overviewer.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/iterate.c b/src/iterate.c index 34bd1ed..fef0053 100644 --- a/src/iterate.c +++ b/src/iterate.c @@ -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; } diff --git a/src/overviewer.h b/src/overviewer.h index 1321481..8e148ca 100644 --- a/src/overviewer.h +++ b/src/overviewer.h @@ -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);