summaryrefslogtreecommitdiff
path: root/indra/newview/llenvironment.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-02 07:17:46 -0800
committerGraham Linden <graham@lindenlab.com>2019-03-02 07:17:46 -0800
commitd8eff424a5fb340b828802351e2b7f6b63bfa30f (patch)
tree3f314288516fd8a708eda8014247afafb6bdd428 /indra/newview/llenvironment.cpp
parentbf8dee73f90f74f3eb9fd544dc9673defa52817f (diff)
SL-10664
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r--indra/newview/llenvironment.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index f021c4a8c3..18777e53d1 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -882,6 +882,14 @@ LLSettingsWater::ptr_t LLEnvironment::getCurrentWater() const
return pwater;
}
+void LayerConfigToDensityLayer(const LLSD& layerConfig, DensityLayer& layerOut)
+{
+ layerOut.constant_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
+ layerOut.exp_scale = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
+ layerOut.exp_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
+ layerOut.linear_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
+ layerOut.width = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+}
void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky)
{
@@ -894,13 +902,9 @@ void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settin
settingsOut.m_rayleighProfile.clear();
for (LLSD::array_iterator itf = rayleigh.beginArray(); itf != rayleigh.endArray(); ++itf)
{
- atmosphere::DensityProfileLayer layer;
+ DensityLayer layer;
LLSD& layerConfig = (*itf);
- layer.constant_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
- layer.exp_scale = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
- layer.exp_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
- layer.linear_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
- layer.width = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+ LayerConfigToDensityLayer(layerConfig, layer);
settingsOut.m_rayleighProfile.push_back(layer);
}
@@ -908,13 +912,9 @@ void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settin
settingsOut.m_mieProfile.clear();
for (LLSD::array_iterator itf = mie.beginArray(); itf != mie.endArray(); ++itf)
{
- atmosphere::DensityProfileLayer layer;
+ DensityLayer layer;
LLSD& layerConfig = (*itf);
- layer.constant_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
- layer.exp_scale = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
- layer.exp_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
- layer.linear_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
- layer.width = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+ LayerConfigToDensityLayer(layerConfig, layer);
settingsOut.m_mieProfile.push_back(layer);
}
settingsOut.m_mieAnisotropy = psky->getMieAnisotropy();
@@ -923,13 +923,9 @@ void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settin
settingsOut.m_absorptionProfile.clear();
for (LLSD::array_iterator itf = absorption.beginArray(); itf != absorption.endArray(); ++itf)
{
- atmosphere::DensityProfileLayer layer;
+ DensityLayer layer;
LLSD& layerConfig = (*itf);
- layer.constant_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal();
- layer.exp_scale = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal();
- layer.exp_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal();
- layer.linear_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal();
- layer.width = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal();
+ LayerConfigToDensityLayer(layerConfig, layer);
settingsOut.m_absorptionProfile.push_back(layer);
}
}