summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lltextureentry.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-10-26 16:08:28 -0500
committerDave Parks <davep@lindenlab.com>2022-10-26 16:08:28 -0500
commit8f47657d646c06dbba8d44497c0f81fd00730cc8 (patch)
treeeec5702e7dc4d83a8bf00c0c7a87272870fcec42 /indra/llprimitive/lltextureentry.cpp
parented1e5214cefc5f0aeb630bf2fbcda9dff9ed8d61 (diff)
SL-18443 Allow nulling out of override data and implement new override message protocol.
Diffstat (limited to 'indra/llprimitive/lltextureentry.cpp')
-rw-r--r--indra/llprimitive/lltextureentry.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index d810c6ed25..7640dd70bd 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -512,13 +512,25 @@ S32 LLTextureEntry::setBumpShiny(U8 bump_shiny)
void LLTextureEntry::setGLTFMaterial(LLGLTFMaterial* material)
{
- mGLTFMaterial = material;
+ // assert on precondtion:
+ // whether or not mGLTFMaterial is null, any existing override should have been nulled out
+ // before calling setGLTFMaterial
+ // NOTE: if you're hitting this assert, try to make sure calling code is using LLViewerObject::setRenderMaterialID
+ llassert(getGLTFMaterialOverride() == nullptr);
+
+ mGLTFMaterial = material;
if (mGLTFMaterial == nullptr)
{
setGLTFRenderMaterial(nullptr);
}
}
+void LLTextureEntry::setGLTFMaterialOverride(LLGLTFMaterial* mat)
+{
+ llassert(mat == nullptr || getGLTFMaterial() != nullptr); // if override is not null, base material must not be null
+ mGLTFMaterialOverrides = mat;
+}
+
LLGLTFMaterial* LLTextureEntry::getGLTFRenderMaterial() const
{
if (mGLTFRenderMaterial.notNull())