int count = counts[i];
if (count > length) {
i = n;
count = length;
} else
<BUG>length -= count;
mesh.render(shader, GL10.GL_TRIANGLES, offset, count);
</BUG>
offset += count;
}

int count = counts[i];
textures[i].bind();
if(customShader != null) mesh.render(customShader, GL10.GL_TRIANGLES, offset, count);
else mesh.render(shader, GL10.GL_TRIANGLES, offset, count);
offset += count;
}
