summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/accessor.cpp
diff options
context:
space:
mode:
authorcosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2024-05-02 10:31:52 -0700
committerGitHub <noreply@github.com>2024-05-02 10:31:52 -0700
commit37972cb76cd0459cd4105bbb09eb8f6cd1aa87f9 (patch)
treebfd85d36db258f46b74aa9989c1615d9bd7faf72 /indra/newview/gltf/accessor.cpp
parent7fc5f7e649c564fa8479a72a45459d0cc427d0f8 (diff)
parente8219cb0509d5aacc75cf862c6b8cad026590958 (diff)
Merge pull request #1371 from secondlife/1357-gltf-asset-prototype
#1357 GLTF Export Prototype
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;