Windlight/water parameter managers now derived from standard LLSingleton instead of using some silly redundant clone.

This commit is contained in:
Shyotl
2011-09-02 06:35:53 -05:00
parent 91cb401324
commit 443d4e9f56
31 changed files with 418 additions and 390 deletions

View File

@@ -218,22 +218,15 @@ struct WaterExpFloatControl
/// WindLight parameter manager class - what controls all the wind light shaders
class LLWaterParamManager
class LLWaterParamManager : public LLSingleton<LLWaterParamManager>
{
LOG_CLASS(LLWaterParamManager);
public:
LLWaterParamManager();
~LLWaterParamManager();
typedef std::map<std::string, LLWaterParamSet> preset_map_t;
void updateShaderLinks();
/// load a preset file
void loadAllPresets(const std::string & fileName);
/// load an individual preset into the sky
void loadPreset(const std::string & name,bool propagate=true);
/// save the parameter presets to file
void savePreset(const std::string & name);
@@ -246,12 +239,6 @@ public:
/// Update shader uniforms that have changed.
void updateShaderUniforms(LLGLSLShader * shader);
/// Perform global initialization for this class.
static void initClass(void);
// Cleanup of global data that's only inited once per class.
static void cleanupClass();
/// add a param to the list
bool addParamSet(const std::string& name, LLWaterParamSet& param);
@@ -270,6 +257,9 @@ public:
/// gets rid of a parameter and any references to it
/// returns true if successful
bool removeParamSet(const std::string& name, bool delete_from_disk);
/// @return all named water presets.
const preset_map_t& getPresets() const { return mParamList; }
/// set the normap map we want for water
bool setNormalMapID(const LLUUID& img);
@@ -313,18 +303,29 @@ public:
WaterFloatControl mScaleBelow;
WaterFloatControl mBlurMultiplier;
// list of all the parameters, listed by name
std::map<std::string, LLWaterParamSet> mParamList;
F32 mDensitySliderValue;
/// load an individual preset into the sky
void loadPreset(const std::string & name,bool propagate=true);
private:
friend class LLSingleton<LLWaterParamManager>;
/*virtual*/ void initSingleton();
LLWaterParamManager();
~LLWaterParamManager();
/// load a preset file
void loadAllPresets(const std::string & fileName);
LLVector4 mWaterPlane;
F32 mWaterFogKS;
std::vector<LLGLSLShader *> mShaderList;
// our parameter manager singleton instance
static LLWaterParamManager * sInstance;
// list of all the parameters, listed by name
std::map<std::string, LLWaterParamSet> mParamList;
std::vector<LLGLSLShader *> mShaderList;
};
inline void LLWaterParamManager::setDensitySliderValue(F32 val)