diff options
Diffstat (limited to 'linden/indra/newview/rlvextensions.cpp')
-rw-r--r-- | linden/indra/newview/rlvextensions.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/linden/indra/newview/rlvextensions.cpp b/linden/indra/newview/rlvextensions.cpp index 6f79636..10d1c46 100644 --- a/linden/indra/newview/rlvextensions.cpp +++ b/linden/indra/newview/rlvextensions.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "llviewerprecompiledheaders.h" | 1 | #include "llviewerprecompiledheaders.h" |
2 | #include "llagent.h" | 2 | #include "llagent.h" |
3 | #include "llfloaterwindlight.h" | ||
3 | #include "llviewercontrol.h" | 4 | #include "llviewercontrol.h" |
4 | #include "llviewerwindow.h" | 5 | #include "llviewerwindow.h" |
5 | #include "llvoavatar.h" | 6 | #include "llvoavatar.h" |
@@ -221,8 +222,18 @@ void RlvExtGetSet::onSetDebug(std::string strSetting, const std::string& strValu | |||
221 | } | 222 | } |
222 | } | 223 | } |
223 | 224 | ||
225 | // Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c | ||
224 | std::string RlvExtGetSet::onGetEnv(std::string strSetting) | 226 | std::string RlvExtGetSet::onGetEnv(std::string strSetting) |
225 | { | 227 | { |
228 | // HACK: - create a LLFloaterWindLight instance if there isn't one already | ||
229 | // - isOpen() is actually instanceExists() | ||
230 | // - creating an instance results in showing the floater which is why we need to ->close() it | ||
231 | if (!LLFloaterWindLight::isOpen()) | ||
232 | { | ||
233 | LLFloaterWindLight::instance()->close(); | ||
234 | LLFloaterWindLight::instance()->syncMenu(); | ||
235 | } | ||
236 | |||
226 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 237 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); |
227 | 238 | ||
228 | F32 nValue = 0.0f; | 239 | F32 nValue = 0.0f; |
@@ -238,7 +249,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
238 | else if ("cloudscale" == strSetting) nValue = pWLParams->mCloudScale; | 249 | else if ("cloudscale" == strSetting) nValue = pWLParams->mCloudScale; |
239 | else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; | 250 | else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; |
240 | else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; | 251 | else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; |
241 | else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult * 1000; | 252 | else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult.x * pWLParams->mDensityMult.mult; |
242 | else if ("distancemultiplier" == strSetting) nValue = pWLParams->mDistanceMult; | 253 | else if ("distancemultiplier" == strSetting) nValue = pWLParams->mDistanceMult; |
243 | else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; | 254 | else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; |
244 | else if ("hazedensity" == strSetting) nValue = pWLParams->mHazeDensity.r; | 255 | else if ("hazedensity" == strSetting) nValue = pWLParams->mHazeDensity.r; |
@@ -260,7 +271,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
260 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) | 271 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) |
261 | { | 272 | { |
262 | WLColorControl* pColour = NULL; | 273 | WLColorControl* pColour = NULL; |
263 | strSetting.erase(strSetting.length() - 2, 1); | 274 | strSetting.erase(strSetting.length() - 1, 1); |
264 | 275 | ||
265 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; | 276 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; |
266 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; | 277 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; |
@@ -272,10 +283,10 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
272 | 283 | ||
273 | if (pColour) | 284 | if (pColour) |
274 | { | 285 | { |
275 | if ('r' == ch) nValue = pColour->b; | 286 | if ('r' == ch) nValue = pColour->r; |
276 | else if ('g' == ch) nValue = pColour->b; | 287 | else if ('g' == ch) nValue = pColour->g; |
277 | else if ('b' == ch) nValue = pColour->b; | 288 | else if ('b' == ch) nValue = pColour->b; |
278 | else if (('i' == ch) && (pColour->hasSliderName)) nValue = pColour->i; | 289 | else if (('i' == ch) && (pColour->hasSliderName)) nValue = llmax(pColour->r, pColour->g, pColour->b); |
279 | 290 | ||
280 | if (pColour->isBlueHorizonOrDensity) nValue /= 2.0f; | 291 | if (pColour->isBlueHorizonOrDensity) nValue /= 2.0f; |
281 | else if (pColour->isSunOrAmbientColor) nValue /= 3.0f; | 292 | else if (pColour->isSunOrAmbientColor) nValue /= 3.0f; |
@@ -286,8 +297,16 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
286 | return llformat("%f", nValue); | 297 | return llformat("%f", nValue); |
287 | } | 298 | } |
288 | 299 | ||
300 | // Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c | ||
289 | void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) | 301 | void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) |
290 | { | 302 | { |
303 | // HACK: see RlvExtGetSet::onGetEnv | ||
304 | if (!LLFloaterWindLight::isOpen()) | ||
305 | { | ||
306 | LLFloaterWindLight::instance()->close(); | ||
307 | LLFloaterWindLight::instance()->syncMenu(); | ||
308 | } | ||
309 | |||
291 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 310 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); |
292 | WLFloatControl* pFloat = NULL; | 311 | WLFloatControl* pFloat = NULL; |
293 | WLColorControl* pColour = NULL; | 312 | WLColorControl* pColour = NULL; |
@@ -405,7 +424,7 @@ void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) | |||
405 | 424 | ||
406 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) | 425 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) |
407 | { | 426 | { |
408 | strSetting.erase(strSetting.length() - 2, 1); | 427 | strSetting.erase(strSetting.length() - 1, 1); |
409 | 428 | ||
410 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; | 429 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; |
411 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; | 430 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; |