1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Split CIndexBuffer from CMeshBuffer

This commit is contained in:
sfan5 2024-08-27 17:40:29 +02:00
parent 5d6e15bc49
commit 47e4c33a50
13 changed files with 197 additions and 104 deletions

View file

@ -135,7 +135,7 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const
auto *vt = static_cast<const video::S3DVertex*>(mb->getVertices());
buffer->VertexBuffer().insert(buffer->VertexBuffer().end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
buffer->IndexBuffer().insert(buffer->IndexBuffer().end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;
@ -145,7 +145,7 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const
auto *vt = static_cast<const video::S3DVertex2TCoords*>(mb->getVertices());
buffer->VertexBuffer().insert(buffer->VertexBuffer().end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
buffer->IndexBuffer().insert(buffer->IndexBuffer().end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;
@ -155,7 +155,7 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const
auto *vt = static_cast<const video::S3DVertexTangents*>(mb->getVertices());
buffer->VertexBuffer().insert(buffer->VertexBuffer().end(), vt, vt + mb->getVertexCount());
auto *indices = mb->getIndices();
buffer->Indices.insert(buffer->Indices.end(), indices, indices + mb->getIndexCount());
buffer->IndexBuffer().insert(buffer->IndexBuffer().end(), indices, indices + mb->getIndexCount());
clone->addMeshBuffer(buffer);
buffer->drop();
} break;