Moved the blockid check further up in the for-loop to increase performance while rendering empty chunks.
This commit is contained in:
committed by
Aaron Griffith
parent
5a483ba4cc
commit
027419fa5f
@@ -365,6 +365,12 @@ chunk_render(PyObject *self, PyObject *args) {
|
||||
for (state.z = 0; state.z < 128; state.z++) {
|
||||
state.imgy -= 12;
|
||||
|
||||
/* get blockid */
|
||||
state.block = getArrayByte3D(blocks_py, state.x, state.y, state.z);
|
||||
if (state.block == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* make sure we're rendering inside the image boundaries */
|
||||
if ((state.imgx >= imgsize0 + 24) || (state.imgx <= -24)) {
|
||||
continue;
|
||||
@@ -373,11 +379,6 @@ chunk_render(PyObject *self, PyObject *args) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* get blockid */
|
||||
state.block = getArrayByte3D(blocks_py, state.x, state.y, state.z);
|
||||
if (state.block == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* decref'd on replacement *and* at the end of the z for block */
|
||||
if (blockid) {
|
||||
|
||||
Reference in New Issue
Block a user