diff options
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r-- | indra/newview/llenvmanager.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index b97e483fd9..12c3070474 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -476,7 +476,7 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) mCachedRegionPrefs = new_settings; // Load region sky presets. - LLWLParamManager::instance().refreshRegionPresets(); + LLWLParamManager::instance().refreshRegionPresets(getRegionSettings().getSkyMap()); // If using server settings, update managers. if (getUseRegionSettings()) @@ -509,6 +509,25 @@ void LLEnvManagerNew::initSingleton() LL_DEBUGS("Windlight") << "Initializing LLEnvManagerNew" << LL_ENDL; loadUserPrefs(); + + // preferences loaded, can set params + std::string preferred_day = getDayCycleName(); + if (!useDayCycle(preferred_day, LLEnvKey::SCOPE_LOCAL)) + { + LL_WARNS() << "No day cycle named " << preferred_day << ", reverting LLWLParamManager to defaults" << LL_ENDL; + LLWLParamManager::instance().setDefaultDay(); + } + + std::string sky = getSkyPresetName(); + if (!useSkyPreset(sky)) + { + LL_WARNS() << "No sky preset named " << sky << ", falling back to defaults" << LL_ENDL; + LLWLParamManager::instance().setDefaultSky(); + + // *TODO: Fix user preferences accordingly. + } + + LLWLParamManager::instance().resetAnimator(0.5 /*noon*/, getUseDayCycle()); } void LLEnvManagerNew::updateSkyFromPrefs() |