summaryrefslogtreecommitdiff
path: root/indra/newview/llwaterparammanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llwaterparammanager.cpp')
-rw-r--r--indra/newview/llwaterparammanager.cpp57
1 files changed, 8 insertions, 49 deletions
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index d84ccb0ada..aab621738c 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -198,67 +198,26 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
}
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WATERPARAM("Update Water Params");
-
-void LLWaterParamManager::applyUserPrefs(bool interpolate)
+void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate)
{
- LLSD target_water_params;
-
- // Determine new water settings based on user prefs.
-
- {
- // Fall back to default water.
- LLWaterParamSet default_water;
- getParamSet("Default", default_water);
- target_water_params = default_water.getAll();
- }
-
- if (LLEnvManagerNew::instance().getUseRegionSettings())
- {
- // *TODO: make sure whether region settings belong to the current region?
- const LLSD& region_water_params = LLEnvManagerNew::instance().getRegionSettings().getWaterParams();
- if (region_water_params.size() != 0) // region has no water settings
- {
- LL_DEBUGS("Windlight") << "Applying region water" << LL_ENDL;
- target_water_params = region_water_params;
- }
- else
- {
- LL_DEBUGS("Windlight") << "Applying default water" << LL_ENDL;
- }
- }
- else
+ if (params.size() == 0)
{
- std::string water = LLEnvManagerNew::instance().getWaterPresetName();
- LL_DEBUGS("Windlight") << "Applying water preset [" << water << "]" << LL_ENDL;
- LLWaterParamSet params;
- if (!getParamSet(water, params))
- {
- llwarns << "No wayer preset named " << water << ", falling back to defaults" << llendl;
- getParamSet("Default", params);
-
- // *TODO: Fix user preferences accordingly.
- }
- target_water_params = params.getAll();
- }
-
- // Apply them with or without interpolation.
- if (target_water_params.size() == 0)
- {
- llwarns << "Undefined target water params" << llendl;
+ llwarns << "Undefined water params" << llendl;
return;
}
if (interpolate)
{
- LLWLParamManager::getInstance()->mAnimator.startInterpolation(target_water_params);
+ LLWLParamManager::getInstance()->mAnimator.startInterpolation(params);
}
else
{
- LLWaterParamManager::getInstance()->mCurParams.setAll(target_water_params);
+ mCurParams.setAll(params);
}
}
+static LLFastTimer::DeclareTimer FTM_UPDATE_WATERPARAM("Update Water Params");
+
void LLWaterParamManager::update(LLViewerCamera * cam)
{
LLFastTimer ftm(FTM_UPDATE_WATERPARAM);
@@ -442,7 +401,7 @@ void LLWaterParamManager::initSingleton()
{
LL_DEBUGS("Windlight") << "Initializing water" << LL_ENDL;
loadAllPresets();
- applyUserPrefs(false);
+ LLEnvManagerNew::instance().usePrefs();
}
// static