summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/accessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/gltf/accessor.cpp')
-rw-r--r--indra/newview/gltf/accessor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp
index 55d36b7a32..9bfdc2afa6 100644
--- a/indra/newview/gltf/accessor.cpp
+++ b/indra/newview/gltf/accessor.cpp
@@ -30,6 +30,24 @@
using namespace LL::GLTF;
+void Buffer::erase(Asset& asset, S32 offset, S32 length)
+{
+ S32 idx = this - &asset.mBuffers[0];
+
+ mData.erase(mData.begin() + offset, mData.begin() + offset + length);
+
+ for (BufferView& view : asset.mBufferViews)
+ {
+ if (view.mBuffer == idx)
+ {
+ if (view.mByteOffset >= offset)
+ {
+ view.mByteOffset -= length;
+ }
+ }
+ }
+}
+
const Buffer& Buffer::operator=(const tinygltf::Buffer& src)
{
mData = src.data;