From 7c9294486004d258b5c99f8598dd76397c617285 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 16 May 2023 16:33:30 +0000 Subject: [PATCH] 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 --- include/CDynamicMeshBuffer.h | 4 ++-- include/CMeshBuffer.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/CDynamicMeshBuffer.h b/include/CDynamicMeshBuffer.h index 7defeb1c..73f8b425 100644 --- a/include/CDynamicMeshBuffer.h +++ b/include/CDynamicMeshBuffer.h @@ -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: diff --git a/include/CMeshBuffer.h b/include/CMeshBuffer.h index 531fcf0e..90893761 100644 --- a/include/CMeshBuffer.h +++ b/include/CMeshBuffer.h @@ -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(vertices)[i]); BoundingBox.addInternalPoint(static_cast(vertices)[i].Pos); } - Indices.reallocate(getIndexCount()+numIndices); + Indices.reallocate(getIndexCount()+numIndices, false); for (i=0; i