Avoid rendering empty VBO chunks
authorNick Gasson <nick@nickg.me.uk>
Fri, 30 Dec 2011 19:15:21 +0000 (19:15 +0000)
committerNick Gasson <nick@nickg.me.uk>
Fri, 30 Dec 2011 19:15:21 +0000 (19:15 +0000)
src/Mesh.cpp

index 5e18176f189d8f858abf832d7f6e7ceab5fd4bb3..d588aadc2400742325daa006fac22a518140c467 100644 (file)
@@ -542,6 +542,9 @@ void VBOMesh::render() const
    for (vector<ChunkDelim>::const_iterator it = chunks.begin();
         it != chunks.end(); ++it) {
 
+      if ((*it).count == 0)
+         continue;
+
       if ((*it).texture) {
          glEnable(GL_TEXTURE_2D);
          (*it).texture->bind();