From 8a9e82fed928cc60d0704af530d35097a65f4c0f Mon Sep 17 00:00:00 2001 From: cutealien Date: Fri, 22 Apr 2022 14:22:41 +0000 Subject: [PATCH] Bit cleanup of IDynamicMeshBuffer. No point in repeating pure virtual functions (maybe wasn't meant to be derived from IMeshBuffer at first?) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6356 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/CDynamicMeshBuffer.h | 20 ++++++++++++++++ include/IDynamicMeshBuffer.h | 44 ++++-------------------------------- include/IMeshBuffer.h | 6 +++-- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/include/CDynamicMeshBuffer.h b/include/CDynamicMeshBuffer.h index 2eed836a..4a707285 100644 --- a/include/CDynamicMeshBuffer.h +++ b/include/CDynamicMeshBuffer.h @@ -102,6 +102,26 @@ namespace scene } } + //! Append the vertices and indices to the current buffer + /** Only works for compatible vertex types. + \param vertices Pointer to a vertex array. + \param numVertices Number of vertices in the array. + \param indices Pointer to index array. + \param numIndices Number of indices in array. */ + virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) IRR_OVERRIDE + { + // TODO + } + + //! Append the meshbuffer to the current buffer + /** Only works for compatible vertex types + \param other Buffer to append to this one. */ + virtual void append(const IMeshBuffer* const other) IRR_OVERRIDE + { + // TODO + } + + //! Describe what kind of primitive geometry is used by the meshbuffer virtual void setPrimitiveType(E_PRIMITIVE_TYPE type) IRR_OVERRIDE { diff --git a/include/IDynamicMeshBuffer.h b/include/IDynamicMeshBuffer.h index 00ebbaaf..3aed1265 100644 --- a/include/IDynamicMeshBuffer.h +++ b/include/IDynamicMeshBuffer.h @@ -24,46 +24,13 @@ namespace scene virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0; virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0; - //! Get the material of this meshbuffer - /** \return Material of this buffer. */ - virtual video::SMaterial& getMaterial() IRR_OVERRIDE =0; - //! Get the material of this meshbuffer - /** \return Material of this buffer. */ - virtual const video::SMaterial& getMaterial() const IRR_OVERRIDE =0; + // ------------------- Old interface ------------------- // + // That stuff could also be in CDynamicMeshBuffer + // I suppose it was put here to show that the information + // is now basically handled by the vertex/index buffers instead + // of the meshbuffer itself. - //! Get the axis aligned bounding box of this meshbuffer. - /** \return Axis aligned bounding box of this buffer. */ - virtual const core::aabbox3df& getBoundingBox() const IRR_OVERRIDE =0; - - //! Set axis aligned bounding box - /** \param box User defined axis aligned bounding box to use - for this buffer. */ - virtual void setBoundingBox(const core::aabbox3df& box) IRR_OVERRIDE =0; - - //! Recalculates the bounding box. Should be called if the mesh changed. - virtual void recalculateBoundingBox() IRR_OVERRIDE =0; - - //! Append the vertices and indices to the current buffer - /** Only works for compatible vertex types. - \param vertices Pointer to a vertex array. - \param numVertices Number of vertices in the array. - \param indices Pointer to index array. - \param numIndices Number of indices in array. */ - virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) IRR_OVERRIDE - { - - } - - //! Append the meshbuffer to the current buffer - /** Only works for compatible vertex types - \param other Buffer to append to this one. */ - virtual void append(const IMeshBuffer* const other) IRR_OVERRIDE - { - - } - - // ------------------- To be removed? ------------------- // //! get the current hardware mapping hint virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const IRR_OVERRIDE @@ -105,7 +72,6 @@ namespace scene return getIndexBuffer().getChangedID(); } - // ------------------- Old interface ------------------- // //! Get type of vertex data which is stored in this meshbuffer. /** \return Vertex type of this buffer. */ diff --git a/include/IMeshBuffer.h b/include/IMeshBuffer.h index 6ecbb766..77ce995d 100644 --- a/include/IMeshBuffer.h +++ b/include/IMeshBuffer.h @@ -120,14 +120,16 @@ namespace scene virtual core::vector2df& getTCoords(u32 i) = 0; //! Append the vertices and indices to the current buffer - /** Only works for compatible vertex types. + /** Only works for compatible vertex types + and not implemented for most buffers for now. \param vertices Pointer to a vertex array. \param numVertices Number of vertices in the array. \param indices Pointer to index array. \param numIndices Number of indices in array. */ virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0; - //! Append the meshbuffer to the current buffer + //! Not supported right now by any meshbuffer + //! In theory: Append the meshbuffer to the current buffer /** Only works for compatible vertex types \param other Buffer to append to this one. */ virtual void append(const IMeshBuffer* const other) = 0;