forked from Mirrorlandia_minetest/irrlicht
Don't let MeshBuffer append functions shrink memory as this prevents optimizations
Couldn't allocate enough memory before appending several buffers for all of them as first append shrunk the memory again. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6495 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
428fcca7fb
commit
7c92944860
@ -128,7 +128,7 @@ namespace scene
|
||||
|
||||
const u32 vertexCount = getVertexCount();
|
||||
|
||||
VertexBuffer->reallocate(vertexCount+numVertices);
|
||||
VertexBuffer->reallocate(vertexCount+numVertices, false);
|
||||
switch ( vertexType )
|
||||
{
|
||||
case video::EVT_STANDARD:
|
||||
@ -154,7 +154,7 @@ namespace scene
|
||||
break;
|
||||
}
|
||||
|
||||
IndexBuffer->reallocate(getIndexCount()+numIndices);
|
||||
IndexBuffer->reallocate(getIndexCount()+numIndices, false);
|
||||
switch ( indexType )
|
||||
{
|
||||
case video::EIT_16BIT:
|
||||
|
@ -201,14 +201,14 @@ namespace scene
|
||||
const u32 vertexCount = getVertexCount();
|
||||
u32 i;
|
||||
|
||||
Vertices.reallocate(vertexCount+numVertices);
|
||||
Vertices.reallocate(vertexCount+numVertices, false);
|
||||
for (i=0; i<numVertices; ++i)
|
||||
{
|
||||
Vertices.push_back(static_cast<const T*>(vertices)[i]);
|
||||
BoundingBox.addInternalPoint(static_cast<const T*>(vertices)[i].Pos);
|
||||
}
|
||||
|
||||
Indices.reallocate(getIndexCount()+numIndices);
|
||||
Indices.reallocate(getIndexCount()+numIndices, false);
|
||||
for (i=0; i<numIndices; ++i)
|
||||
{
|
||||
Indices.push_back(indices[i]+vertexCount);
|
||||
|
Loading…
Reference in New Issue
Block a user