summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-06-10 19:55:30 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-06-10 19:55:30 +0300
commit150c18169de8b7155658e676b86014716f62aeed (patch)
tree2e9f10fc315b314abd8fdfa71696661bf1763af8
parent5b5355f2e90a59ac60f4e3c961677f90faea90f6 (diff)
STORM-1305 WIP Made LLWaterParamManager::mParamList private and typedef'ed its type.
-rw-r--r--indra/newview/llenvmanager.cpp4
-rw-r--r--indra/newview/llfloaterdeleteenvpreset.cpp4
-rw-r--r--indra/newview/llfloatereditwater.cpp4
-rw-r--r--indra/newview/llfloaterenvironmentsettings.cpp4
-rw-r--r--indra/newview/llfloaterregioninfo.cpp4
-rw-r--r--indra/newview/llfloaterwater.cpp12
-rw-r--r--indra/newview/llwaterparammanager.cpp6
-rw-r--r--indra/newview/llwaterparammanager.h10
8 files changed, 24 insertions, 24 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index 6b506574b6..a9083cf3dc 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -884,8 +884,8 @@ void LLEnvManagerNew::dumpPresets()
{
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++)
+ const LLWaterParamManager::preset_map_t& water_params_map = LLWaterParamManager::instance().getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
{
LL_DEBUGS("Windlight") << " - " << it->first << LL_ENDL;
}
diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp
index 73e62ca6f8..56412acc07 100644
--- a/indra/newview/llfloaterdeleteenvpreset.cpp
+++ b/indra/newview/llfloaterdeleteenvpreset.cpp
@@ -194,8 +194,8 @@ void LLFloaterDeleteEnvPreset::populateWaterPresetsList()
}
LLWaterParamManager& water_mgr = LLWaterParamManager::instance();
- const std::map<std::string, LLWaterParamSet> &water_params_map = water_mgr.mParamList;
- for (std::map<std::string, LLWaterParamSet>::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
+ const LLWaterParamManager::preset_map_t &water_params_map = water_mgr.getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
{
std::string name = it->first;
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp
index a5d392afc6..e8c20f5932 100644
--- a/indra/newview/llfloatereditwater.cpp
+++ b/indra/newview/llfloatereditwater.cpp
@@ -508,8 +508,8 @@ void LLFloaterEditWater::refreshWaterPresetsList()
#endif
// Add local water presets.
- 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++)
+ const LLWaterParamManager::preset_map_t &water_params_map = LLWaterParamManager::instance().getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
{
mWaterPresetCombo->add(it->first, LLSD().with(0, it->first).with(1, LLEnvKey::SCOPE_LOCAL));
}
diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp
index 23da78f99f..8f451d7620 100644
--- a/indra/newview/llfloaterenvironmentsettings.cpp
+++ b/indra/newview/llfloaterenvironmentsettings.cpp
@@ -209,8 +209,8 @@ void LLFloaterEnvironmentSettings::populateWaterPresetsList()
{
mWaterPresetCombo->removeall();
- const std::map<std::string, LLWaterParamSet> &water_params_map = LLWaterParamManager::getInstance()->mParamList;
- for (std::map<std::string, LLWaterParamSet>::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
+ const LLWaterParamManager::preset_map_t &water_params_map = LLWaterParamManager::getInstance()->getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
{
mWaterPresetCombo->add(it->first);
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index cb84eaed34..a7ab75a85e 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3418,8 +3418,8 @@ void LLPanelEnvironmentInfo::populateWaterPresetsList()
}
// Add local water presets.
- 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++)
+ const LLWaterParamManager::preset_map_t &water_params_map = LLWaterParamManager::instance().getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++)
{
mWaterPresetCombo->add(it->first, LLWLParamKey(it->first, LLEnvKey::SCOPE_LOCAL).toLLSD());
}
diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp
index c32e25be41..30bec8a77a 100644
--- a/indra/newview/llfloaterwater.cpp
+++ b/indra/newview/llfloaterwater.cpp
@@ -90,11 +90,10 @@ BOOL LLFloaterWater::postBuild()
if(comboBox != NULL) {
- std::map<std::string, LLWaterParamSet>::iterator mIt =
- LLWaterParamManager::getInstance()->mParamList.begin();
- for(; mIt != LLWaterParamManager::getInstance()->mParamList.end(); mIt++)
+ const LLWaterParamManager::preset_map_t& preset_map = LLWaterParamManager::getInstance()->getPresets();
+ for (LLWaterParamManager::preset_map_t::const_iterator it = preset_map.begin(); it != preset_map.end(); ++it)
{
- comboBox->add(mIt->first);
+ comboBox->add(it->first);
}
// set defaults on combo boxes
@@ -203,11 +202,8 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res
// add the current parameters to the list
// see if it's there first
- std::map<std::string, LLWaterParamSet>::iterator mIt =
- param_mgr->mParamList.find(text);
-
// if not there, add a new one
- if(mIt == param_mgr->mParamList.end())
+ if (!param_mgr->hasParamSet(text))
{
param_mgr->addParamSet(text, param_mgr->mCurParams);
comboBox->add(text);
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index aab621738c..968425a029 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -283,7 +283,7 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet& param)
{
// add a new one if not one there already
- std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
+ preset_map_t::iterator mIt = mParamList.find(name);
if(mIt == mParamList.end())
{
mParamList[name] = param;
@@ -304,7 +304,7 @@ BOOL LLWaterParamManager::addParamSet(const std::string& name, LLSD const & para
bool LLWaterParamManager::getParamSet(const std::string& name, LLWaterParamSet& param)
{
// find it and set it
- std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
+ preset_map_t::iterator mIt = mParamList.find(name);
if(mIt != mParamList.end())
{
param = mParamList[name];
@@ -344,7 +344,7 @@ bool LLWaterParamManager::setParamSet(const std::string& name, const LLSD & para
bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_from_disk)
{
// remove from param list
- std::map<std::string, LLWaterParamSet>::iterator it = mParamList.find(name);
+ preset_map_t::iterator it = mParamList.find(name);
if (it == mParamList.end())
{
LL_WARNS("WindLight") << "No water preset named " << name << LL_ENDL;
diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h
index cb838866b1..9325faa021 100644
--- a/indra/newview/llwaterparammanager.h
+++ b/indra/newview/llwaterparammanager.h
@@ -216,6 +216,7 @@ class LLWaterParamManager : public LLSingleton<LLWaterParamManager>
{
LOG_CLASS(LLWaterParamManager);
public:
+ typedef std::map<std::string, LLWaterParamSet> preset_map_t;
typedef boost::signals2::signal<void()> preset_list_signal_t;
/// save the parameter presets to file
@@ -258,6 +259,9 @@ public:
/// @return true if the preset comes out of the box
bool isSystemPreset(const std::string& preset_name);
+ /// @return all named water presets.
+ const preset_map_t& getPresets() const { return mParamList; }
+
/// Emitted when a preset gets added or deleted.
boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb);
@@ -300,9 +304,6 @@ public:
WaterFloatControl mScaleBelow;
WaterFloatControl mBlurMultiplier;
- // list of all the parameters, listed by name
- std::map<std::string, LLWaterParamSet> mParamList;
-
F32 mDensitySliderValue;
private:
@@ -321,6 +322,9 @@ private:
LLVector4 mWaterPlane;
F32 mWaterFogKS;
+ // list of all the parameters, listed by name
+ preset_map_t mParamList;
+
preset_list_signal_t mPresetListChangeSignal;
};