mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Irrlicht cleanups (mostly getting rid of core::array
)
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This commit is contained in:
parent
5acc2736db
commit
5d226268df
45 changed files with 308 additions and 1227 deletions
|
@ -273,12 +273,12 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
|
|||
}
|
||||
if (mesh->TCoords2.size()) {
|
||||
for (i = 0; i != mesh->Buffers.size(); ++i) {
|
||||
mesh->Buffers[i]->Vertices_2TCoords.reallocate(vCountArray[i]);
|
||||
mesh->Buffers[i]->Vertices_2TCoords.reserve(vCountArray[i]);
|
||||
mesh->Buffers[i]->VertexType = video::EVT_2TCOORDS;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i != mesh->Buffers.size(); ++i)
|
||||
mesh->Buffers[i]->Vertices_Standard.reallocate(vCountArray[i]);
|
||||
mesh->Buffers[i]->Vertices_Standard.reserve(vCountArray[i]);
|
||||
}
|
||||
|
||||
verticesLinkIndex.set_used(mesh->Vertices.size());
|
||||
|
@ -291,10 +291,10 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
|
|||
|
||||
if (mesh->TCoords2.size()) {
|
||||
verticesLinkIndex[i] = buffer->Vertices_2TCoords.size();
|
||||
buffer->Vertices_2TCoords.push_back(mesh->Vertices[i]);
|
||||
buffer->Vertices_2TCoords.emplace_back(mesh->Vertices[i]);
|
||||
// We have a problem with correct tcoord2 handling here
|
||||
// crash fixed for now by checking the values
|
||||
buffer->Vertices_2TCoords.getLast().TCoords2 = (i < mesh->TCoords2.size()) ? mesh->TCoords2[i] : mesh->Vertices[i].TCoords;
|
||||
buffer->Vertices_2TCoords.back().TCoords2 = (i < mesh->TCoords2.size()) ? mesh->TCoords2[i] : mesh->Vertices[i].TCoords;
|
||||
} else {
|
||||
verticesLinkIndex[i] = buffer->Vertices_Standard.size();
|
||||
buffer->Vertices_Standard.push_back(mesh->Vertices[i]);
|
||||
|
@ -306,7 +306,7 @@ bool CXMeshFileLoader::load(io::IReadFile *file)
|
|||
for (i = 0; i < mesh->FaceMaterialIndices.size(); ++i)
|
||||
++vCountArray[mesh->FaceMaterialIndices[i]];
|
||||
for (i = 0; i != mesh->Buffers.size(); ++i)
|
||||
mesh->Buffers[i]->Indices.reallocate(vCountArray[i]);
|
||||
mesh->Buffers[i]->Indices.reserve(vCountArray[i]);
|
||||
delete[] vCountArray;
|
||||
// create indices per buffer
|
||||
for (i = 0; i < mesh->FaceMaterialIndices.size(); ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue