-/*
- MeshCollector
-*/
-
-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;
- }
-
- if (p == NULL) {
- PreMeshBuffer pp;
- pp.tile = tile;
- prebuffers.push_back(pp);
- p = &prebuffers[prebuffers.size() - 1];
- }
-
- u32 vertex_count;
- if (m_use_tangent_vertices) {
- vertex_count = p->tangent_vertices.size();
- for (u32 i = 0; i < numVertices; i++) {
- video::S3DVertexTangents vert(vertices[i].Pos, vertices[i].Normal,
- vertices[i].Color, vertices[i].TCoords);
- p->tangent_vertices.push_back(vert);
- }
- } else {
- vertex_count = p->vertices.size();
- for (u32 i = 0; i < numVertices; i++) {
- video::S3DVertex vert(vertices[i].Pos, vertices[i].Normal,
- vertices[i].Color, vertices[i].TCoords);
- p->vertices.push_back(vert);
- }
- }
-
- for (u32 i = 0; i < numIndices; i++) {
- u32 j = indices[i] + vertex_count;
- p->indices.push_back(j);
- }
-}
-
-/*
- MeshCollector - for meshnodes and converted drawtypes.
-*/
-
-void MeshCollector::append(const TileSpec &tile,
- const video::S3DVertex *vertices, u32 numVertices,
- const u16 *indices, u32 numIndices,
- v3f pos, video::SColor c)