summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llenvmanager.cpp50
-rw-r--r--indra/newview/llenvmanager.h1
-rw-r--r--indra/newview/llfloaterenvironmentsettings.cpp1
-rw-r--r--indra/newview/llfloaterregioninfo.cpp1
-rw-r--r--indra/newview/llwlparammanager.cpp9
5 files changed, 62 insertions, 0 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index 48d84fcffc..dd8db7b785 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -835,6 +835,56 @@ void LLEnvManagerNew::dumpUserPrefs()
LL_DEBUGS("Windlight") << "UseDayCycle: " << gSavedSettings.getBOOL("UseDayCycle") << LL_ENDL;
}
+void LLEnvManagerNew::dumpPresets()
+{
+ const LLEnvironmentSettings& region_settings = getRegionSettings();
+ std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : "Unknown region";
+
+ // Dump water presets.
+ LL_DEBUGS("Windlight") << "Waters:" << LL_ENDL;
+ if (region_settings.getWaterParams().size() != 0)
+ {
+ LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
+ }
+ const std::map<std::string, LLWaterParamSet> &water_params_map = LLWaterParamManager::instance().mParamList;
+ for (std::map<std::string, LLWaterParamSet>::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
+ {
+ LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
+ }
+
+ // Dump sky presets.
+ LL_DEBUGS("Windlight") << "Skies:" << LL_ENDL;
+ const std::map<LLWLParamKey, LLWLParamSet> &sky_params_map = LLWLParamManager::getInstance()->mParamList;
+ for (std::map<LLWLParamKey, LLWLParamSet>::const_iterator it = sky_params_map.begin(); it != sky_params_map.end(); it++)
+ {
+ std::string preset_name = it->first.name;
+ std::string item_title;
+
+ if (it->first.scope == LLEnvKey::SCOPE_LOCAL) // local preset
+ {
+ item_title = preset_name;
+ }
+ else // region preset
+ {
+ item_title = preset_name + " (" + region_name + ")";
+ }
+ LL_DEBUGS("Windlight") << " - " << item_title << LL_ENDL;
+ }
+
+ // Dump day cycles.
+ LL_DEBUGS("Windlight") << "Days:" << LL_ENDL;
+ const LLSD& cur_region_dc = region_settings.getWLDayCycle();
+ if (cur_region_dc.size() != 0)
+ {
+ LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
+ }
+ const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
+ for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ {
+ LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
+ }
+}
+
void LLEnvManagerNew::requestRegionSettings()
{
LLEnvironmentRequest::initiate();
diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h
index 098fc6f353..62ec08b09f 100644
--- a/indra/newview/llenvmanager.h
+++ b/indra/newview/llenvmanager.h
@@ -301,6 +301,7 @@ public:
bool use_fixed_sky,
bool use_region_settings);
void dumpUserPrefs();
+ void dumpPresets();
// Misc.
void requestRegionSettings();
diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp
index 7287a2beff..15dba80b61 100644
--- a/indra/newview/llfloaterenvironmentsettings.cpp
+++ b/indra/newview/llfloaterenvironmentsettings.cpp
@@ -72,6 +72,7 @@ BOOL LLFloaterEnvironmentSettings::postBuild()
childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL);
getChild<LLUICtrl>("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance()));
childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL);
+ getChild<LLUICtrl>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance()));
setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this));
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index ad63300259..ab164e7db0 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3295,6 +3295,7 @@ BOOL LLPanelEnvironmentInfo::postBuild()
childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL);
getChild<LLButton>("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance()));
childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL);
+ getChild<LLButton>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance()));
LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this));
LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1));
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index 83d9ef6fde..5980410e64 100644
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -678,6 +678,8 @@ bool LLWLParamManager::addParamSet(const LLWLParamKey& key, LLWLParamSet& param)
std::map<LLWLParamKey, LLWLParamSet>::iterator mIt = mParamList.find(key);
if(mIt == mParamList.end())
{
+ llassert(!key.name.empty());
+ // *TODO: validate params
mParamList[key] = param;
return true;
}
@@ -691,6 +693,8 @@ BOOL LLWLParamManager::addParamSet(const LLWLParamKey& key, LLSD const & param)
std::map<LLWLParamKey, LLWLParamSet>::const_iterator finder = mParamList.find(key);
if(finder == mParamList.end())
{
+ llassert(!key.name.empty());
+ // *TODO: validate params
mParamList[key].setAll(param);
return TRUE;
}
@@ -716,6 +720,8 @@ bool LLWLParamManager::getParamSet(const LLWLParamKey& key, LLWLParamSet& param)
bool LLWLParamManager::setParamSet(const LLWLParamKey& key, LLWLParamSet& param)
{
+ llassert(!key.name.empty());
+ // *TODO: validate params
mParamList[key] = param;
return true;
@@ -723,6 +729,9 @@ bool LLWLParamManager::setParamSet(const LLWLParamKey& key, LLWLParamSet& param)
bool LLWLParamManager::setParamSet(const LLWLParamKey& key, const LLSD & param)
{
+ llassert(!key.name.empty());
+ // *TODO: validate params
+
// quick, non robust (we won't be working with files, but assets) check
// this might not actually be true anymore....
if(!param.isMap())