Do not stack-allocate SSkinMeshBuffer

This commit is contained in:
Lars Mueller 2024-05-22 15:56:21 +02:00
parent b419d0e445
commit be375cdfb6
4 changed files with 5 additions and 5 deletions

@ -200,7 +200,7 @@ class ISkinnedMesh : public IAnimatedMesh
virtual SSkinMeshBuffer *addMeshBuffer() = 0;
//! Adds a new meshbuffer to the mesh, access it as last one
virtual void addMeshBuffer(SSkinMeshBuffer &&meshbuf) = 0;
virtual void addMeshBuffer(SSkinMeshBuffer *meshbuf) = 0;
//! Adds a new joint to the mesh, access it as last one
virtual SJoint *addJoint(SJoint *parent = 0) = 0;

@ -428,7 +428,7 @@ void SelfType::MeshExtractor::loadMesh(
}
m_irr_model->addMeshBuffer(
SSkinMeshBuffer(std::move(*vertices), std::move(indices)));
new SSkinMeshBuffer(std::move(*vertices), std::move(indices)));
}
}

@ -1062,9 +1062,9 @@ scene::SSkinMeshBuffer *CSkinnedMesh::addMeshBuffer()
return buffer;
}
void CSkinnedMesh::addMeshBuffer(SSkinMeshBuffer &&meshbuf)
void CSkinnedMesh::addMeshBuffer(SSkinMeshBuffer *meshbuf)
{
LocalBuffers.push_back(new SSkinMeshBuffer(std::move(meshbuf)));
LocalBuffers.push_back(meshbuf);
}
CSkinnedMesh::SJoint *CSkinnedMesh::addJoint(SJoint *parent)

@ -130,7 +130,7 @@ class CSkinnedMesh : public ISkinnedMesh
SSkinMeshBuffer *addMeshBuffer() override;
//! Adds a new meshbuffer to the mesh, access it as last one
void addMeshBuffer(SSkinMeshBuffer &&meshbuf) override;
void addMeshBuffer(SSkinMeshBuffer *meshbuf) override;
//! Adds a new joint to the mesh, access it as last one
SJoint *addJoint(SJoint *parent = 0) override;