diff options
author | RevolutionSmythe | 2010-10-20 16:31:09 -0500 |
---|---|---|
committer | McCabe Maxsted | 2010-11-01 16:58:02 -0700 |
commit | af6877fbfe94e80948c559cf77f008049f8168dc (patch) | |
tree | 4fe687aaec6a1b964a0e989d3c03c143b4ab07f6 /linden/indra/newview/llwaterparamset.cpp | |
parent | Merge remote branch 'thickbrick/weekly' into weekly (diff) | |
download | meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.zip meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.gz meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.bz2 meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.xz |
Finishes the OpenRegionSettings module, adds a new panel to Region/Estate for OpenRegionSettings, adds the new CAPS based WindLight Settings module, cleans up a few UI parts, and rebuilds the ToS window to support OpenSim regions better.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llwaterparamset.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/linden/indra/newview/llwaterparamset.cpp b/linden/indra/newview/llwaterparamset.cpp index a26cced..4b2e426 100644 --- a/linden/indra/newview/llwaterparamset.cpp +++ b/linden/indra/newview/llwaterparamset.cpp | |||
@@ -229,4 +229,96 @@ F32 LLWaterParamSet::getFloat(const std::string& paramName, bool& error) | |||
229 | error = true; | 229 | error = true; |
230 | return 0; | 230 | return 0; |
231 | } | 231 | } |
232 | void LLWaterParamSet::mix(LLWaterParamSet& src, LLWaterParamSet& dest, F32 weight) | ||
233 | { | ||
234 | // set up the iterators | ||
235 | LLSD::map_iterator cIt = mParamValues.beginMap(); | ||
236 | |||
237 | LLSD srcVal; | ||
238 | LLSD destVal; | ||
239 | |||
240 | // do the interpolation for all the ones saved as vectors | ||
241 | // skip the weird ones | ||
242 | for(; cIt != mParamValues.endMap(); cIt++) { | ||
243 | |||
244 | // check params to make sure they're actually there | ||
245 | if(src.mParamValues.has(cIt->first)) | ||
246 | { | ||
247 | srcVal = src.mParamValues[cIt->first]; | ||
248 | } | ||
249 | else | ||
250 | { | ||
251 | continue; | ||
252 | } | ||
253 | |||
254 | if(dest.mParamValues.has(cIt->first)) | ||
255 | { | ||
256 | destVal = dest.mParamValues[cIt->first]; | ||
257 | } | ||
258 | else | ||
259 | { | ||
260 | continue; | ||
261 | } | ||
262 | |||
263 | // skip if not a vector | ||
264 | if(!cIt->second.isArray()) | ||
265 | { | ||
266 | continue; | ||
267 | } | ||
268 | |||
269 | // only Real vectors allowed | ||
270 | if(!cIt->second[0].isReal()) | ||
271 | { | ||
272 | continue; | ||
273 | } | ||
274 | |||
275 | // make sure all the same size | ||
276 | if( cIt->second.size() != srcVal.size() || | ||
277 | cIt->second.size() != destVal.size()) | ||
278 | { | ||
279 | continue; | ||
280 | } | ||
281 | |||
282 | // more error checking might be necessary; | ||
283 | |||
284 | for(int i=0; i < cIt->second.size(); ++i) | ||
285 | { | ||
286 | cIt->second[i] = (1.0f - weight) * (F32) srcVal[i].asReal() + | ||
287 | weight * (F32) destVal[i].asReal(); | ||
288 | } | ||
289 | } | ||
290 | mParamValues["waterFogColor"][0] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][0].asReal() | ||
291 | + weight * (F32) dest.mParamValues["waterFogColor"][0].asReal(); | ||
292 | mParamValues["waterFogColor"][1] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][1].asReal() | ||
293 | + weight * (F32) dest.mParamValues["waterFogColor"][1].asReal(); | ||
294 | mParamValues["waterFogColor"][2] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][2].asReal() | ||
295 | + weight * (F32) dest.mParamValues["waterFogColor"][2].asReal(); | ||
296 | mParamValues["waterFogColor"][3] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][3].asReal() | ||
297 | + weight * (F32) dest.mParamValues["waterFogColor"][3].asReal(); | ||
298 | |||
299 | mParamValues["waterFogDensity"] = (1 - weight) * (F32) src.mParamValues["waterFogDensity"].asReal() | ||
300 | + weight * (F32) dest.mParamValues["waterFogDensity"].asReal(); | ||
301 | mParamValues["underWaterFogMod"] = (1 - weight) * (F32) src.mParamValues["underWaterFogMod"].asReal() | ||
302 | + weight * (F32) dest.mParamValues["underWaterFogMod"].asReal(); | ||
303 | mParamValues["fresnelScale"] = (1 - weight) * (F32) src.mParamValues["fresnelScale"].asReal() | ||
304 | + weight * (F32) dest.mParamValues["fresnelScale"].asReal(); | ||
305 | mParamValues["fresnelOffset"] = (1 - weight) * (F32) src.mParamValues["fresnelOffset"].asReal() | ||
306 | + weight * (F32) dest.mParamValues["fresnelOffset"].asReal(); | ||
307 | mParamValues["scaleAbove"] = (1 - weight) * (F32) src.mParamValues["scaleAbove"].asReal() | ||
308 | + weight * (F32) dest.mParamValues["scaleAbove"].asReal(); | ||
309 | mParamValues["scaleBelow"] = (1 - weight) * (F32) src.mParamValues["scaleBelow"].asReal() | ||
310 | + weight * (F32) dest.mParamValues["scaleBelow"].asReal(); | ||
311 | mParamValues["blurMultiplier"] = (1 - weight) * (F32) src.mParamValues["blurMultiplier"].asReal() | ||
312 | + weight * (F32) dest.mParamValues["blurMultiplier"].asReal(); | ||
313 | |||
314 | mParamValues["wave2Dir"][0] = (1 - weight) * (F32) src.mParamValues["wave2Dir"][0].asReal() | ||
315 | + weight * (F32) dest.mParamValues["wave2Dir"][0].asReal(); | ||
316 | mParamValues["wave2Dir"][1] = (1 - weight) * (F32) src.mParamValues["wave2Dir"][1].asReal() | ||
317 | + weight * (F32) dest.mParamValues["wave2Dir"][1].asReal(); | ||
318 | |||
319 | mParamValues["wave1Dir"][0] = (1 - weight) * (F32) src.mParamValues["wave1Dir"][0].asReal() | ||
320 | + weight * (F32) dest.mParamValues["wave1Dir"][0].asReal(); | ||
321 | mParamValues["wave1Dir"][1] = (1 - weight) * (F32) src.mParamValues["wave1Dir"][1].asReal() | ||
322 | + weight * (F32) dest.mParamValues["wave1Dir"][1].asReal(); | ||
323 | } | ||
232 | 324 | ||