From 49616fd43825d8db220d0433f13e61c82c46fb68 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 19 Apr 2022 12:18:15 +0000 Subject: [PATCH] CIndexBuffer no longer re-allocates stuff when type doesn't change git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6338 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/CIndexBuffer.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/CIndexBuffer.h b/include/CIndexBuffer.h index 152fb040..e904a9d8 100644 --- a/include/CIndexBuffer.h +++ b/include/CIndexBuffer.h @@ -110,11 +110,14 @@ namespace scene } //virtual void setType(video::E_INDEX_TYPE IndexType); - virtual void setType(video::E_INDEX_TYPE IndexType) IRR_OVERRIDE + virtual void setType(video::E_INDEX_TYPE indexType) IRR_OVERRIDE { + if ( Indices && Indices->getType() == indexType ) + return; + IIndexList *NewIndices=0; - switch (IndexType) + switch (indexType) { case video::EIT_16BIT: {