From a2bb74096d0d1647dd8a53b807b29839f0496cb4 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 19 Apr 2022 15:43:39 +0000 Subject: [PATCH] IVertexBuffer and IIndexBuffer reallocate functions now pass through canShrink parameter to array git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6341 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/CIndexBuffer.h | 10 +++++----- include/CVertexBuffer.h | 10 +++++----- include/IIndexBuffer.h | 2 +- include/IVertexBuffer.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/CIndexBuffer.h b/include/CIndexBuffer.h index e904a9d8..3f3381b6 100644 --- a/include/CIndexBuffer.h +++ b/include/CIndexBuffer.h @@ -27,7 +27,7 @@ namespace scene virtual u32 getLast() =0; virtual void setValue(u32 index, u32 value) =0; virtual void set_used(u32 usedNow) =0; - virtual void reallocate(u32 new_size) =0; + virtual void reallocate(u32 new_size, bool canShrink=true) =0; virtual u32 allocated_size() const =0; virtual void* pointer() =0; virtual video::E_INDEX_TYPE getType() const =0; @@ -66,9 +66,9 @@ namespace scene Indices.set_used(usedNow); } - virtual void reallocate(u32 new_size) IRR_OVERRIDE + virtual void reallocate(u32 new_size, bool canShrink) IRR_OVERRIDE { - Indices.reallocate(new_size); + Indices.reallocate(new_size, canShrink); } virtual u32 allocated_size() const IRR_OVERRIDE @@ -180,9 +180,9 @@ namespace scene Indices->set_used(usedNow); } - virtual void reallocate(u32 new_size) IRR_OVERRIDE + virtual void reallocate(u32 new_size, bool canShrink=true) IRR_OVERRIDE { - Indices->reallocate(new_size); + Indices->reallocate(new_size, canShrink); } virtual u32 allocated_size() const IRR_OVERRIDE diff --git a/include/CVertexBuffer.h b/include/CVertexBuffer.h index 07674719..f48b07bd 100644 --- a/include/CVertexBuffer.h +++ b/include/CVertexBuffer.h @@ -28,7 +28,7 @@ namespace scene virtual video::S3DVertex& operator [](const u32 index) const =0; virtual video::S3DVertex& getLast() =0; virtual void set_used(u32 usedNow) =0; - virtual void reallocate(u32 new_size) =0; + virtual void reallocate(u32 new_size, bool canShrink=true) =0; virtual u32 allocated_size() const =0; virtual video::S3DVertex* pointer() =0; virtual video::E_VERTEX_TYPE getType() const =0; @@ -56,8 +56,8 @@ namespace scene virtual void set_used(u32 usedNow) IRR_OVERRIDE {Vertices.set_used(usedNow);} - virtual void reallocate(u32 new_size) IRR_OVERRIDE - {Vertices.reallocate(new_size);} + virtual void reallocate(u32 new_size, bool canShrink) IRR_OVERRIDE + {Vertices.reallocate(new_size, canShrink);} virtual u32 allocated_size() const IRR_OVERRIDE { @@ -164,9 +164,9 @@ namespace scene Vertices->set_used(usedNow); } - virtual void reallocate(u32 new_size) IRR_OVERRIDE + virtual void reallocate(u32 new_size, bool canShrink=true) IRR_OVERRIDE { - Vertices->reallocate(new_size); + Vertices->reallocate(new_size, canShrink); } virtual u32 allocated_size() const IRR_OVERRIDE diff --git a/include/IIndexBuffer.h b/include/IIndexBuffer.h index d1bb961a..b6fb8a12 100644 --- a/include/IIndexBuffer.h +++ b/include/IIndexBuffer.h @@ -33,7 +33,7 @@ namespace scene virtual u32 getLast() =0; virtual void setValue(u32 index, u32 value) =0; virtual void set_used(u32 usedNow) =0; - virtual void reallocate(u32 new_size) =0; + virtual void reallocate(u32 new_size, bool canShrink=true) =0; virtual u32 allocated_size() const=0; virtual void* pointer() =0; diff --git a/include/IVertexBuffer.h b/include/IVertexBuffer.h index 1a8c6fb8..89767df8 100644 --- a/include/IVertexBuffer.h +++ b/include/IVertexBuffer.h @@ -35,7 +35,7 @@ namespace scene virtual video::S3DVertex& operator [](const u32 index) const =0; virtual video::S3DVertex& getLast() =0; virtual void set_used(u32 usedNow) =0; - virtual void reallocate(u32 new_size) =0; + virtual void reallocate(u32 new_size, bool canShrink=true) =0; virtual u32 allocated_size() const =0; //! Same as getData() - not sure why we got 2, should probably deprecate (and we don't always have video::S3DVertex*, so just confusing)