From 5b5ee18f6fb1bb6c5ef8590f933014069c5613a9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 24 Apr 2017 19:55:55 +0300 Subject: MAINT-7330 Fixed circularity of environmental singletons --- indra/newview/llwlparammanager.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview/llwlparammanager.cpp') diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 2b6d88efef..debe467a9a 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -50,7 +50,6 @@ #include "llagent.h" #include "llviewerregion.h" -#include "lldaycyclemanager.h" #include "llenvmanager.h" #include "llwlparamset.h" #include "llpostprocess.h" @@ -487,6 +486,12 @@ bool LLWLParamManager::applyDayCycleParams(const LLSD& params, LLEnvKey::EScope return true; } +void LLWLParamManager::setDefaultDay() +{ + mDay.loadDayCycleFromFile("Default.xml"); + resetAnimator(0.5, LLEnvManagerNew::getInstance()->getUseDayCycle()); +} + bool LLWLParamManager::applySkyParams(const LLSD& params) { mAnimator.deactivate(); @@ -672,17 +677,6 @@ void LLWLParamManager::initSingleton() loadAllPresets(); - // load the day - std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName(); - if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay)) - { - // Fall back to default. - LL_WARNS() << "No day cycle named " << preferred_day << ", falling back to defaults" << LL_ENDL; - mDay.loadDayCycleFromFile("Default.xml"); - - // *TODO: Fix user preferences accordingly. - } - // *HACK - sets cloud scrolling to what we want... fix this better in the future std::string sky = LLEnvManagerNew::instance().getSkyPresetName(); if (!getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams)) @@ -698,8 +692,6 @@ void LLWLParamManager::initSingleton() // but use linden time sets it to what the estate is mAnimator.setTimeType(LLWLAnimator::TIME_LINDEN); - - LLEnvManagerNew::instance().usePrefs(); } // static -- cgit v1.2.3 From 0dcb423cf3dc42e11621eece972801b036657e91 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 25 Apr 2017 17:48:34 +0300 Subject: MAINT-7145 Eliminate LLSingleton circular references --- indra/newview/llwlparammanager.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'indra/newview/llwlparammanager.cpp') diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index debe467a9a..4b4393b07b 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -50,7 +50,6 @@ #include "llagent.h" #include "llviewerregion.h" -#include "llenvmanager.h" #include "llwlparamset.h" #include "llpostprocess.h" @@ -251,13 +250,13 @@ void LLWLParamManager::addAllSkies(const LLWLParamKey::EScope scope, const LLSD& } } -void LLWLParamManager::refreshRegionPresets() +void LLWLParamManager::refreshRegionPresets(const LLSD& region_sky_presets) { // Remove all region sky presets because they may belong to a previously visited region. clearParamSetsOfScope(LLEnvKey::SCOPE_REGION); // Add all sky presets belonging to the current region. - addAllSkies(LLEnvKey::SCOPE_REGION, LLEnvManagerNew::instance().getRegionSettings().getSkyMap()); + addAllSkies(LLEnvKey::SCOPE_REGION, region_sky_presets); } void LLWLParamManager::loadAllPresets() @@ -489,7 +488,6 @@ bool LLWLParamManager::applyDayCycleParams(const LLSD& params, LLEnvKey::EScope void LLWLParamManager::setDefaultDay() { mDay.loadDayCycleFromFile("Default.xml"); - resetAnimator(0.5, LLEnvManagerNew::getInstance()->getUseDayCycle()); } bool LLWLParamManager::applySkyParams(const LLSD& params) @@ -499,6 +497,12 @@ bool LLWLParamManager::applySkyParams(const LLSD& params) return true; } +void LLWLParamManager::setDefaultSky() +{ + getParamSet(LLWLParamKey("Default", LLWLParamKey::SCOPE_LOCAL), mCurParams); +} + + void LLWLParamManager::resetAnimator(F32 curTime, bool run) { mAnimator.setTrack(mDay.mTimeMap, mDay.mDayRate, @@ -677,19 +681,6 @@ void LLWLParamManager::initSingleton() loadAllPresets(); - // *HACK - sets cloud scrolling to what we want... fix this better in the future - std::string sky = LLEnvManagerNew::instance().getSkyPresetName(); - if (!getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams)) - { - LL_WARNS() << "No sky preset named " << sky << ", falling back to defaults" << LL_ENDL; - getParamSet(LLWLParamKey("Default", LLWLParamKey::SCOPE_LOCAL), mCurParams); - - // *TODO: Fix user preferences accordingly. - } - - // set it to noon - resetAnimator(0.5, LLEnvManagerNew::instance().getUseDayCycle()); - // but use linden time sets it to what the estate is mAnimator.setTimeType(LLWLAnimator::TIME_LINDEN); } -- cgit v1.2.3