summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-06 19:48:12 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-06 19:48:12 +0100
commitcaa5bd3cb9f22a42de9fc1f37bb98b17e2405b5b (patch)
treedae7aec5a510f94e7ccc52bf38541e4a4441790b
parent5b4eb9fb93af87cbbe163ad6f87d98362a963389 (diff)
Fix legacy haze validation returning warnings as errors.
Add assert that calculated spans are > 0 to avoid div by 0 NaNs. Make span calc return 1.0 for case where begin == end. Fix order of ops in LLTrackBlenderLoopingTime ctor causing skies to be init'd with water instances.
-rw-r--r--indra/llinventory/llsettingssky.cpp2
-rw-r--r--indra/newview/llenvironment.cpp21
2 files changed, 8 insertions, 15 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 263e721d00..4763215cff 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -226,7 +226,7 @@ bool validateLegacyHaze(LLSD &value)
}
if (result["warnings"].size() > 0)
{
- LL_WARNS("SETTINGS") << "Legacy Haze Config Validation warnings: " << result["errors"] << LL_ENDL;
+ LL_WARNS("SETTINGS") << "Legacy Haze Config Validation warnings: " << result["warnings"] << LL_ENDL;
return false;
}
return true;
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 02d79b2bae..5b184d8c25 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -77,7 +77,7 @@ namespace
return LLSettingsBase::TrackPosition(1.0) - (begin - end);
}
- return 0;
+ return 1.0f;
}
LLSettingsDay::CycleTrack_t::iterator get_wrapping_atafter(LLSettingsDay::CycleTrack_t &collection, const LLSettingsBase::TrackPosition& key)
@@ -139,14 +139,15 @@ namespace
mCycleLength(cyclelength),
mCycleOffset(cycleoffset)
{
+ // must happen prior to getBoundingEntries call...
+ mTrackNo = selectTrackNumber(trackno);
+
LLSettingsDay::TrackBound_t initial = getBoundingEntries(getAdjustedNow());
mInitial = (*initial.first).second;
mFinal = (*initial.second).second;
mBlendSpan = getSpanTime(initial);
- mTrackNo = selectTrackNumber(trackno);
-
setOnFinished([this](const LLSettingsBlender::ptr_t &){ onFinishedSpan(); });
}
@@ -211,7 +212,9 @@ namespace
LLSettingsBase::Seconds getSpanTime(const LLSettingsDay::TrackBound_t &bounds) const
{
- return mCycleLength * get_wrapping_distance((*bounds.first).first, (*bounds.second).first);
+ LLSettingsBase::Seconds span = mCycleLength * get_wrapping_distance((*bounds.first).first, (*bounds.second).first);
+ llassert(span > 0.01f);
+ return span;
}
private:
@@ -1905,11 +1908,6 @@ void LLEnvironment::DayInstance::animate()
mWater.reset();
mBlenderWater.reset();
}
-// else if (wtrack.size() == 1)
-// {
-// mWater = std::static_pointer_cast<LLSettingsWater>((*(wtrack.begin())).second);
-// mBlenderWater.reset();
-// }
else
{
mWater = LLSettingsVOWater::buildDefaultWater();
@@ -1924,11 +1922,6 @@ void LLEnvironment::DayInstance::animate()
mSky.reset();
mBlenderSky.reset();
}
-// else if (track.size() == 1)
-// {
-// mSky = std::static_pointer_cast<LLSettingsSky>((*(track.begin())).second);
-// mBlenderSky.reset();
-// }
else
{
mSky = LLSettingsVOSky::buildDefaultSky();