summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingsbase.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-09-12 14:32:43 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-09-12 18:45:06 +0300
commite71215dcfdb960f64a7f10d2fba71790f8e7bcd1 (patch)
treee16f82e0b426c43bad2fdc57c079936f166a6c36 /indra/llinventory/llsettingsbase.h
parentdfff269d83df60de49fe8e5d7fffe9d1913e8036 (diff)
viewer#2529 Optimize LLSettingsWater::blend
Diffstat (limited to 'indra/llinventory/llsettingsbase.h')
-rw-r--r--indra/llinventory/llsettingsbase.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 7b59437d6e..816ff3e111 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -173,6 +173,18 @@ public:
loadValuesFromLLSD();
}
+ virtual void replaceSettings(const ptr_t& other)
+ {
+ mBlendedFactor = 0.0;
+ setDirtyFlag(true);
+ mReplaced = true;
+ mSettingFlags = other->getFlags();
+ mSettingName = other->getName();
+ mSettingId = other->getId();
+ mAssetId = other->getAssetId();
+ setLLSDDirty();
+ }
+
void setSettings(LLSD settings)
{
setDirtyFlag(true);
@@ -327,6 +339,10 @@ public:
virtual void updateSettings() { mDirty = false; mReplaced = false; }
LLSD cloneSettings();
+ static void lerpVector2(LLVector2& a, const LLVector2& b, F32 mix);
+ static void lerpVector3(LLVector3& a, const LLVector3& b, F32 mix);
+ static void lerpColor(LLColor3& a, const LLColor3& b, F32 mix);
+
protected:
LLSettingsBase();
@@ -370,9 +386,9 @@ protected:
mBlendedFactor = blendfactor;
}
- virtual void replaceWith(LLSettingsBase::ptr_t other)
+ virtual void replaceWith(const LLSettingsBase::ptr_t other)
{
- replaceSettings(other->cloneSettings());
+ replaceSettings(other);
setBlendFactor(other->getBlendFactor());
}