summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-01 15:34:21 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-01 15:34:21 +0100
commit37e8fd20c3823482f3a15b4bfd544f7847070db8 (patch)
treeb31e3a1ef86431cda7703621f779b38a98c14a3e /indra/llinventory
parent64302d3000b69b31e72eb6a3bd8a981c80cb88de (diff)
parentbd84cbfa11fbe2b3aa5ceba5978841310488b8e4 (diff)
Merge to 5.1.6
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsbase.cpp13
-rw-r--r--indra/llinventory/llsettingsbase.h16
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp10
-rw-r--r--indra/llinventory/llsettingsdaycycle.h5
-rw-r--r--indra/llinventory/llsettingssky.h3
-rw-r--r--indra/llinventory/llsettingswater.h10
6 files changed, 48 insertions, 9 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index f870ec8904..d8e337e231 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -547,8 +547,11 @@ F64 LLSettingsBlender::setPosition(F64 blendf)
}
blendf = llclamp(blendf, 0.0, 1.0);
- //_WARNS("LAPRAS") << "blending at " << (blendf * 100.0f) << "%" << LL_ENDL;
mTarget->replaceSettings(mInitial->getSettings());
+ if (!mFinal || (mInitial == mFinal) || (blendf == 0.0))
+ { // this is a trivial blend. Results will be identical to the initial.
+ return blendf;
+ }
mTarget->blend(mFinal, blendf);
return blendf;
@@ -562,6 +565,11 @@ void LLSettingsBlender::triggerComplete()
}
//-------------------------------------------------------------------------
+F64 LLSettingsBlenderTimeDelta::calculateBlend(F64 spanpos, F64 spanlen) const
+{
+ return fmod(spanpos, spanlen) / spanlen;
+}
+
void LLSettingsBlenderTimeDelta::update(F64 timedelta)
{
mTimeSpent += F64Seconds(timedelta);
@@ -572,8 +580,7 @@ void LLSettingsBlenderTimeDelta::update(F64 timedelta)
return;
}
- F64 blendf = fmod(mTimeSpent.value(), mBlendSpan.value()) / mBlendSpan.value();
-
+ F64 blendf = calculateBlend(mTimeSpent.value(), mBlendSpan.value());
// Note no clamp here.
setPosition(blendf);
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 264c6c6c49..29ed50419a 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -274,7 +274,10 @@ public:
mFinal(endsetting)
{
if (mInitial)
- mTarget->replaceSettings(mInitial->getSettings());
+ mTarget->replaceSettings(mInitial->getSettings());
+
+ if (!mFinal)
+ mFinal = mInitial;
}
virtual ~LLSettingsBlender() {}
@@ -282,8 +285,15 @@ public:
virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 /*span*/ = 1.0)
{
// note: the 'span' reset parameter is unused by the base class.
+ if (!mInitial)
+ LL_WARNS("BLENDER") << "Reseting blender with empty initial setting. Expect badness in the future." << LL_ENDL;
+
mInitial = initsetting;
mFinal = endsetting;
+
+ if (!mFinal)
+ mFinal = mInitial;
+
mTarget->replaceSettings(mInitial->getSettings());
}
@@ -310,6 +320,8 @@ public:
virtual void update(F64 blendf);
virtual F64 setPosition(F64 blendf);
+ virtual void switchTrack(S32 trackno, F64 position = -1.0) { /*NoOp*/ }
+
protected:
void triggerComplete();
@@ -351,6 +363,8 @@ public:
virtual void update(F64 timedelta) override;
protected:
+ F64 calculateBlend(F64 spanpos, F64 spanlen) const;
+
F64Seconds mBlendSpan;
F64Seconds mLastUpdate;
F64Seconds mTimeSpent;
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index aa3fd4e0e6..577b12b031 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -611,6 +611,16 @@ LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 tra
return LLSettingsBase::ptr_t();
}
+F32 LLSettingsDay::getUpperBoundFrame(S32 track, F32 keyframe)
+{
+ return get_wrapping_atafter(mDayTracks[track], keyframe)->first;
+}
+
+F32 LLSettingsDay::getLowerBoundFrame(S32 track, F32 keyframe)
+{
+ return get_wrapping_atbefore(mDayTracks[track], keyframe)->first;
+}
+
LLSettingsDay::TrackBound_t LLSettingsDay::getBoundingEntries(LLSettingsDay::CycleTrack_t &track, F32 keyframe)
{
return TrackBound_t(get_wrapping_atbefore(track, keyframe), get_wrapping_atafter(track, keyframe));
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 9a89031aed..5e6fc7f21d 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -114,6 +114,11 @@ public:
virtual validation_list_t getValidationList() const override;
static validation_list_t validationList();
+ virtual LLSettingsBase::ptr_t buildDerivedClone() override { return buildClone(); }
+
+ F32 getUpperBoundFrame(S32 track, F32 keyframe);
+ F32 getLowerBoundFrame(S32 track, F32 keyframe);
+
protected:
LLSettingsDay();
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index 3084cadd57..9b50f5a4b6 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -411,6 +411,8 @@ public:
LLColor3 getSunDiffuse() const;
LLColor4 getTotalAmbient() const;
+ virtual LLSettingsBase::ptr_t buildDerivedClone() override { return buildClone(); }
+
protected:
static const std::string SETTING_LEGACY_EAST_ANGLE;
static const std::string SETTING_LEGACY_ENABLE_CLOUD_SCROLL;
@@ -419,7 +421,6 @@ protected:
LLSettingsSky();
virtual stringset_t getSlerpKeys() const override;
- virtual stringset_t getSkipInterpolateKeys() const override;
virtual void updateSettings() override;
diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h
index 642f86a9d6..acae903e92 100644
--- a/indra/llinventory/llsettingswater.h
+++ b/indra/llinventory/llsettingswater.h
@@ -76,22 +76,22 @@ public:
setValue(SETTING_BLUR_MULTIPILER, val);
}
- LLColor3 getWaterFogColor() const
+ LLColor3 getFogColor() const
{
return LLColor3(mSettings[SETTING_FOG_COLOR]);
}
- void setWaterFogColor(LLColor3 val)
+ void setFogColor(LLColor3 val)
{
setValue(SETTING_FOG_COLOR, val);
}
- F32 getWaterFogDensity() const
+ F32 getFogDensity() const
{
return mSettings[SETTING_FOG_DENSITY].asReal();
}
- void setWaterFogDensity(F32 val)
+ void setFogDensity(F32 val)
{
setValue(SETTING_FOG_DENSITY, val);
}
@@ -211,6 +211,8 @@ public:
static LLSD translateLegacySettings(LLSD legacy);
+ virtual LLSettingsBase::ptr_t buildDerivedClone() override { return buildClone(); }
+
protected:
static const std::string SETTING_LEGACY_BLUR_MULTIPILER;
static const std::string SETTING_LEGACY_FOG_COLOR;