summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-03-23 16:51:30 -0700
committerBrad Linden <brad@lindenlab.com>2023-03-23 16:54:13 -0700
commitcf3a0c77f1855aa1a33ff39f86e846e7fb9031d1 (patch)
tree2056e852b3a8923c285f8e6d2ee15e74a1071fca /indra/newview/llviewerobject.cpp
parentb72c66ae688c5b5c90ea7675fc65aeefbf6b87fc (diff)
Fix for SL-18458 overrides not applying when cache load happened before LLViewerObject::updateTEMaterialTextures call
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index cc7e716bb5..1c53bddb62 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4963,12 +4963,16 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)
mat = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mat_id);
if (mat->isFetching())
{ // material is not loaded yet, rebuild draw info when the object finishes loading
- LLUUID id = getID();
- mat->onMaterialComplete([=]
+ mat->onMaterialComplete([id=getID()]
{
LLViewerObject* obj = gObjectList.findObject(id);
if (obj)
{
+ LLViewerRegion* region = obj->getRegion();
+ if(region)
+ {
+ region->loadCacheMiscExtras(obj->getLocalID());
+ }
obj->markForUpdate(FALSE);
}
});
@@ -5698,6 +5702,23 @@ void LLViewerObject::setDebugText(const std::string &utf8text)
updateText();
}
+void LLViewerObject::appendDebugText(const std::string &utf8text)
+{
+ if (utf8text.empty() && !mText)
+ {
+ return;
+ }
+
+ if (!mText)
+ {
+ initHudText();
+ }
+ mText->addLine(utf8text, LLColor4::white);
+ mText->setZCompare(FALSE);
+ mText->setDoFade(FALSE);
+ updateText();
+}
+
void LLViewerObject::initHudText()
{
mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
@@ -7260,12 +7281,14 @@ void LLViewerObject::setRenderMaterialID(S32 te_in, const LLUUID& id, bool updat
}
else
{
- LLPointer<LLViewerObject> this_ptr = this;
- new_material->onMaterialComplete([this_ptr]() mutable {
- if (this_ptr->isDead()) { return; }
-
- this_ptr->rebuildMaterial();
- });
+ new_material->onMaterialComplete([obj_id = getID()]()
+ {
+ LLViewerObject* obj = gObjectList.findObject(obj_id);
+ if (obj)
+ {
+ obj->rebuildMaterial();
+ }
+ });
}
// predictively update LLRenderMaterialParams (don't wait for server)