aboutsummaryrefslogtreecommitdiff
path: root/src/client/mapblock_mesh.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-22 12:05:27 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-22 12:05:27 +0200
commit3ff3103e98b350712543f926c429ab339700e252 (patch)
tree61827d6b7dcb51c38f17f068c8b498c16a0db1c3 /src/client/mapblock_mesh.h
parent350b6d175c406fbbc002237f37db4cf88d6d3d19 (diff)
parent9f338f5a56e5adee3d11d59827f7e2b8a714e6c2 (diff)
downloaddragonfireclient-3ff3103e98b350712543f926c429ab339700e252.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/client/mapblock_mesh.h')
-rw-r--r--src/client/mapblock_mesh.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/client/mapblock_mesh.h b/src/client/mapblock_mesh.h
index 5e2d70b75..8133627b1 100644
--- a/src/client/mapblock_mesh.h
+++ b/src/client/mapblock_mesh.h
@@ -140,20 +140,31 @@ private:
s32 root = -1; // index of the root node
};
+/*
+ * PartialMeshBuffer
+ *
+ * Attach alternate `Indices` to an existing mesh buffer, to make it possible to use different
+ * indices with the same vertex buffer.
+ *
+ * Irrlicht does not currently support this: `CMeshBuffer` ties together a single vertex buffer
+ * and a single index buffer. There's no way to share these between mesh buffers.
+ *
+ */
class PartialMeshBuffer
{
public:
- PartialMeshBuffer(scene::SMeshBuffer *buffer, const std::vector<u16> &vertex_indexes) :
- m_buffer(buffer), m_vertex_indexes(vertex_indexes)
+ PartialMeshBuffer(scene::SMeshBuffer *buffer, std::vector<u16> &&vertex_indexes) :
+ m_buffer(buffer), m_vertex_indexes(std::move(vertex_indexes))
{}
scene::IMeshBuffer *getBuffer() const { return m_buffer; }
const std::vector<u16> &getVertexIndexes() const { return m_vertex_indexes; }
void beforeDraw() const;
+ void afterDraw() const;
private:
scene::SMeshBuffer *m_buffer;
- std::vector<u16> m_vertex_indexes;
+ mutable std::vector<u16> m_vertex_indexes;
};
/*