summaryrefslogtreecommitdiff
path: root/indra/newview/llwlparammanager.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-05-17 17:33:08 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-05-17 17:33:08 +0300
commit242f45d167a615d091580eda12701b34a86b663d (patch)
tree59291060160fcc2997ef4076a9ece0a1f8cbc958 /indra/newview/llwlparammanager.cpp
parentec749bb1c1fa143c6019791d6713d85f05510e53 (diff)
STORM-1245 WIP Fixed switching to day cycle.
Diffstat (limited to 'indra/newview/llwlparammanager.cpp')
-rw-r--r--indra/newview/llwlparammanager.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index 7af17a8d0b..e5fb88afa2 100644
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -600,33 +600,20 @@ void LLWLParamManager::applyUserPrefs(bool interpolate)
}
else // apply user-specified settings
{
- // Load day cycle anyway so that we can switch to it from a fixed sky.
- LL_DEBUGS("Windlight") << "Loading day cycle " << LLEnvManagerNew::instance().getDayCycleName() << LL_ENDL;
- mDay.loadDayCycleFromFile(LLEnvManagerNew::instance().getDayCycleName() + ".xml");
-
- bool use_day_cycle = LLEnvManagerNew::instance().getUseDayCycle();
- if (!use_day_cycle) // if we should use fixed sky
+ if (LLEnvManagerNew::instance().getUseDayCycle())
+ {
+ std::string day_cycle = LLEnvManagerNew::instance().getDayCycleName();
+ LL_DEBUGS("Windlight") << "Applying day cycle [" << day_cycle << "]" << LL_ENDL;
+ mDay.loadDayCycleFromFile(day_cycle + ".xml");
+ resetAnimator(0.5, true); // set to noon and start animator
+ }
+ else
{
+ mAnimator.deactivate();
std::string sky = LLEnvManagerNew::instance().getSkyPresetName();
LL_DEBUGS("Windlight") << "Loading fixed sky " << sky << LL_ENDL;
getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams);
}
-
- // Animator should be running if we're using a day cycle
- // and be stopped if we want fixed sky.
- if (use_day_cycle != mAnimator.getIsRunning())
- {
- if (use_day_cycle)
- {
- LL_DEBUGS("Windlight") << "Activating animator" << LL_ENDL;
- mAnimator.activate(mAnimator.getTimeType());
- }
- else
- {
- LL_DEBUGS("Windlight") << "Deactivating animator" << LL_ENDL;
- mAnimator.deactivate();
- }
- }
}
}