From e045d212d35354d679c2d2e05c6d4689f9f8ac95 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 27 Sep 2010 22:56:08 -0400 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: first pass at merging in windlight estate settings to viewer-dev codebase. not built, not tested. Probably needs a bunch of fixes to be able to be integrated. (resubmitted by Vadim ProductEngine) --- indra/newview/llwaterparammanager.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index c479f1861c..d5919bbf68 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -212,13 +212,10 @@ struct WaterExpFloatControl /// WindLight parameter manager class - what controls all the wind light shaders -class LLWaterParamManager +class LLWaterParamManager : public LLSingleton { public: - LLWaterParamManager(); - ~LLWaterParamManager(); - /// load a preset file void loadAllPresets(const std::string & fileName); @@ -238,9 +235,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(); @@ -281,9 +275,6 @@ public: F32 getFogDensity(void); LLColor4 getFogColor(void); - // singleton pattern implementation - static LLWaterParamManager * instance(); - public: LLWaterParamSet mCurParams; @@ -311,11 +302,13 @@ public: F32 mDensitySliderValue; private: + friend class LLSingleton; + /*virtual*/ void initSingleton(); + LLWaterParamManager(); + ~LLWaterParamManager(); + LLVector4 mWaterPlane; F32 mWaterFogKS; - - // our parameter manager singleton instance - static LLWaterParamManager * sInstance; }; inline void LLWaterParamManager::setDensitySliderValue(F32 val) -- cgit v1.2.3 From 6bb02e0e260df2d00ab53376cf15af5e7e2fd12f Mon Sep 17 00:00:00 2001 From: Celierra Darling Date: Mon, 10 Jan 2011 15:06:30 -0500 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: Various changes to allow compilation (resubmitted by Vadim ProductEngine) --- indra/newview/llwaterparammanager.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index d5919bbf68..3fe0f0d861 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -235,9 +235,6 @@ public: /// Update shader uniforms that have changed. void updateShaderUniforms(LLGLSLShader * shader); - // 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); -- cgit v1.2.3 From cccca566bd2365c88cca819729c5432af9dfa52f Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 16 May 2011 17:17:01 +0300 Subject: STORM-1245 WIP Reimplementing management of local presets according to the new spec. User environment preferences are now persistent. TODO: Implement applying region env. settings. --- indra/newview/llwaterparammanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 3fe0f0d861..37c04448eb 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -229,6 +229,9 @@ public: /// send the parameters to the shaders void propagateParameters(void); + /// apply user water preferences + void applyUserPrefs(); + /// update information for the shader void update(LLViewerCamera * cam); -- cgit v1.2.3 From 348218e40f362d386a0175d4b010b639282764b2 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 17 May 2011 16:26:55 +0300 Subject: STORM-1245 WIP Restored environment settings interpolation on region crossing. Also got rid of duplicated region environment settings requests. --- indra/newview/llwaterparammanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 37c04448eb..5fadd8d66e 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -230,7 +230,7 @@ public: void propagateParameters(void); /// apply user water preferences - void applyUserPrefs(); + void applyUserPrefs(bool interpolate); /// update information for the shader void update(LLViewerCamera * cam); -- cgit v1.2.3 From 0c358f78ab618de8727892a50cd3a3055dbdf956 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 19 May 2011 21:10:34 +0300 Subject: STORM-1269 FIXED Teleport to a region that has no env. settings now resets environment to defaults. --- indra/newview/llwaterparammanager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 5fadd8d66e..fcf1f8e23d 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -214,6 +214,7 @@ struct WaterExpFloatControl /// WindLight parameter manager class - what controls all the wind light shaders class LLWaterParamManager : public LLSingleton { + LOG_CLASS(LLWaterParamManager); public: /// load a preset file -- cgit v1.2.3 From 173b9d11c41d32c52c4cd64c23e0a5b0f3ef09fc Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 9 Jun 2011 16:38:51 +0300 Subject: STORM-1254 WIP Implemented created and editing local water presets. --- indra/newview/llwaterparammanager.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index fcf1f8e23d..76891094c2 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -216,6 +216,7 @@ class LLWaterParamManager : public LLSingleton { LOG_CLASS(LLWaterParamManager); public: + typedef boost::signals2::signal preset_list_signal_t; /// load a preset file void loadAllPresets(const std::string & fileName); @@ -248,6 +249,9 @@ public: /// get a param from the list bool getParamSet(const std::string& name, LLWaterParamSet& param); + /// check whether the preset is in the list + bool hasParamSet(const std::string& name); + /// set the param in the list with a new param bool setParamSet(const std::string& name, LLWaterParamSet& param); @@ -258,6 +262,12 @@ public: /// returns true if successful bool removeParamSet(const std::string& name, bool delete_from_disk); + /// @return true if the preset comes out of the box + bool isSystemPreset(const std::string& preset_name); + + /// Emitted when a preset gets added or deleted. + boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); + /// set the normap map we want for water bool setNormalMapID(const LLUUID& img); @@ -308,8 +318,13 @@ private: LLWaterParamManager(); ~LLWaterParamManager(); + static std::string getSysDir(); + static std::string getUserDir(); + LLVector4 mWaterPlane; F32 mWaterFogKS; + + preset_list_signal_t mPresetListChangeSignal; }; inline void LLWaterParamManager::setDensitySliderValue(F32 val) -- cgit v1.2.3 From ebdb41e5d630cad91dab5372ffc0b4f461a85426 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 9 Jun 2011 18:48:24 +0300 Subject: STORM-1254 WIP Implemented deleting local water presets. --- indra/newview/llwaterparammanager.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 76891094c2..1f599f57dc 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -218,13 +218,6 @@ class LLWaterParamManager : public LLSingleton public: typedef boost::signals2::signal preset_list_signal_t; - /// 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); @@ -318,6 +311,10 @@ private: LLWaterParamManager(); ~LLWaterParamManager(); + void loadAllPresets(); + void loadPresetsFromDir(const std::string& dir); + bool loadPreset(const std::string& path); + static std::string getSysDir(); static std::string getUserDir(); -- cgit v1.2.3 From 0d1cc56eb128755ce9e63d8cdf852b0e3b6f4fb1 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 10 Jun 2011 18:21:32 +0300 Subject: STORM-1279 FIXED Changing sky preset with a keyboard shortcut now updates the Environment Settings floater. Changes: * Subscribed the floater to the "settings changed" signal of the environment manager. * Rewrote the floater to not modify settings only when the Save button is pressed. * Refactoring to eliminate code duplication. --- indra/newview/llwaterparammanager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 1f599f57dc..cb838866b1 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -224,8 +224,8 @@ public: /// send the parameters to the shaders void propagateParameters(void); - /// apply user water preferences - void applyUserPrefs(bool interpolate); + // display specified water + void applyParams(const LLSD& params, bool interpolate); /// update information for the shader void update(LLViewerCamera * cam); -- cgit v1.2.3 From 150c18169de8b7155658e676b86014716f62aeed Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 10 Jun 2011 19:55:30 +0300 Subject: STORM-1305 WIP Made LLWaterParamManager::mParamList private and typedef'ed its type. --- indra/newview/llwaterparammanager.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') 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 { LOG_CLASS(LLWaterParamManager); public: + typedef std::map preset_map_t; typedef boost::signals2::signal 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 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; }; -- cgit v1.2.3 From 23d8fb9750afc158d97fdf51633ed59b1b36f223 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 10 Jun 2011 21:21:04 +0300 Subject: STORM-1305 WIP User water presets now go first in all lists. Besides, removed all cases of direct access to the water presets map in preparation for future lazy loading. --- indra/newview/llwaterparammanager.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llwaterparammanager.h') diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index 9325faa021..dc7d41be2a 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -27,7 +27,7 @@ #ifndef LL_WATER_PARAMMANAGER_H #define LL_WATER_PARAMMANAGER_H -#include +#include #include #include "llwaterparamset.h" #include "llviewercamera.h" @@ -216,6 +216,7 @@ class LLWaterParamManager : public LLSingleton { LOG_CLASS(LLWaterParamManager); public: + typedef std::list preset_name_list_t; typedef std::map preset_map_t; typedef boost::signals2::signal preset_list_signal_t; @@ -257,11 +258,20 @@ public: bool removeParamSet(const std::string& name, bool delete_from_disk); /// @return true if the preset comes out of the box - bool isSystemPreset(const std::string& preset_name); + bool isSystemPreset(const std::string& preset_name) const; /// @return all named water presets. const preset_map_t& getPresets() const { return mParamList; } + /// @return user and system preset names as a single list + void getPresetNames(preset_name_list_t& presets) const; + + /// @return user and system preset names separately + void getPresetNames(preset_name_list_t& user_presets, preset_name_list_t& system_presets) const; + + /// @return list of user presets names + void getUserPresetNames(preset_name_list_t& user_presets) const; + /// Emitted when a preset gets added or deleted. boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); -- cgit v1.2.3