diff options
author | Kahrl <kahrl@gmx.net> | 2013-04-25 18:32:18 +0200 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-05-06 19:06:18 +0200 |
commit | 9a559eb8cf5c9178f89b9c3883f7d4ebec187eb9 (patch) | |
tree | 27c555410b8dbdc04f084b808d08ef461461f64c | |
parent | 58f036ad1d5f1928d3696730ece463ab1acb046e (diff) | |
download | minetest-9a559eb8cf5c9178f89b9c3883f7d4ebec187eb9.tar.gz minetest-9a559eb8cf5c9178f89b9c3883f7d4ebec187eb9.tar.bz2 minetest-9a559eb8cf5c9178f89b9c3883f7d4ebec187eb9.zip |
Remove 'Meshbuffer ran out of indices' limitation
-rw-r--r-- | src/mapblock_mesh.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index f8a0b5f06..0f83e863c 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -1338,12 +1338,20 @@ void MeshCollector::append(const TileSpec &tile, const video::S3DVertex *vertices, u32 numVertices, const u16 *indices, u32 numIndices) { + if(numIndices > 65535) + { + dstream<<"FIXME: MeshCollector::append() called with numIndices="<<numIndices<<" (limit 65535)"<<std::endl; + return; + } + PreMeshBuffer *p = NULL; for(u32 i=0; i<prebuffers.size(); i++) { PreMeshBuffer &pp = prebuffers[i]; if(pp.tile != tile) continue; + if(pp.indices.size() + numIndices > 65535) + continue; p = &pp; break; @@ -1361,11 +1369,6 @@ void MeshCollector::append(const TileSpec &tile, for(u32 i=0; i<numIndices; i++) { u32 j = indices[i] + vertex_count; - if(j > 65535) - { - dstream<<"FIXME: Meshbuffer ran out of indices"<<std::endl; - // NOTE: Fix is to just add an another MeshBuffer - } p->indices.push_back(j); } for(u32 i=0; i<numVertices; i++) |