diff options
Diffstat (limited to 'linden/indra/newview/llwlparammanager.h')
-rw-r--r-- | linden/indra/newview/llwlparammanager.h | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/linden/indra/newview/llwlparammanager.h b/linden/indra/newview/llwlparammanager.h index fc1127e..034b2e6 100644 --- a/linden/indra/newview/llwlparammanager.h +++ b/linden/indra/newview/llwlparammanager.h | |||
@@ -3,9 +3,9 @@ | |||
3 | * @brief Implementation for the LLWLParamManager class. | 3 | * @brief Implementation for the LLWLParamManager class. |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
11 | * to you under the terms of the GNU General Public License, version 2.0 | 11 | * to you under the terms of the GNU General Public License, version 2.0 |
@@ -13,17 +13,17 @@ | |||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | 21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception |
22 | * | 22 | * |
23 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
24 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
25 | * and agree to abide by those obligations. | 25 | * and agree to abide by those obligations. |
26 | * | 26 | * |
27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
@@ -36,6 +36,7 @@ | |||
36 | #include <vector> | 36 | #include <vector> |
37 | #include <map> | 37 | #include <map> |
38 | #include "llwlparamset.h" | 38 | #include "llwlparamset.h" |
39 | #include "llwaterparamset.h" | ||
39 | #include "llwlanimator.h" | 40 | #include "llwlanimator.h" |
40 | #include "llwldaycycle.h" | 41 | #include "llwldaycycle.h" |
41 | #include "llviewercamera.h" | 42 | #include "llviewercamera.h" |
@@ -51,10 +52,10 @@ public: | |||
51 | virtual ~LLWLPresetsObserver() { }; | 52 | virtual ~LLWLPresetsObserver() { }; |
52 | virtual void changed() = 0; | 53 | virtual void changed() = 0; |
53 | }; | 54 | }; |
54 | 55 | ||
55 | // color control | 56 | // color control |
56 | struct WLColorControl { | 57 | struct WLColorControl { |
57 | 58 | ||
58 | F32 r, g, b, i; /// the values | 59 | F32 r, g, b, i; /// the values |
59 | std::string mName; /// name to use to dereference params | 60 | std::string mName; /// name to use to dereference params |
60 | std::string mSliderName; /// name of the slider in menu | 61 | std::string mSliderName; /// name of the slider in menu |
@@ -88,7 +89,7 @@ struct WLColorControl { | |||
88 | r = val.mV[0]; | 89 | r = val.mV[0]; |
89 | g = val.mV[1]; | 90 | g = val.mV[1]; |
90 | b = val.mV[2]; | 91 | b = val.mV[2]; |
91 | i = val.mV[3]; | 92 | i = val.mV[3]; |
92 | return *this; | 93 | return *this; |
93 | } | 94 | } |
94 | 95 | ||
@@ -131,6 +132,7 @@ struct WLFloatControl { | |||
131 | } | 132 | } |
132 | }; | 133 | }; |
133 | 134 | ||
135 | |||
134 | /// WindLight parameter manager class - what controls all the wind light shaders | 136 | /// WindLight parameter manager class - what controls all the wind light shaders |
135 | class LLWLParamManager | 137 | class LLWLParamManager |
136 | { | 138 | { |
@@ -151,19 +153,19 @@ public: | |||
151 | /// load an individual preset into the sky from an LLSD stream | 153 | /// load an individual preset into the sky from an LLSD stream |
152 | /// Returns whether the stream was actually reasonable XML to load from. | 154 | /// Returns whether the stream was actually reasonable XML to load from. |
153 | bool loadPresetXML(const std::string& name, std::istream& preset_stream, bool propogate=false, bool check_if_real=false); | 155 | bool loadPresetXML(const std::string& name, std::istream& preset_stream, bool propogate=false, bool check_if_real=false); |
154 | 156 | ||
155 | /// Load an individual preset from a notecard. | 157 | /// Load an individual preset from a notecard. |
156 | void loadPresetNotecard(const std::string& name, const LLUUID& asset_id, const LLUUID& inv_id); | 158 | void loadPresetNotecard(const std::string& name, const LLUUID& asset_id, const LLUUID& inv_id); |
157 | 159 | ||
158 | /// save the parameter presets to file | 160 | /// save the parameter presets to file |
159 | void savePreset(const std::string & name); | 161 | void savePreset(const std::string & name); |
160 | 162 | ||
161 | /// save the parameter presets to file | 163 | /// save the parameter presets to file |
162 | bool savePresetToNotecard(const std::string & name); | 164 | bool savePresetToNotecard(const std::string & name); |
163 | 165 | ||
164 | /// Set shader uniforms dirty, so they'll update automatically. | 166 | /// Set shader uniforms dirty, so they'll update automatically. |
165 | void propagateParameters(void); | 167 | void propagateParameters(void); |
166 | 168 | ||
167 | /// Update shader uniforms that have changed. | 169 | /// Update shader uniforms that have changed. |
168 | void updateShaderUniforms(LLGLSLShader * shader); | 170 | void updateShaderUniforms(LLGLSLShader * shader); |
169 | 171 | ||
@@ -181,7 +183,7 @@ public: | |||
181 | 183 | ||
182 | // get where the light is pointing | 184 | // get where the light is pointing |
183 | inline LLVector4 getRotatedLightDir(void) const; | 185 | inline LLVector4 getRotatedLightDir(void) const; |
184 | 186 | ||
185 | /// get the dome's offset | 187 | /// get the dome's offset |
186 | inline F32 getDomeOffset(void) const; | 188 | inline F32 getDomeOffset(void) const; |
187 | 189 | ||
@@ -193,7 +195,7 @@ public: | |||
193 | 195 | ||
194 | // Cleanup of global data that's only inited once per class. | 196 | // Cleanup of global data that's only inited once per class. |
195 | static void cleanupClass(); | 197 | static void cleanupClass(); |
196 | 198 | ||
197 | /// add a param to the list | 199 | /// add a param to the list |
198 | bool addParamSet(const std::string& name, LLWLParamSet& param); | 200 | bool addParamSet(const std::string& name, LLWLParamSet& param); |
199 | 201 | ||
@@ -205,9 +207,9 @@ public: | |||
205 | 207 | ||
206 | /// set the param in the list with a new param | 208 | /// set the param in the list with a new param |
207 | bool setParamSet(const std::string& name, LLWLParamSet& param); | 209 | bool setParamSet(const std::string& name, LLWLParamSet& param); |
208 | 210 | ||
209 | /// set the param in the list with a new param | 211 | /// set the param in the list with a new param |
210 | bool setParamSet(const std::string& name, LLSD const & param); | 212 | bool setParamSet(const std::string& name, LLSD const & param); |
211 | 213 | ||
212 | /// gets rid of a parameter and any references to it | 214 | /// gets rid of a parameter and any references to it |
213 | /// returns true if successful | 215 | /// returns true if successful |
@@ -223,6 +225,11 @@ public: | |||
223 | 225 | ||
224 | void SetMixTime(LLWLParamSet* mixSet, F32 mixTime); | 226 | void SetMixTime(LLWLParamSet* mixSet, F32 mixTime); |
225 | 227 | ||
228 | // Notecard settings checkers. | ||
229 | static bool isWaterSettingsNotecard(std::string name); | ||
230 | static bool isSkySettingsNotecard(std::string name); | ||
231 | static bool isSettingsNotecard(std::string name); | ||
232 | |||
226 | public: | 233 | public: |
227 | 234 | ||
228 | // helper variables | 235 | // helper variables |
@@ -249,7 +256,7 @@ public: | |||
249 | WLFloatControl mWLGamma; | 256 | WLFloatControl mWLGamma; |
250 | 257 | ||
251 | F32 mSceneLightStrength; | 258 | F32 mSceneLightStrength; |
252 | 259 | ||
253 | /// Atmospherics | 260 | /// Atmospherics |
254 | WLColorControl mBlueHorizon; | 261 | WLColorControl mBlueHorizon; |
255 | WLColorControl mHazeDensity; | 262 | WLColorControl mHazeDensity; |
@@ -275,10 +282,10 @@ public: | |||
275 | /// sky dome | 282 | /// sky dome |
276 | F32 mDomeOffset; | 283 | F32 mDomeOffset; |
277 | F32 mDomeRadius; | 284 | F32 mDomeRadius; |
278 | 285 | ||
279 | // list of all the parameters, listed by name | 286 | // list of all the parameters, listed by name |
280 | std::map<std::string, LLWLParamSet> mParamList; | 287 | std::map<std::string, LLWLParamSet> mParamList; |
281 | 288 | ||
282 | private: | 289 | private: |
283 | // our parameter manager singleton instance | 290 | // our parameter manager singleton instance |
284 | static LLWLParamManager * sInstance; | 291 | static LLWLParamManager * sInstance; |
@@ -287,11 +294,10 @@ private: | |||
287 | LLWLParamSet* sMixSet; | 294 | LLWLParamSet* sMixSet; |
288 | F32 sMixTime; | 295 | F32 sMixTime; |
289 | F32 sMixCount; | 296 | F32 sMixCount; |
290 | 297 | ||
291 | static std::vector<LLWLPresetsObserver*> sObservers; | 298 | static std::vector<LLWLPresetsObserver*> sObservers; |
292 | 299 | ||
293 | static void loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id, LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status); | 300 | static void loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id, LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status); |
294 | |||
295 | }; | 301 | }; |
296 | 302 | ||
297 | inline F32 LLWLParamManager::getDomeOffset(void) const | 303 | inline F32 LLWLParamManager::getDomeOffset(void) const |