aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-04-01 00:27:34 +1000
committerDavid Walter Seikel2012-04-01 00:27:34 +1000
commitb8d7bea60bc3858f3298996315429319dcc9873f (patch)
tree096678d60ad0b90ddf49c8ef6e4999c63be975e6 /linden
parentRemove some left over WindLight cruft. (diff)
downloadmeta-impy-b8d7bea60bc3858f3298996315429319dcc9873f.zip
meta-impy-b8d7bea60bc3858f3298996315429319dcc9873f.tar.gz
meta-impy-b8d7bea60bc3858f3298996315429319dcc9873f.tar.bz2
meta-impy-b8d7bea60bc3858f3298996315429319dcc9873f.tar.xz
More automated whitespace fixes.
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/llwlparammanager.cpp110
-rw-r--r--linden/indra/newview/llwlparammanager.h42
2 files changed, 76 insertions, 76 deletions
diff --git a/linden/indra/newview/llwlparammanager.cpp b/linden/indra/newview/llwlparammanager.cpp
index 8007cce..010aa3d 100644
--- a/linden/indra/newview/llwlparammanager.cpp
+++ b/linden/indra/newview/llwlparammanager.cpp
@@ -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.
@@ -124,9 +124,9 @@ void LLWLParamManager::loadPresets(const std::string& file_name)
124{ 124{
125 std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", "")); 125 std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", ""));
126 LL_DEBUGS2("AppInit", "ShaderLoading") << "Loading Default WindLight settings from " << path_name << LL_ENDL; 126 LL_DEBUGS2("AppInit", "ShaderLoading") << "Loading Default WindLight settings from " << path_name << LL_ENDL;
127 127
128 bool found = true; 128 bool found = true;
129 while(found) 129 while(found)
130 { 130 {
131 std::string name; 131 std::string name;
132 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false); 132 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false);
@@ -150,9 +150,9 @@ void LLWLParamManager::loadPresets(const std::string& file_name)
150 150
151 std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); 151 std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", ""));
152 LL_INFOS2("AppInit", "Shaders") << "Loading User WindLight settings from " << path_name2 << LL_ENDL; 152 LL_INFOS2("AppInit", "Shaders") << "Loading User WindLight settings from " << path_name2 << LL_ENDL;
153 153
154 found = true; 154 found = true;
155 while(found) 155 while(found)
156 { 156 {
157 std::string name; 157 std::string name;
158 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false); 158 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false);
@@ -176,14 +176,14 @@ void LLWLParamManager::loadPresets(const std::string& file_name)
176bool LLWLParamManager::loadPresetXML(const std::string& name, std::istream& preset_stream, bool propagate /* = false */, bool check_if_real /* = false */) 176bool LLWLParamManager::loadPresetXML(const std::string& name, std::istream& preset_stream, bool propagate /* = false */, bool check_if_real /* = false */)
177{ 177{
178 LLSD paramsData(LLSD::emptyMap()); 178 LLSD paramsData(LLSD::emptyMap());
179 179
180 LLPointer<LLSDParser> parser = new LLSDXMLParser(); 180 LLPointer<LLSDParser> parser = new LLSDXMLParser();
181 181
182 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) 182 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
183 { 183 {
184 return false; 184 return false;
185 } 185 }
186 186
187 if(check_if_real) 187 if(check_if_real)
188 { 188 {
189 static const char* expected_windlight_settings[] = { 189 static const char* expected_windlight_settings[] = {
@@ -220,13 +220,13 @@ bool LLWLParamManager::loadPresetXML(const std::string& name, std::istream& pres
220 } 220 }
221 } 221 }
222 } 222 }
223 223
224 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 224 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
225 if(mIt == mParamList.end()) 225 if(mIt == mParamList.end())
226 { 226 {
227 addParamSet(name, paramsData); 227 addParamSet(name, paramsData);
228 } 228 }
229 else 229 else
230 { 230 {
231 setParamSet(name, paramsData); 231 setParamSet(name, paramsData);
232 } 232 }
@@ -258,12 +258,12 @@ void LLWLParamManager::savePresets(const std::string & fileName)
258 //and not over the RO system wide version. 258 //and not over the RO system wide version.
259 259
260 LLSD paramsData(LLSD::emptyMap()); 260 LLSD paramsData(LLSD::emptyMap());
261 261
262 std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName)); 262 std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName));
263 263
264 for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin(); 264 for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin();
265 mIt != mParamList.end(); 265 mIt != mParamList.end();
266 ++mIt) 266 ++mIt)
267 { 267 {
268 paramsData[mIt->first] = mIt->second.getAll(); 268 paramsData[mIt->first] = mIt->second.getAll();
269 } 269 }
@@ -295,7 +295,7 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
295 // Write it to a notecard 295 // Write it to a notecard
296 LLNotecard notecard; 296 LLNotecard notecard;
297 notecard.setText(presetsXML.str()); 297 notecard.setText(presetsXML.str());
298 298
299 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID); 299 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID);
300 if(!item) 300 if(!item)
301 { 301 {
@@ -309,13 +309,13 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
309 LLAssetID asset_id; 309 LLAssetID asset_id;
310 tid.generate(); 310 tid.generate();
311 asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); 311 asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
312 312
313 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND); 313 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND);
314 314
315 std::ostringstream stream; 315 std::ostringstream stream;
316 notecard.exportStream(stream); 316 notecard.exportStream(stream);
317 std::string buffer = stream.str(); 317 std::string buffer = stream.str();
318 318
319 S32 size = buffer.length() + 1; 319 S32 size = buffer.length() + 1;
320 file.setMaxSize(size); 320 file.setMaxSize(size);
321 file.write((U8*)buffer.c_str(), size); 321 file.write((U8*)buffer.c_str(), size);
@@ -328,7 +328,7 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
328 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL; 328 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL;
329 return false; 329 return false;
330 } 330 }
331 331
332 propagateParameters(); 332 propagateParameters();
333 return true; 333 return true;
334} 334}
@@ -355,7 +355,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
355 escaped_filename += ".xml"; 355 escaped_filename += ".xml";
356 356
357 std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename)); 357 std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename));
358 LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL; 358 LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL;
359 359
360 llifstream presetsXML; 360 llifstream presetsXML;
361 presetsXML.open(pathName.c_str()); 361 presetsXML.open(pathName.c_str());
@@ -364,7 +364,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
364 if(!presetsXML) 364 if(!presetsXML)
365 { 365 {
366 pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename); 366 pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename);
367 LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL; 367 LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL;
368 presetsXML.open(pathName.c_str()); 368 presetsXML.open(pathName.c_str());
369 } 369 }
370 370
@@ -372,14 +372,14 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
372 { 372 {
373 loadPresetXML(name, presetsXML); 373 loadPresetXML(name, presetsXML);
374 presetsXML.close(); 374 presetsXML.close();
375 } 375 }
376 else 376 else
377 { 377 {
378 llwarns << "Can't find " << name << llendl; 378 llwarns << "Can't find " << name << llendl;
379 return; 379 return;
380 } 380 }
381 381
382 382
383 if(propagate) 383 if(propagate)
384 { 384 {
385 getParamSet(name, mCurParams); 385 getParamSet(name, mCurParams);
@@ -387,7 +387,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
387 } 387 }
388 388
389 notifyObservers(); 389 notifyObservers();
390} 390}
391 391
392void LLWLParamManager::savePreset(const std::string & name) 392void LLWLParamManager::savePreset(const std::string & name)
393{ 393{
@@ -427,7 +427,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader)
427 { 427 {
428 shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); 428 shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV);
429 shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); 429 shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV);
430 } 430 }
431 431
432 else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) 432 else if (shader->mShaderGroup == LLGLSLShader::SG_SKY)
433 { 433 {
@@ -435,13 +435,13 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader)
435 } 435 }
436 436
437 shader->uniform1f("scene_light_strength", mSceneLightStrength); 437 shader->uniform1f("scene_light_strength", mSceneLightStrength);
438 438
439} 439}
440 440
441void LLWLParamManager::propagateParameters(void) 441void LLWLParamManager::propagateParameters(void)
442{ 442{
443 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); 443 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM);
444 444
445 LLVector4 sunDir; 445 LLVector4 sunDir;
446 LLVector4 moonDir; 446 LLVector4 moonDir;
447 447
@@ -491,7 +491,7 @@ void LLWLParamManager::propagateParameters(void)
491 // bind the variables for all shaders only if we're using WindLight 491 // bind the variables for all shaders only if we're using WindLight
492 LLViewerShaderMgr::shader_iter shaders_iter, end_shaders; 492 LLViewerShaderMgr::shader_iter shaders_iter, end_shaders;
493 end_shaders = LLViewerShaderMgr::instance()->endShaders(); 493 end_shaders = LLViewerShaderMgr::instance()->endShaders();
494 for(shaders_iter = LLViewerShaderMgr::instance()->beginShaders(); shaders_iter != end_shaders; ++shaders_iter) 494 for(shaders_iter = LLViewerShaderMgr::instance()->beginShaders(); shaders_iter != end_shaders; ++shaders_iter)
495 { 495 {
496 if (shaders_iter->mProgramObject != 0 496 if (shaders_iter->mProgramObject != 0
497 && (gPipeline.canUseWindLightShaders() 497 && (gPipeline.canUseWindLightShaders()
@@ -512,29 +512,29 @@ void LLWLParamManager::propagateParameters(void)
512void LLWLParamManager::update(LLViewerCamera * cam) 512void LLWLParamManager::update(LLViewerCamera * cam)
513{ 513{
514 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); 514 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM);
515 515
516 // update clouds, sun, and general 516 // update clouds, sun, and general
517 mCurParams.updateCloudScrolling(); 517 mCurParams.updateCloudScrolling();
518 518
519 // update only if running 519 // update only if running
520 if(mAnimator.mIsRunning) 520 if(mAnimator.mIsRunning)
521 { 521 {
522 mAnimator.update(mCurParams); 522 mAnimator.update(mCurParams);
523 } 523 }
524 524
525 // update the shaders and the menu 525 // update the shaders and the menu
526 propagateParameters(); 526 propagateParameters();
527 527
528 // sync menus if they exist 528 // sync menus if they exist
529 if(LLFloaterWindLight::isOpen()) 529 if(LLFloaterWindLight::isOpen())
530 { 530 {
531 LLFloaterWindLight::instance()->syncMenu(); 531 LLFloaterWindLight::instance()->syncMenu();
532 } 532 }
533 if(LLFloaterDayCycle::isOpen()) 533 if(LLFloaterDayCycle::isOpen())
534 { 534 {
535 LLFloaterDayCycle::instance()->syncMenu(); 535 LLFloaterDayCycle::instance()->syncMenu();
536 } 536 }
537 if(LLFloaterEnvSettings::isOpen()) 537 if(LLFloaterEnvSettings::isOpen())
538 { 538 {
539 LLFloaterEnvSettings::instance()->syncMenu(); 539 LLFloaterEnvSettings::instance()->syncMenu();
540 } 540 }
@@ -547,8 +547,8 @@ void LLWLParamManager::update(LLViewerCamera * cam)
547 // executed some of the time. For example for water shaders only. 547 // executed some of the time. For example for water shaders only.
548 { 548 {
549 F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD; 549 F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD;
550 550
551 LLVector3 lightNorm3(mLightDir); 551 LLVector3 lightNorm3(mLightDir);
552 lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f)); 552 lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f));
553 mRotatedLightDir = LLVector4(lightNorm3, 0.f); 553 mRotatedLightDir = LLVector4(lightNorm3, 0.f);
554 554
@@ -621,7 +621,7 @@ void LLWLParamManager::cleanupClass()
621 621
622void LLWLParamManager::resetAnimator(F32 curTime, bool run) 622void LLWLParamManager::resetAnimator(F32 curTime, bool run)
623{ 623{
624 mAnimator.setTrack(mDay.mTimeMap, mDay.mDayRate, 624 mAnimator.setTrack(mDay.mTimeMap, mDay.mDayRate,
625 curTime, run); 625 curTime, run);
626 626
627 return; 627 return;
@@ -630,8 +630,8 @@ bool LLWLParamManager::addParamSet(const std::string& name, LLWLParamSet& param)
630{ 630{
631 // add a new one if not one there already 631 // add a new one if not one there already
632 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 632 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
633 if(mIt == mParamList.end()) 633 if(mIt == mParamList.end())
634 { 634 {
635 mParamList[name] = param; 635 mParamList[name] = param;
636 return true; 636 return true;
637 } 637 }
@@ -658,7 +658,7 @@ bool LLWLParamManager::getParamSet(const std::string& name, LLWLParamSet& param)
658{ 658{
659 // find it and set it 659 // find it and set it
660 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 660 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
661 if(mIt != mParamList.end()) 661 if(mIt != mParamList.end())
662 { 662 {
663 param = mParamList[name]; 663 param = mParamList[name];
664 param.mName = name; 664 param.mName = name;
@@ -678,11 +678,11 @@ bool LLWLParamManager::setParamSet(const std::string& name, LLWLParamSet& param)
678bool LLWLParamManager::setParamSet(const std::string& name, const LLSD & param) 678bool LLWLParamManager::setParamSet(const std::string& name, const LLSD & param)
679{ 679{
680 // quick, non robust (we won't be working with files, but assets) check 680 // quick, non robust (we won't be working with files, but assets) check
681 if(!param.isMap()) 681 if(!param.isMap())
682 { 682 {
683 return false; 683 return false;
684 } 684 }
685 685
686 mParamList[name].setAll(param); 686 mParamList[name].setAll(param);
687 687
688 return true; 688 return true;
@@ -692,7 +692,7 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
692{ 692{
693 // remove from param list 693 // remove from param list
694 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 694 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
695 if(mIt != mParamList.end()) 695 if(mIt != mParamList.end())
696 { 696 {
697 mParamList.erase(mIt); 697 mParamList.erase(mIt);
698 } 698 }
@@ -701,11 +701,11 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
701 701
702 // remove all references 702 // remove all references
703 bool stat = true; 703 bool stat = true;
704 do 704 do
705 { 705 {
706 // get it 706 // get it
707 stat = mDay.getKey(name, key); 707 stat = mDay.getKey(name, key);
708 if(stat == false) 708 if(stat == false)
709 { 709 {
710 break; 710 break;
711 } 711 }
@@ -714,17 +714,17 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
714 stat = mDay.removeKey(key); 714 stat = mDay.removeKey(key);
715 715
716 } while(stat == true); 716 } while(stat == true);
717 717
718 if(delete_from_disk) 718 if(delete_from_disk)
719 { 719 {
720 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); 720 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", ""));
721 721
722 // use full curl escaped name 722 // use full curl escaped name
723 char * curl_str = curl_escape(name.c_str(), name.size()); 723 char * curl_str = curl_escape(name.c_str(), name.size());
724 std::string escaped_name(curl_str); 724 std::string escaped_name(curl_str);
725 curl_free(curl_str); 725 curl_free(curl_str);
726 curl_str = NULL; 726 curl_str = NULL;
727 727
728 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml"); 728 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml");
729 } 729 }
730 730
@@ -797,7 +797,7 @@ void LLWLParamManager::loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id,
797 } 797 }
798 else 798 else
799 { 799 {
800 // We can do this because we know mCurParams 800 // We can do this because we know mCurParams
801 sInstance->mParamList[name].mInventoryID = inventory_id; 801 sInstance->mParamList[name].mInventoryID = inventory_id;
802 } 802 }
803 } 803 }
diff --git a/linden/indra/newview/llwlparammanager.h b/linden/indra/newview/llwlparammanager.h
index fc1127e..0f7b84a 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.
@@ -51,10 +51,10 @@ public:
51 virtual ~LLWLPresetsObserver() { }; 51 virtual ~LLWLPresetsObserver() { };
52 virtual void changed() = 0; 52 virtual void changed() = 0;
53}; 53};
54 54
55// color control 55// color control
56struct WLColorControl { 56struct WLColorControl {
57 57
58 F32 r, g, b, i; /// the values 58 F32 r, g, b, i; /// the values
59 std::string mName; /// name to use to dereference params 59 std::string mName; /// name to use to dereference params
60 std::string mSliderName; /// name of the slider in menu 60 std::string mSliderName; /// name of the slider in menu
@@ -88,7 +88,7 @@ struct WLColorControl {
88 r = val.mV[0]; 88 r = val.mV[0];
89 g = val.mV[1]; 89 g = val.mV[1];
90 b = val.mV[2]; 90 b = val.mV[2];
91 i = val.mV[3]; 91 i = val.mV[3];
92 return *this; 92 return *this;
93 } 93 }
94 94
@@ -151,19 +151,19 @@ public:
151 /// load an individual preset into the sky from an LLSD stream 151 /// load an individual preset into the sky from an LLSD stream
152 /// Returns whether the stream was actually reasonable XML to load from. 152 /// 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); 153 bool loadPresetXML(const std::string& name, std::istream& preset_stream, bool propogate=false, bool check_if_real=false);
154 154
155 /// Load an individual preset from a notecard. 155 /// Load an individual preset from a notecard.
156 void loadPresetNotecard(const std::string& name, const LLUUID& asset_id, const LLUUID& inv_id); 156 void loadPresetNotecard(const std::string& name, const LLUUID& asset_id, const LLUUID& inv_id);
157 157
158 /// save the parameter presets to file 158 /// save the parameter presets to file
159 void savePreset(const std::string & name); 159 void savePreset(const std::string & name);
160 160
161 /// save the parameter presets to file 161 /// save the parameter presets to file
162 bool savePresetToNotecard(const std::string & name); 162 bool savePresetToNotecard(const std::string & name);
163 163
164 /// Set shader uniforms dirty, so they'll update automatically. 164 /// Set shader uniforms dirty, so they'll update automatically.
165 void propagateParameters(void); 165 void propagateParameters(void);
166 166
167 /// Update shader uniforms that have changed. 167 /// Update shader uniforms that have changed.
168 void updateShaderUniforms(LLGLSLShader * shader); 168 void updateShaderUniforms(LLGLSLShader * shader);
169 169
@@ -181,7 +181,7 @@ public:
181 181
182 // get where the light is pointing 182 // get where the light is pointing
183 inline LLVector4 getRotatedLightDir(void) const; 183 inline LLVector4 getRotatedLightDir(void) const;
184 184
185 /// get the dome's offset 185 /// get the dome's offset
186 inline F32 getDomeOffset(void) const; 186 inline F32 getDomeOffset(void) const;
187 187
@@ -193,7 +193,7 @@ public:
193 193
194 // Cleanup of global data that's only inited once per class. 194 // Cleanup of global data that's only inited once per class.
195 static void cleanupClass(); 195 static void cleanupClass();
196 196
197 /// add a param to the list 197 /// add a param to the list
198 bool addParamSet(const std::string& name, LLWLParamSet& param); 198 bool addParamSet(const std::string& name, LLWLParamSet& param);
199 199
@@ -205,9 +205,9 @@ public:
205 205
206 /// set the param in the list with a new param 206 /// set the param in the list with a new param
207 bool setParamSet(const std::string& name, LLWLParamSet& param); 207 bool setParamSet(const std::string& name, LLWLParamSet& param);
208 208
209 /// set the param in the list with a new param 209 /// set the param in the list with a new param
210 bool setParamSet(const std::string& name, LLSD const & param); 210 bool setParamSet(const std::string& name, LLSD const & param);
211 211
212 /// gets rid of a parameter and any references to it 212 /// gets rid of a parameter and any references to it
213 /// returns true if successful 213 /// returns true if successful
@@ -249,7 +249,7 @@ public:
249 WLFloatControl mWLGamma; 249 WLFloatControl mWLGamma;
250 250
251 F32 mSceneLightStrength; 251 F32 mSceneLightStrength;
252 252
253 /// Atmospherics 253 /// Atmospherics
254 WLColorControl mBlueHorizon; 254 WLColorControl mBlueHorizon;
255 WLColorControl mHazeDensity; 255 WLColorControl mHazeDensity;
@@ -275,10 +275,10 @@ public:
275 /// sky dome 275 /// sky dome
276 F32 mDomeOffset; 276 F32 mDomeOffset;
277 F32 mDomeRadius; 277 F32 mDomeRadius;
278 278
279 // list of all the parameters, listed by name 279 // list of all the parameters, listed by name
280 std::map<std::string, LLWLParamSet> mParamList; 280 std::map<std::string, LLWLParamSet> mParamList;
281 281
282private: 282private:
283 // our parameter manager singleton instance 283 // our parameter manager singleton instance
284 static LLWLParamManager * sInstance; 284 static LLWLParamManager * sInstance;
@@ -287,7 +287,7 @@ private:
287 LLWLParamSet* sMixSet; 287 LLWLParamSet* sMixSet;
288 F32 sMixTime; 288 F32 sMixTime;
289 F32 sMixCount; 289 F32 sMixCount;
290 290
291 static std::vector<LLWLPresetsObserver*> sObservers; 291 static std::vector<LLWLPresetsObserver*> sObservers;
292 292
293 static void loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id, LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status); 293 static void loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id, LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status);