aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--linden/indra/lscript/lscript_library/lscript_library.cpp59
-rw-r--r--linden/indra/newview/CMakeLists.txt21
-rw-r--r--linden/indra/newview/llettherebelight.cpp (renamed from linden/indra/newview/lightshare.cpp)322
-rw-r--r--linden/indra/newview/llettherebelight.h (renamed from linden/indra/newview/lightshare.h)92
-rw-r--r--linden/indra/newview/llfloaterenvsettings.cpp15
-rw-r--r--linden/indra/newview/llfloaterwater.cpp103
-rw-r--r--linden/indra/newview/llfloaterwindlight.cpp2
-rw-r--r--linden/indra/newview/llinventorybridge.cpp28
-rw-r--r--linden/indra/newview/llinventorybridge.h3
-rw-r--r--linden/indra/newview/llpanelinventory.cpp26
-rw-r--r--linden/indra/newview/llviewergenericmessage.cpp22
-rw-r--r--linden/indra/newview/llviewermessage.cpp378
-rw-r--r--linden/indra/newview/llwaterparammanager.cpp111
-rw-r--r--linden/indra/newview/llwaterparamset.h4
-rw-r--r--linden/indra/newview/llwlparammanager.cpp135
-rw-r--r--linden/indra/newview/llwlparammanager.h50
-rw-r--r--linden/indra/newview/llwlparamset.h78
-rw-r--r--linden/indra/newview/windlightsettingsupdate.cpp200
-rw-r--r--linden/indra/newview/wlfloatermanager.cpp41
-rw-r--r--linden/indra/newview/wlretrievesettings.cpp19
-rw-r--r--linden/indra/newview/wlsettingsmanager.cpp253
-rw-r--r--linden/indra/newview/wlsettingsmanager.h90
22 files changed, 831 insertions, 1221 deletions
diff --git a/linden/indra/lscript/lscript_library/lscript_library.cpp b/linden/indra/lscript/lscript_library/lscript_library.cpp
index e379192..9752c22 100644
--- a/linden/indra/lscript/lscript_library/lscript_library.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_library.cpp
@@ -1,11 +1,11 @@
1/** 1/**
2 * @file lscript_library.cpp 2 * @file lscript_library.cpp
3 * @brief external library interface 3 * @brief external library interface
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2002-2009, Linden Research, Inc. 7 * Copyright (c) 2002-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.
@@ -37,7 +37,7 @@
37// ## ## ## ## ## ######## ## ## ## ## ## ## ## ## #### ## ## 37// ## ## ## ## ## ######## ## ## ## ## ## ## ## ## #### ## ##
38// ## ## ## ######### ## ## ## #### ## ## #### ## ## 38// ## ## ## ######### ## ## ## #### ## ## #### ## ##
39// ## ## ## ## ## ## ## ## ### ## ## ### ## ## #### #### 39// ## ## ## ## ## ## ## ## ### ## ## ### ## ## #### ####
40// ### ### ## ## ## ## ## ## #### ## ## ###### #### #### 40// ### ### ## ## ## ## ## ## #### ## ## ###### #### ####
41// 41//
42// When adding functions, they <b>MUST</b> be appended to the end of 42// When adding functions, they <b>MUST</b> be appended to the end of
43// the init() method. The init() associates the name with a number, 43// the init() method. The init() associates the name with a number,
@@ -335,7 +335,7 @@ void LLScriptLibrary::init()
335 335
336 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetRemoteScriptAccessPin", NULL, "i", "llSetRemoteScriptAccessPin(integer pin)\nIf pin is set to a non-zero number, the task will accept remote script\nloads via llRemoteLoadScriptPin if it passes in the correct pin.\nOthersise, llRemoteLoadScriptPin is ignored.")); 336 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetRemoteScriptAccessPin", NULL, "i", "llSetRemoteScriptAccessPin(integer pin)\nIf pin is set to a non-zero number, the task will accept remote script\nloads via llRemoteLoadScriptPin if it passes in the correct pin.\nOthersise, llRemoteLoadScriptPin is ignored."));
337 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llRemoteLoadScriptPin", NULL, "ksiii", "llRemoteLoadScriptPin(key target, string name, integer pin, integer running, integer start_param)\nIf the owner of the object this script is attached can modify target,\nthey are in the same region,\nand the matching pin is used,\ncopy script name onto target,\nif running == TRUE, start the script with param.")); 337 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llRemoteLoadScriptPin", NULL, "ksiii", "llRemoteLoadScriptPin(key target, string name, integer pin, integer running, integer start_param)\nIf the owner of the object this script is attached can modify target,\nthey are in the same region,\nand the matching pin is used,\ncopy script name onto target,\nif running == TRUE, start the script with param."));
338 338
339 addFunction(new LLScriptLibraryFunction(10.f, 1.f, dummy_func, "llOpenRemoteDataChannel", NULL, NULL, "llOpenRemoteDataChannel()\nCreates a channel to listen for XML-RPC calls. Will trigger a remote_data event with channel id once it is available.")); 339 addFunction(new LLScriptLibraryFunction(10.f, 1.f, dummy_func, "llOpenRemoteDataChannel", NULL, NULL, "llOpenRemoteDataChannel()\nCreates a channel to listen for XML-RPC calls. Will trigger a remote_data event with channel id once it is available."));
340 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llSendRemoteData", "k", "ksis", "key llSendRemoteData(key channel, string dest, integer idata, string sdata)\nSend an XML-RPC request to dest through channel with payload of channel (in a string), integer idata and string sdata.\nA message identifier key is returned.\nAn XML-RPC reply will trigger a remote_data event and reference the message id.\nThe message_id is returned.")); 340 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llSendRemoteData", "k", "ksis", "key llSendRemoteData(key channel, string dest, integer idata, string sdata)\nSend an XML-RPC request to dest through channel with payload of channel (in a string), integer idata and string sdata.\nA message identifier key is returned.\nAn XML-RPC reply will trigger a remote_data event and reference the message id.\nThe message_id is returned."));
341 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llRemoteDataReply", NULL, "kksi", "llRemoteDataReply(key channel, key message_id, string sdata, integer idata)\nSend an XML-RPC reply to message_id on channel with payload of string sdata and integer idata")); 341 addFunction(new LLScriptLibraryFunction(10.f, 3.f, dummy_func, "llRemoteDataReply", NULL, "kksi", "llRemoteDataReply(key channel, key message_id, string sdata, integer idata)\nSend an XML-RPC reply to message_id on channel with payload of string sdata and integer idata"));
@@ -351,7 +351,7 @@ void LLScriptLibrary::init()
351 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llLog", "f", "f", "float llLog(float val)\nReturns the base e log of val if val > 0, otherwise returns 0.")); 351 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llLog", "f", "f", "float llLog(float val)\nReturns the base e log of val if val > 0, otherwise returns 0."));
352 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetAnimationList", "l", "k", "list llGetAnimationList(key id)\nGets a list of all playing animations for avatar id")); 352 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetAnimationList", "l", "k", "list llGetAnimationList(key id)\nGets a list of all playing animations for avatar id"));
353 addFunction(new LLScriptLibraryFunction(10.f, 2.f, dummy_func, "llSetParcelMusicURL", NULL, "s", "llSetParcelMusicURL(string url)\nSets the streaming audio URL for the parcel object is on")); 353 addFunction(new LLScriptLibraryFunction(10.f, 2.f, dummy_func, "llSetParcelMusicURL", NULL, "s", "llSetParcelMusicURL(string url)\nSets the streaming audio URL for the parcel object is on"));
354 354
355 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRootPosition", "v", NULL, "vector llGetRootPosition()\nGets the global position of the root object of the object script is attached to")); 355 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRootPosition", "v", NULL, "vector llGetRootPosition()\nGets the global position of the root object of the object script is attached to"));
356 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRootRotation", "q", NULL, "rotation llGetRootRotation()\nGets the global rotation of the root object of the object script is attached to")); 356 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRootRotation", "q", NULL, "rotation llGetRootRotation()\nGets the global rotation of the root object of the object script is attached to"));
357 357
@@ -370,7 +370,7 @@ void LLScriptLibrary::init()
370 addFunction(new LLScriptLibraryFunction(10.f, 0.0f, dummy_func, "llBase64ToInteger", "i", "s", "integer llBase64ToInteger(string str)\nBig endian decode of a Base64 string into an integer.")); 370 addFunction(new LLScriptLibraryFunction(10.f, 0.0f, dummy_func, "llBase64ToInteger", "i", "s", "integer llBase64ToInteger(string str)\nBig endian decode of a Base64 string into an integer."));
371 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetGMTclock", "f", "", "float llGetGMTclock()\nGets the time in seconds since midnight in GMT")); 371 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetGMTclock", "f", "", "float llGetGMTclock()\nGets the time in seconds since midnight in GMT"));
372 addFunction(new LLScriptLibraryFunction(10.f, 10.f, dummy_func, "llGetSimulatorHostname", "s", "", "string llGetSimulatorHostname()\nGets the hostname of the machine script is running on (same as string in viewer Help dialog)")); 372 addFunction(new LLScriptLibraryFunction(10.f, 10.f, dummy_func, "llGetSimulatorHostname", "s", "", "string llGetSimulatorHostname()\nGets the hostname of the machine script is running on (same as string in viewer Help dialog)"));
373 373
374 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLocalRot", NULL, "q", "llSetLocalRot(rotation rot)\nsets the rotation of a child prim relative to the root prim")); 374 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLocalRot", NULL, "q", "llSetLocalRot(rotation rot)\nsets the rotation of a child prim relative to the root prim"));
375 375
376 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llParseStringKeepNulls", "l", "sll", "list llParseStringKeepNulls(string src, list separators, list spacers)\nBreaks src into a list, discarding separators, keeping spacers (separators and spacers must be lists of strings, maximum of 8 each), keeping any null values generated.")); 376 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llParseStringKeepNulls", "l", "sll", "list llParseStringKeepNulls(string src, list separators, list spacers)\nBreaks src into a list, discarding separators, keeping spacers (separators and spacers must be lists of strings, maximum of 8 each), keeping any null values generated."));
@@ -393,12 +393,12 @@ void LLScriptLibrary::init()
393 addFunction(new LLScriptLibraryFunction(10.f, 2.f, dummy_func, "llParcelMediaQuery", "l", "l", "list llParcelMediaQuery(list query)\nSends a list of queries, returns a list of results.")); 393 addFunction(new LLScriptLibraryFunction(10.f, 2.f, dummy_func, "llParcelMediaQuery", "l", "l", "list llParcelMediaQuery(list query)\nSends a list of queries, returns a list of results."));
394 394
395 addFunction(new LLScriptLibraryFunction(10.f, 1.f, dummy_func, "llModPow", "i", "iii", "integer llModPow(integer a, integer b, integer c)\nReturns a raised to the b power, mod c. ( (a**b)%c ). b is capped at 0xFFFF (16 bits).")); 395 addFunction(new LLScriptLibraryFunction(10.f, 1.f, dummy_func, "llModPow", "i", "iii", "integer llModPow(integer a, integer b, integer c)\nReturns a raised to the b power, mod c. ( (a**b)%c ). b is capped at 0xFFFF (16 bits)."));
396 396
397 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetInventoryType", "i", "s", "integer llGetInventoryType(string name)\nReturns the type of the inventory name")); 397 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetInventoryType", "i", "s", "integer llGetInventoryType(string name)\nReturns the type of the inventory name"));
398 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetPayPrice", NULL, "il", "llSetPayPrice(integer price, list quick_pay_buttons)\nSets the default amount when someone chooses to pay this object.")); 398 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetPayPrice", NULL, "il", "llSetPayPrice(integer price, list quick_pay_buttons)\nSets the default amount when someone chooses to pay this object."));
399 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetCameraPos", "v", "", "vector llGetCameraPos()\nGets current camera position for agent task has permissions for.")); 399 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetCameraPos", "v", "", "vector llGetCameraPos()\nGets current camera position for agent task has permissions for."));
400 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetCameraRot", "q", "", "rotation llGetCameraRot()\nGets current camera orientation for agent task has permissions for.")); 400 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetCameraRot", "q", "", "rotation llGetCameraRot()\nGets current camera orientation for agent task has permissions for."));
401 401
402 addFunction(new LLScriptLibraryFunction(10.f, 20.f, dummy_func, "llSetPrimURL", NULL, "s", "llSetPrimURL(string url)\nUpdates the URL for the web page shown on the sides of the object.")); 402 addFunction(new LLScriptLibraryFunction(10.f, 20.f, dummy_func, "llSetPrimURL", NULL, "s", "llSetPrimURL(string url)\nUpdates the URL for the web page shown on the sides of the object."));
403 addFunction(new LLScriptLibraryFunction(10.f, 20.f, dummy_func, "llRefreshPrimURL", NULL, "", "llRefreshPrimURL()\nReloads the web page shown on the sides of the object.")); 403 addFunction(new LLScriptLibraryFunction(10.f, 20.f, dummy_func, "llRefreshPrimURL", NULL, "", "llRefreshPrimURL()\nReloads the web page shown on the sides of the object."));
404 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llEscapeURL", "s", "s", "string llEscapeURL(string url)\nReturns and escaped/encoded version of url, replacing spaces with %20 etc.")); 404 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llEscapeURL", "s", "s", "string llEscapeURL(string url)\nReturns and escaped/encoded version of url, replacing spaces with %20 etc."));
@@ -411,7 +411,7 @@ void LLScriptLibrary::init()
411 411
412 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCameraParams", NULL, "l", "llSetCameraParams(list rules)\nSets multiple camera parameters at once.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]")); 412 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetCameraParams", NULL, "l", "llSetCameraParams(list rules)\nSets multiple camera parameters at once.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]"));
413 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llClearCameraParams", NULL, NULL, "llClearCameraParams()\nResets all camera parameters to default values and turns off scripted camera control.")); 413 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llClearCameraParams", NULL, NULL, "llClearCameraParams()\nResets all camera parameters to default values and turns off scripted camera control."));
414 414
415 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llListStatistics", "f", "il", "float llListStatistics(integer operation, list l)\nPerform statistical aggregate functions on list l using LIST_STAT_* operations.")); 415 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llListStatistics", "f", "il", "float llListStatistics(integer operation, list l)\nPerform statistical aggregate functions on list l using LIST_STAT_* operations."));
416 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetUnixTime", "i", NULL, "integer llGetUnixTime()\nGet the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.")); 416 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetUnixTime", "i", NULL, "integer llGetUnixTime()\nGet the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock."));
417 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelFlags", "i", "v", "integer llGetParcelFlags(vector pos)\nGet the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos.")); 417 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetParcelFlags", "i", "v", "integer llGetParcelFlags(vector pos)\nGet the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos."));
@@ -433,7 +433,7 @@ void LLScriptLibrary::init()
433 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkPrimitiveParams", NULL, "il", "llSetLinkPrimitiveParams(integer linknumber, list rules)\nSet primitive parameters for linknumber based on rules.")); 433 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkPrimitiveParams", NULL, "il", "llSetLinkPrimitiveParams(integer linknumber, list rules)\nSet primitive parameters for linknumber based on rules."));
434 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkTexture", NULL, "isi", "llSetLinkTexture(integer link_pos, string texture, integer face)\nSets the texture of face for link_pos")); 434 addFunction(new LLScriptLibraryFunction(10.f, 0.2f, dummy_func, "llSetLinkTexture", NULL, "isi", "llSetLinkTexture(integer link_pos, string texture, integer face)\nSets the texture of face for link_pos"));
435 435
436 436
437 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llStringTrim", "s", "si", "string llStringTrim(string src, integer trim_type)\nTrim leading and/or trailing spaces from a string.\nUses trim_type of STRING_TRIM, STRING_TRIM_HEAD or STRING_TRIM_TAIL.")); 437 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llStringTrim", "s", "si", "string llStringTrim(string src, integer trim_type)\nTrim leading and/or trailing spaces from a string.\nUses trim_type of STRING_TRIM, STRING_TRIM_HEAD or STRING_TRIM_TAIL."));
438 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llRegionSay", NULL, "is", "llRegionSay(integer channel, string msg)\nbroadcasts msg to entire region on channel (not 0.)")); 438 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llRegionSay", NULL, "is", "llRegionSay(integer channel, string msg)\nbroadcasts msg to entire region on channel (not 0.)"));
439 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetObjectDetails", "l", "kl", "list llGetObjectDetails(key id, list params)\nGets the object details specified in params for the object with key id.\nDetails are OBJECT_NAME, _DESC, _POS, _ROT, _VELOCITY, _OWNER, _GROUP, _CREATOR.")); 439 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetObjectDetails", "l", "kl", "list llGetObjectDetails(key id, list params)\nGets the object details specified in params for the object with key id.\nDetails are OBJECT_NAME, _DESC, _POS, _ROT, _VELOCITY, _OWNER, _GROUP, _CREATOR."));
@@ -484,25 +484,25 @@ void LLScriptLibrary::init()
484 // documented and therefore the description may be incomplete and require further attention. 484 // documented and therefore the description may be incomplete and require further attention.
485 // OpenSimulator is written in C# and not CPP therefore some values for example "double = float" etc. are different. 485 // OpenSimulator is written in C# and not CPP therefore some values for example "double = float" etc. are different.
486 486
487 // OSSL corrections and syntax additions added + set in same order as found in OSSL_stub.cs of OpenSim Source (Updated PM October-21-2010 487 // OSSL corrections and syntax additions added + set in same order as found in OSSL_stub.cs of OpenSim Source (Updated PM October-21-2010
488 // based on OpenSimulator Ver. 0.7.x DEV/Master Git # a7acb650d400a280a7b9edabd304376dff9c81af - a7acb65-r/14142 488 // based on OpenSimulator Ver. 0.7.x DEV/Master Git # a7acb650d400a280a7b9edabd304376dff9c81af - a7acb65-r/14142
489 // Updates by WhiteStar Magic 489 // Updates by WhiteStar Magic
490 490
491 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetRegionWaterHeight", NULL, "f", "osSetRegionWaterHeight(float height)\nAdjusts Water Height on region.\n(OpenSim only.)")); 491 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetRegionWaterHeight", NULL, "f", "osSetRegionWaterHeight(float height)\nAdjusts Water Height on region.\n(OpenSim only.)"));
492 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetRegionSunSettings", NULL, "iif", "osSetRegionSunSettings(integer useEstateSun, integer sunFixed, float sunHour)\nChanges the Estate Sun Settings, then Triggers a Sun Update\n'sunFixed' TRUE (1) to keep the sun stationary, FALSE (0) to use global time\n'sunHour' The \"Sun Hour\" that is desired, 0...24, with 0 just after SunRise.\n(OpenSim only.)")); 492 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetRegionSunSettings", NULL, "iif", "osSetRegionSunSettings(integer useEstateSun, integer sunFixed, float sunHour)\nChanges the Estate Sun Settings, then Triggers a Sun Update\n'sunFixed' TRUE (1) to keep the sun stationary, FALSE (0) to use global time\n'sunHour' The \"Sun Hour\" that is desired, 0...24, with 0 just after SunRise.\n(OpenSim only.)"));
493 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetEstateSunSettings", NULL, "if", "osSetEstateSunSettings(integer sunFixed, float sunHour)\nsunFixed = 0 or 1, sunHour = 00.00 to 24.00.\n(OpenSim only.)")); 493 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetEstateSunSettings", NULL, "if", "osSetEstateSunSettings(integer sunFixed, float sunHour)\nsunFixed = 0 or 1, sunHour = 00.00 to 24.00.\n(OpenSim only.)"));
494 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osGetCurrentSunHour", "f", NULL, "float osGetCurrentSunHour()\nReturns Float Value of Current Sun Hour 0...24 0 = sunrise.\n(OpenSim only.)")); 494 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osGetCurrentSunHour", "f", NULL, "float osGetCurrentSunHour()\nReturns Float Value of Current Sun Hour 0...24 0 = sunrise.\n(OpenSim only.)"));
495 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSunGetParam","f", "s", "float osSunGetParam(string param)\nReturns current float values for param\nwhere param = day_length, year_length, day_night_offset, update_interval.\n(OpenSim only.)")); 495 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSunGetParam","f", "s", "float osSunGetParam(string param)\nReturns current float values for param\nwhere param = day_length, year_length, day_night_offset, update_interval.\n(OpenSim only.)"));
496 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSunSetParam", "sf", NULL, "osSunSetParam(string param, float value)\nSet's Sun Param for SunSet,\nosSunSetParam(day_length, 24.0)\nwhere param = day_length, year_length, day_night_offset, update_interval.\n(OpenSim only.)")); 496 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSunSetParam", "sf", NULL, "osSunSetParam(string param, float value)\nSet's Sun Param for SunSet,\nosSunSetParam(day_length, 24.0)\nwhere param = day_length, year_length, day_night_offset, update_interval.\n(OpenSim only.)"));
497 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindActiveModelPluginName", "s", NULL, "string osWindActiveModelPluginName()\nReturns the Current Working Wind Module Installed\nThese are SimpleRandomWind or ConfigurableWind, optionally others.\n(OpenSim only.)")); 497 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindActiveModelPluginName", "s", NULL, "string osWindActiveModelPluginName()\nReturns the Current Working Wind Module Installed\nThese are SimpleRandomWind or ConfigurableWind, optionally others.\n(OpenSim only.)"));
498 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelJoin", NULL, "vv", "osParcelJoin(vector pos1, vector pos2))\nJoins Parcels @ X,Y coordinates.\n(OpenSim only.)")); 498 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelJoin", NULL, "vv", "osParcelJoin(vector pos1, vector pos2))\nJoins Parcels @ X,Y coordinates.\n(OpenSim only.)"));
499 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelSubdivide", NULL, "vv", "osParcelSubdivide(vector pos1, vector pos2))\nSubdivides Parcels @ X,Y coordinates.\n(OpenSim only.)")); 499 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelSubdivide", NULL, "vv", "osParcelSubdivide(vector pos1, vector pos2))\nSubdivides Parcels @ X,Y coordinates.\n(OpenSim only.)"));
500 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelSetDetails", NULL, "vv", "osParcelSetDetails(vector pos, list rules))\nSet Parcel details.\n(OpenSim only.)")); 500 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osParcelSetDetails", NULL, "vv", "osParcelSetDetails(vector pos, list rules))\nSet Parcel details.\n(OpenSim only.)"));
501 // addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindParamSet", NULL, "ssf", "osWindParamSet(string plugin, string param, float value)Send Param to Specified Wind Plugin with new value.\n(OpenSim only.)")); 501 // addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindParamSet", NULL, "ssf", "osWindParamSet(string plugin, string param, float value)Send Param to Specified Wind Plugin with new value.\n(OpenSim only.)"));
502 // addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindParamGet", "f", "ss", "float osWindParamGet(string plugin, string param)\n Returns Current param from specified Wind Plugin Module.\n(OpenSim only.)")); 502 // addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osWindParamGet", "f", "ss", "float osWindParamGet(string plugin, string param)\n Returns Current param from specified Wind Plugin Module.\n(OpenSim only.)"));
503 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osList2Double", "f", "si", "double osList2Double(list src, int index)\nReturns Double (float) Value from src at index.\n(OpenSim only.)")); 503 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osList2Double", "f", "si", "double osList2Double(list src, int index)\nReturns Double (float) Value from src at index.\n(OpenSim only.)"));
504 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURL", NULL, "ssssi", "osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer )\n(OpenSim only.)")); 504 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURL", NULL, "ssssi", "osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer )\n(OpenSim only.)"));
505 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureData", NULL, "ssssi", "osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer)\nWrites text and vector graphics onto a prim face.\n(OpenSim only.)")); 505 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureData", NULL, "ssssi", "osSetDynamicTextureData(string dynamicID, string contentType, string data, string extraParams, int timer)\nWrites text and vector graphics onto a prim face.\n(OpenSim only.)"));
506 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlend", NULL, "ssssii", "osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, int timer, int alpha)\n(OpenSim only.)")); 506 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlend", NULL, "ssssii", "osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, int timer, int alpha)\n(OpenSim only.)"));
507 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureDataBlend", NULL, "ssssii", "osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, int timer, int alpha)\n(OpenSim only.)")); 507 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureDataBlend", NULL, "ssssii", "osSetDynamicTextureDataBlend(string dynamicID, string contentType, string data, string extraParams, int timer, int alpha)\n(OpenSim only.)"));
508 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlendFace", NULL, "ssssfiiii", "osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, bool blend, int disp, int timer, int alpha, int face)\nLoads a web texture on a prim.\n(OpenSim only.)")); 508 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetDynamicTextureURLBlendFace", NULL, "ssssfiiii", "osSetDynamicTextureURLBlendFace(string dynamicID, string contentType, string url, string extraParams, bool blend, int disp, int timer, int alpha, int face)\nLoads a web texture on a prim.\n(OpenSim only.)"));
@@ -512,7 +512,7 @@ void LLScriptLibrary::init()
512 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osTerrainFlush", NULL, NULL, "osTerrainFlush()\nUpdates terrain data. Call this after you are done using osTerrainSetHeight.\n(OpenSim only.)")); 512 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osTerrainFlush", NULL, NULL, "osTerrainFlush()\nUpdates terrain data. Call this after you are done using osTerrainSetHeight.\n(OpenSim only.)"));
513 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osRegionRestart", NULL, "f", "int osRegionRestart(double seconds)\nRestart the current region in the specified number of seconds from now.\n(OpenSim only.)")); 513 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osRegionRestart", NULL, "f", "int osRegionRestart(double seconds)\nRestart the current region in the specified number of seconds from now.\n(OpenSim only.)"));
514 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osRegionNotice",NULL, "s", "osRegionNotice(string msg)\nBroadcasts a notification message to all agents on the current region.\n(OpenSim only.)")); 514 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osRegionNotice",NULL, "s", "osRegionNotice(string msg)\nBroadcasts a notification message to all agents on the current region.\n(OpenSim only.)"));
515 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osConsoleCommand", NULL, "s", "osConsoleCommand(string command)\nIssues commands directly to the OpenSim server console.\n(OpenSim only.)")); 515 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osConsoleCommand", NULL, "s", "osConsoleCommand(string command)\nIssues commands directly to the OpenSim server console.\n(OpenSim only.)"));
516 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetParcelMediaURL", NULL, "s", "osSetParcelMediaURL(string url)\nSets Parcel Media URL.\n(OpenSim only.)")); 516 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetParcelMediaURL", NULL, "s", "osSetParcelMediaURL(string url)\nSets Parcel Media URL.\n(OpenSim only.)"));
517 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetParcelSIPAddress", NULL, "s", "osSetParcelSIPAddress(string SIPAddress)\nSets Parcel SIP Address for Voice.\n(OpenSim only.)")); 517 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetParcelSIPAddress", NULL, "s", "osSetParcelSIPAddress(string SIPAddress)\nSets Parcel SIP Address for Voice.\n(OpenSim only.)"));
518 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetPrimFloatOnWater", NULL, "i", "osSetPrimFloatOnWater(int floatYN)\nMake Physical prims float at the water level, TRUE or FALSE.\n(OpenSim only.)")); 518 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetPrimFloatOnWater", NULL, "i", "osSetPrimFloatOnWater(int floatYN)\nMake Physical prims float at the water level, TRUE or FALSE.\n(OpenSim only.)"));
@@ -568,10 +568,10 @@ void LLScriptLibrary::init()
568 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetSpeed", NULL, "kf", "osSetSpeed(key AVATAR, float SpeedModifier)\nMultiplies the normal running, walking, and flying speed of the specified avatar.\n(OpenSim only.)")); 568 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetSpeed", NULL, "kf", "osSetSpeed(key AVATAR, float SpeedModifier)\nMultiplies the normal running, walking, and flying speed of the specified avatar.\n(OpenSim only.)"));
569 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osCauseDamage", NULL, "kf", "osCauseDamage(key AVATAR, float damage)\nCauses damage to specified AVATAR (UUID).\n(OpenSim only.)")); 569 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osCauseDamage", NULL, "kf", "osCauseDamage(key AVATAR, float damage)\nCauses damage to specified AVATAR (UUID).\n(OpenSim only.)"));
570 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osCauseHealing", NULL, "kf", "osCauseHealing(key AVATAR, float healing)\nCauses Healing to specified AVATAR (UUID).\n(OpenSim only.)")); 570 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osCauseHealing", NULL, "kf", "osCauseHealing(key AVATAR, float healing)\nCauses Healing to specified AVATAR (UUID).\n(OpenSim only.)"));
571 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osGetPrimitiveParams", "l", "kl", "List osGetPrimitiveParams(key prim, list rules)\nGets primitive Params.\n(OpenSim only.)")); 571 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osGetPrimitiveParams", "l", "kl", "List osGetPrimitiveParams(key prim, list rules)\nGets primitive Params.\n(OpenSim only.)"));
572 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetPrimitiveParams", NULL, "kl", "osSetPrimitiveParams(key prim, list rules)\nSets primitive Params.\n(OpenSim only.)")); 572 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetPrimitiveParams", NULL, "kl", "osSetPrimitiveParams(key prim, list rules)\nSets primitive Params.\n(OpenSim only.)"));
573 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetProjectionParams", NULL, "kikfff", "osSetProjectionParams(key prim. bool projection, key texture, float fov, float focus, float amb)\nSet Projection Paramaters (bool = true / false)\n(OpenSim only.)")); 573 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osSetProjectionParams", NULL, "kikfff", "osSetProjectionParams(key prim. bool projection, key texture, float fov, float focus, float amb)\nSet Projection Paramaters (bool = true / false)\n(OpenSim only.)"));
574 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osUnixTimeToTimestamp", "s", "i", "osUnixTimeToTimestamp(integer unixtime)\nConverts unixtime to an llGetTimeStamp() formated string.\n(OpenSim only.)")); 574 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "osUnixTimeToTimestamp", "s", "i", "osUnixTimeToTimestamp(integer unixtime)\nConverts unixtime to an llGetTimeStamp() formated string.\n(OpenSim only.)"));
575 575
576 // LightShare functions 576 // LightShare functions
577 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "cmSetWindlightScene", "i", "l", "integer cmSetWindlightScene(list rules)\nSet the current WindLight scene. Restricted to estate managers and owners only.")); 577 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "cmSetWindlightScene", "i", "l", "integer cmSetWindlightScene(list rules)\nSet the current WindLight scene. Restricted to estate managers and owners only."));
@@ -579,6 +579,7 @@ void LLScriptLibrary::init()
579 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "cmGetWindlightScene", "l", "l", "list cmGetWindlightScene(list rules)\nGet the current WindLight settings.")); 579 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "cmGetWindlightScene", "l", "l", "list cmGetWindlightScene(list rules)\nGet the current WindLight settings."));
580 // LightShare functions - alternate versions 580 // LightShare functions - alternate versions
581 // don't ask me why they renamed 'em, but we need to include both versions -- MC 581 // don't ask me why they renamed 'em, but we need to include both versions -- MC
582 // cm refers to a proprietary fork of OpenSim used by Meta 7 and Avination, they where renamed to ls when LightShare was released to the wild.
582 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsSetWindlightScene", "i", "l", "integer lsSetWindlightScene(list rules)\nSet the current WindLight scene. Restricted to estate managers and owners only.")); 583 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsSetWindlightScene", "i", "l", "integer lsSetWindlightScene(list rules)\nSet the current WindLight scene. Restricted to estate managers and owners only."));
583 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsSetWindlightSceneTargeted", "i", "lk", "integer lsSetWindlightSceneTargeted(list rules, key target)\nSet the current WindLight scene directed to a specific avatar. Restricted to estate managers and owners only.")); 584 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsSetWindlightSceneTargeted", "i", "lk", "integer lsSetWindlightSceneTargeted(list rules, key target)\nSet the current WindLight scene directed to a specific avatar. Restricted to estate managers and owners only."));
584 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsGetWindlightScene", "l", "l", "list lsGetWindlightScene(list rules)\nGet the current WindLight settings.")); 585 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "lsGetWindlightScene", "l", "l", "list lsGetWindlightScene(list rules)\nGet the current WindLight settings."));
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index a875564..1fc5f42 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -92,7 +92,7 @@ set(viewer_SOURCE_FILES
92 jcfloaterareasearch.cpp 92 jcfloaterareasearch.cpp
93 kokuastreamingaudio.cpp 93 kokuastreamingaudio.cpp
94 kowopenregionsettings.cpp 94 kowopenregionsettings.cpp
95 lightshare.cpp 95 llettherebelight.cpp
96 llagent.cpp 96 llagent.cpp
97 llagentaccess.cpp 97 llagentaccess.cpp
98 llagentdata.cpp 98 llagentdata.cpp
@@ -504,11 +504,9 @@ set(viewer_SOURCE_FILES
504 slfloatermediafilter.cpp 504 slfloatermediafilter.cpp
505 viewerinfo.cpp 505 viewerinfo.cpp
506 viewertime.cpp 506 viewertime.cpp
507 windlightsettingsupdate.cpp
508 wlfloatermanager.cpp 507 wlfloatermanager.cpp
509 wlfloaterwindlightsend.cpp 508 wlfloaterwindlightsend.cpp
510 wlretrievesettings.cpp 509 wlretrievesettings.cpp
511 wlsettingsmanager.cpp
512 rcmoapradar.cpp 510 rcmoapradar.cpp
513 ) 511 )
514 512
@@ -533,7 +531,7 @@ set(viewer_HEADER_FILES
533 CMakeLists.txt 531 CMakeLists.txt
534 ViewerInstall.cmake 532 ViewerInstall.cmake
535 aoremotectrl.h 533 aoremotectrl.h
536 chatbar_as_cmdline.h 534 chatbar_as_cmdline.h
537 emeraldboobutils.h 535 emeraldboobutils.h
538 floaterao.h 536 floaterao.h
539 floaterbusy.h 537 floaterbusy.h
@@ -552,11 +550,11 @@ set(viewer_HEADER_FILES
552 jcfloater_animation_list.h 550 jcfloater_animation_list.h
553 jcfloaterareasearch.h 551 jcfloaterareasearch.h
554 kokuastreamingaudio.h 552 kokuastreamingaudio.h
555 lightshare.h 553 llettherebelight.h
556 lggautocorrectfloater.h 554 lggautocorrectfloater.h
557 lggautocorrect.h 555 lggautocorrect.h
558 lggdicdownload.h 556 lggdicdownload.h
559 lgghunspell_wrapper.h 557 lgghunspell_wrapper.h
560 llagent.h 558 llagent.h
561 llagentaccess.h 559 llagentaccess.h
562 llagentdata.h 560 llagentdata.h
@@ -739,7 +737,7 @@ set(viewer_HEADER_FILES
739 llmaniprotate.h 737 llmaniprotate.h
740 llmanipscale.h 738 llmanipscale.h
741 llmaniptranslate.h 739 llmaniptranslate.h
742 llmediadataclient.h 740 llmediadataclient.h
743 llmapresponders.h 741 llmapresponders.h
744 llmediaremotectrl.h 742 llmediaremotectrl.h
745 llmemoryview.h 743 llmemoryview.h
@@ -983,8 +981,7 @@ set(viewer_HEADER_FILES
983 wlfloatermanager.h 981 wlfloatermanager.h
984 wlfloaterwindlightsend.h 982 wlfloaterwindlightsend.h
985 wlretrievesettings.h 983 wlretrievesettings.h
986 wlsettingsmanager.h 984 rcmoapradar.h
987 rcmoapradar.h
988 ) 985 )
989 986
990source_group("CMake Rules" FILES ViewerInstall.cmake) 987source_group("CMake Rules" FILES ViewerInstall.cmake)
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/llettherebelight.cpp
index b00df96..7fc2a3d 100644
--- a/linden/indra/newview/lightshare.cpp
+++ b/linden/indra/newview/llettherebelight.cpp
@@ -1,9 +1,10 @@
1/** 1/**
2 * @file lightshare.cpp 2 * @file llettherebelight.cpp
3 * @brief Handler for Meta7 Lightshare (region-side Windlight settings). 3 * @brief Handler for Meta7 Lightshare (region-side Windlight settings), and other methods of sharing WindLight.
4 * 4 *
5 * Copyright (c) 2010, Tom Grimshaw (Tom Meta) 5 * Copyright (c) 2010, Tom Grimshaw (Tom Meta)
6 * Copyright (c) 2010, Jacek Antonelli 6 * Copyright (c) 2010, Jacek Antonelli
7 * Copyright (c) 2012, David Seikel
7 * 8 *
8 * The source code in this file ("Source Code") is provided to you 9 * The source code in this file ("Source Code") is provided to you
9 * under the terms of the GNU General Public License, version 2.0 10 * under the terms of the GNU General Public License, version 2.0
@@ -27,7 +28,6 @@
27 */ 28 */
28 29
29 30
30#include "lightshare.h"
31 31
32#include "linden_common.h" 32#include "linden_common.h"
33#include "llviewercontrol.h" 33#include "llviewercontrol.h"
@@ -38,21 +38,26 @@
38#include "message.h" 38#include "message.h"
39#include "meta7windlight.h" 39#include "meta7windlight.h"
40 40
41#include "llettherebelight.h"
41 42
42const std::string WindlightMessage::sWaterPresetName = "(Region settings)"; 43#include "llagent.h"
43const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; 44#include "llworld.h"
44 45
45 46
46WindlightMessage* WindlightMessage::sMostRecent = NULL; 47const std::string LightShare::sRegionPresetName = "(Region settings)";
47LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); 48const std::string LightShare::sParcelPresetName = "(Parcel settings)";
48bool WindlightMessage::sIgnoreRegion = false; 49const std::string LightShare::sRLVPresetName = "(RLV settings)";
49 50
50 51
51WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : 52LLWaterParamSet* LightShare::mWater = NULL;
53LLWLParamSet* LightShare::mSky = NULL;
54LLUUID* LightShare::mWaterNormal = NULL;
55LLTimer* LightShare::sIgnoreTimer = new LLTimer();
56bool LightShare::sIgnoreRegion = false;
57
58
59LightShare::LightShare( LLMessageSystem* msg ) :
52 mPacket(NULL), 60 mPacket(NULL),
53 mWater(NULL),
54 mSky(NULL),
55 mWaterNormal(NULL),
56 mIsValid(false) 61 mIsValid(false)
57{ 62{
58 std::string method; 63 std::string method;
@@ -77,10 +82,7 @@ WindlightMessage::WindlightMessage( LLMessageSystem* msg ) :
77 buf, size, 0, 249); 82 buf, size, 0, 249);
78 83
79 mWater = new LLWaterParamSet(); 84 mWater = new LLWaterParamSet();
80// mSky = new LLWLParamSet(); 85 mSky = new LLWLParamSet();
81 LLWLParamManager * wl_param_mgr = LLWLParamManager::instance();
82 static LLWLParamSet & sSky = wl_param_mgr->mCurParams;
83 mSky = &sSky;
84 86
85 mWaterNormal = new LLUUID(); 87 mWaterNormal = new LLUUID();
86 88
@@ -93,21 +95,21 @@ WindlightMessage::WindlightMessage( LLMessageSystem* msg ) :
93} 95}
94 96
95 97
96WindlightMessage::~WindlightMessage() 98LightShare::~LightShare()
97{ 99{
98 delete mWater; 100 delete mWater;
99// delete mSky; 101 delete mSky;
100 delete mWaterNormal; 102 delete mWaterNormal;
101} 103}
102 104
103 105
104// static 106// static
105void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) 107void LightShare::processWindlight(LLMessageSystem* msg, void**)
106{ 108{
107 if( gSavedSettings.getU32("LightShareAllowed") <= LIGHTSHARE_NEVER ) 109 if( gSavedSettings.getU32("LightShareAllowed") <= LIGHTSHARE_NEVER )
108 return; 110 return;
109 111
110 WindlightMessage* wl = new WindlightMessage(msg); 112 LightShare* wl = new LightShare(msg);
111 113
112 if (!wl) 114 if (!wl)
113 return; 115 return;
@@ -118,16 +120,28 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**)
118 return; 120 return;
119 } 121 }
120 122
123 applyMaybe(wl->mWater, wl->mWaterNormal, wl->mSky);
124}
125
126
127//static
128void LightShare::applyMaybe(LLWaterParamSet* thisWater, LLUUID* thisWaterNormal, LLWLParamSet* thisSky)
129{
130 if( gSavedSettings.getU32("LightShareAllowed") <= LIGHTSHARE_NEVER )
131 return;
132
121 std::string water = LLWaterParamManager::instance()->mCurParams.mName; 133 std::string water = LLWaterParamManager::instance()->mCurParams.mName;
122 std::string sky = LLWLParamManager::instance()->mCurParams.mName; 134 std::string sky = LLWLParamManager::instance()->mCurParams.mName;
123 135
124 // If they are using region settings already, or LightShare is 136 // If they are using region settings already, or LightShare is
125 // always allowed, just apply the new settings, don't bother asking. 137 // always allowed, just apply the new settings, don't bother asking.
126 if( gSavedSettings.getU32("LightShareAllowed") == LIGHTSHARE_ALWAYS || 138 if( gSavedSettings.getU32("LightShareAllowed") == LIGHTSHARE_ALWAYS ||
127 (sky == sSkyPresetName && water == sWaterPresetName) ) 139 (sky == sRegionPresetName && water == sRegionPresetName) )
128 { 140 {
129 wl->apply(); 141 mSky = thisSky;
130 delete wl; 142 mWater = thisWater;
143 mWaterNormal = thisWaterNormal;
144 apply(mWater, mWaterNormal, mSky, WL_SCOPE_REGION);
131 return; 145 return;
132 } 146 }
133 147
@@ -136,41 +150,36 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**)
136 // The user recently ignored a windlight message, so ignore 150 // The user recently ignored a windlight message, so ignore
137 // this one too, and restart the timer. 151 // this one too, and restart the timer.
138 restartIgnoreTimer(); 152 restartIgnoreTimer();
139 delete wl;
140 return; 153 return;
141 } 154 }
142 155
143 if(sIgnoreRegion) 156 if(sIgnoreRegion)
144 { 157 {
145 // We are ignoring new settings until user enters a new region. 158 // We are ignoring new settings until user enters a new region.
146 delete wl;
147 return; 159 return;
148 } 160 }
149 161
150 if( gSavedSettings.getU32("LightShareAllowed") == LIGHTSHARE_ASK && 162 if( gSavedSettings.getU32("LightShareAllowed") == LIGHTSHARE_ASK && mSky == NULL && mWater == NULL)
151 sMostRecent == NULL )
152 { 163 {
153 // No most recent, so store this and create notification 164 // No most recent, so store this and create notification
154 // asking the user whether to apply or not. 165 // asking the user whether to apply or not.
155 sMostRecent = wl; 166 mSky = thisSky;
156 LLNotifications::instance().add("ConfirmLightShare", LLSD(), LLSD(), 167 mWater = thisWater;
168 mWaterNormal = thisWaterNormal;
169 LLNotifications::instance().add("ConfirmLightShare", LLSD(), LLSD(),
157 boost::bind(&applyCallback, _1, _2)); 170 boost::bind(&applyCallback, _1, _2));
158 return;
159 } 171 }
160 else 172 else
161 { 173 {
162 // No new notification (to avoid spamming the user), just 174 // No new notification (to avoid spamming the user, we do keep the saves from above)
163 // store this as most recent. 175 mSky = thisSky;
164 delete sMostRecent; 176 mWater = thisWater;
165 sMostRecent = wl; 177 mWaterNormal = thisWaterNormal;
166 return;
167 } 178 }
168} 179}
169 180
170
171// static 181// static
172bool WindlightMessage::applyCallback(const LLSD& notification, 182bool LightShare::applyCallback(const LLSD& notification, const LLSD& response)
173 const LLSD& response)
174{ 183{
175 S32 option = LLNotification::getSelectedOption(notification, response); 184 S32 option = LLNotification::getSelectedOption(notification, response);
176 185
@@ -178,7 +187,8 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
178 { 187 {
179 case 0:{ 188 case 0:{
180 // "Apply" 189 // "Apply"
181 sMostRecent->apply(); 190 apply(mWater, mWaterNormal, mSky, WL_SCOPE_REGION);
191
182 break; 192 break;
183 } 193 }
184 case 1:{ 194 case 1:{
@@ -193,22 +203,18 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
193 } 203 }
194 } 204 }
195 205
196 delete sMostRecent;
197 sMostRecent = NULL;
198
199 return false; 206 return false;
200} 207}
201 208
202
203// static 209// static
204void WindlightMessage::resetRegion() 210void LightShare::resetRegion()
205{ 211{
206 sIgnoreRegion = false; 212 sIgnoreRegion = false;
213 apply(NULL, NULL, NULL, WL_SCOPE_REGION);
207} 214}
208 215
209
210// static 216// static
211void WindlightMessage::restartIgnoreTimer() 217void LightShare::restartIgnoreTimer()
212{ 218{
213 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); 219 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer");
214 sIgnoreTimer->start(); 220 sIgnoreTimer->start();
@@ -216,51 +222,219 @@ void WindlightMessage::restartIgnoreTimer()
216} 222}
217 223
218// static 224// static
219bool WindlightMessage::ignoreTimerHasExpired() 225bool LightShare::ignoreTimerHasExpired()
220{ 226{
221 return sIgnoreTimer->hasExpired(); 227 return sIgnoreTimer->hasExpired();
222} 228}
223 229
230// TODO - have regionSet and parcelSet be arrays, so we can deal with height zones.
231static struct WLCombined userSet, regionSet, parcelSet, RLVSet;
224 232
225bool WindlightMessage::apply() 233// TODO - should spread this merging stuff around,
234// so that eventually we can get rid of almost identical code for water and sky.
235// Then one of these two methods goes away.
236
237//static
238void LightShare::mergeWaterSets(LLWaterParamSet* thisSet, LLWaterParamSet* oldSet)
226{ 239{
227 LLWaterParamManager* water_mgr = LLWaterParamManager::instance(); 240 for(LLSD::map_const_iterator i = thisSet->mParamValues.beginMap();
228 LLWLParamManager* sky_mgr = LLWLParamManager::instance(); 241 i != thisSet->mParamValues.endMap();
229 242 ++i)
230 mWater->mName = sWaterPresetName; 243 {
231 water_mgr->removeParamSet( sWaterPresetName, false ); 244 const std::string& param = i->first;
232 water_mgr->addParamSet( sWaterPresetName, *mWater ); 245
233 water_mgr->savePreset( sWaterPresetName ); 246 if(i->second.isArray())
234 water_mgr->loadPreset( sWaterPresetName, true ); 247 {
235 water_mgr->setNormalMapID( *mWaterNormal ); 248 for (int j = 0; j < i->second.size(); j++)
236 249 {
237 mSky->mName = sSkyPresetName; 250 oldSet->mParamValues[param][j] = i->second[j].asReal();
238 sky_mgr->mAnimator.mIsRunning = false; 251 }
239 sky_mgr->mAnimator.mUseLindenTime = false; 252 }
240 sky_mgr->removeParamSet( sSkyPresetName, false ); 253 else if(i->second.isReal())
241 sky_mgr->addParamSet( sSkyPresetName, *mSky ); 254 oldSet->mParamValues[param] = i->second.asReal();
242 sky_mgr->savePreset( sSkyPresetName ); 255 }
243 sky_mgr->loadPreset( sSkyPresetName, true );
244
245 return true;
246} 256}
247 257
258//static
259void LightShare::mergeWLSets(LLWLParamSet* thisSet, LLWLParamSet* oldSet)
260{
261 for(LLSD::map_const_iterator i = thisSet->mParamValues.beginMap();
262 i != thisSet->mParamValues.endMap();
263 ++i)
264 {
265 const std::string& param = i->first;
266
267 if(i->second.isArray())
268 {
269 for (int j = 0; j < i->second.size(); j++)
270 {
271 oldSet->mParamValues[param][j] = i->second[j].asReal();
272 }
273 }
274 else if(i->second.isReal())
275 oldSet->mParamValues[param] = i->second.asReal();
276 }
277}
248 278
249bool WindlightMessage::isValid() 279//static
280void LightShare::apply(LLWaterParamSet * newWater, LLUUID *newWaterNormal, LLWLParamSet *newSky, WLScope scope)
281// TODO - Deal with day cycle stuff.
250{ 282{
251 return mIsValid; 283 LLWaterParamManager* waterMgr = LLWaterParamManager::instance();
284 LLWLParamManager* skyMgr = LLWLParamManager::instance();
285 LLWaterParamSet oldWaterSet = waterMgr->mCurParams;
286 LLWLParamSet oldWLSet = skyMgr->mCurParams;
287 struct WLCombined* thisSet = &userSet;
288 bool user = true;
289
290 switch(scope)
291 {
292 case WL_SCOPE_USER :
293 {
294 thisSet = &userSet;
295 thisSet->water.mName = waterMgr->mCurParams.mName;
296 thisSet->sky.mName = skyMgr->mCurParams.mName;
297 thisSet->enabled = true;
298 // Check if user selected to show the saved region or parcel settings.
299 if (newSky && (sRegionPresetName == skyMgr->mCurParams.mName))
300 thisSet->enabled = false;
301 if (newWater && (sParcelPresetName == skyMgr->mCurParams.mName))
302 thisSet->enabled = false;
303 break;
304 }
305 case WL_SCOPE_REGION :
306 {
307 thisSet = &regionSet;
308 thisSet->water.mName = sRegionPresetName;
309 thisSet->sky.mName = sRegionPresetName;
310 thisSet->enabled = (gSavedSettings.getU32("LightShareAllowed") != LIGHTSHARE_NEVER);
311 break;
312 }
313 case WL_SCOPE_PARCEL :
314 {
315 thisSet = &parcelSet;
316 thisSet->water.mName = sParcelPresetName;
317 thisSet->sky.mName = sParcelPresetName;
318 thisSet->enabled = (gSavedSettings.getU32("LightShareAllowed") != LIGHTSHARE_NEVER);
319 break;
320 }
321 case WL_SCOPE_RLV :
322 {
323 thisSet = &RLVSet;
324 thisSet->water.mName = sRLVPresetName;
325 thisSet->sky.mName = sRLVPresetName;
326 // TODO set enabled properly.
327 break;
328 }
329 }
330
331 if (newWater)
332 thisSet->water.setAll(newWater->getAll());
333 if (newWaterNormal)
334 thisSet->water.mParamValues["normalMap"] = *newWaterNormal;
335 if (newSky)
336 thisSet->sky.setAll(newSky->getAll());
337
338 if ((NULL == newWater) && (NULL == newSky))
339 thisSet->enabled = false;
340
341 F32 fade = 0; //Instant
342 bool error;
343 fade = thisSet->sky.getFloat("fade", error);
344
345 if (fade)
346 {
347 // TODO - should copy the original, then set that here.
348 // The fade should delete this copy once it's done fading.
349 // Dunno if we actually need to do any of this anyway.
350 waterMgr->removeParamSet( oldWaterSet.mName, false );
351 waterMgr->addParamSet( oldWaterSet.mName, oldWaterSet );
352 waterMgr->setNormalMapID( *newWaterNormal );
353 waterMgr->getParamSet(oldWaterSet.mName, waterMgr->mCurParams);
354 waterMgr->propagateParameters();
355
356 skyMgr->removeParamSet( oldWLSet.mName, false );
357 skyMgr->addParamSet( oldWLSet.mName, oldWLSet );
358 skyMgr->getParamSet(oldWLSet.mName, skyMgr->mCurParams);
359 skyMgr->propagateParameters();
360 }
361
362 if (regionSet.enabled)
363 {
364 waterMgr->setParamSet( regionSet.water.mName, regionSet.water );
365 skyMgr->setParamSet( regionSet.sky.mName, regionSet.sky );
366 mergeWaterSets(&(regionSet.water), &oldWaterSet);
367 mergeWLSets(&(regionSet.sky), &oldWLSet);
368 }
369 else
370 {
371 waterMgr->removeParamSet( regionSet.water.mName, false );
372 skyMgr->removeParamSet( regionSet.sky.mName, false );
373 }
374 if (parcelSet.enabled)
375 {
376 waterMgr->setParamSet( parcelSet.water.mName, parcelSet.water );
377 skyMgr->setParamSet( parcelSet.sky.mName, parcelSet.sky );
378 mergeWaterSets(&(parcelSet.water), &oldWaterSet);
379 mergeWLSets(&(parcelSet.sky), &oldWLSet);
380 }
381 else
382 {
383 waterMgr->removeParamSet( parcelSet.water.mName, false );
384 skyMgr->removeParamSet( parcelSet.sky.mName, false );
385 }
386 if (userSet.enabled)
387 {
388 mergeWaterSets(&(userSet.water), &oldWaterSet);
389 mergeWLSets(&(userSet.sky), &oldWLSet);
390 }
391 if (RLVSet.enabled)
392 {
393 mergeWaterSets(&(RLVSet.water), &oldWaterSet);
394 mergeWLSets(&(RLVSet.sky), &oldWLSet);
395 }
396
397 skyMgr->mAnimator.mIsRunning = false;
398 skyMgr->mAnimator.mUseLindenTime = false;
399 if (fade)
400 {
401 waterMgr->SetMixTime(&oldWaterSet, fade);
402 skyMgr->SetMixTime(&oldWLSet, fade);
403 }
404 else
405 {
406 if (newWater)
407 {
408 waterMgr->setParamSet( thisSet->water.mName, oldWaterSet );
409 waterMgr->setNormalMapID( *newWaterNormal );
410 waterMgr->getParamSet(thisSet->water.mName, waterMgr->mCurParams);
411 waterMgr->propagateParameters();
412 }
413
414 if (newSky)
415 {
416 skyMgr->setParamSet( thisSet->sky.mName, oldWLSet );
417 skyMgr->getParamSet(thisSet->sky.mName, skyMgr->mCurParams);
418 skyMgr->propagateParameters();
419 }
420 }
421
422 LLWorld::getInstance()->rebuildClouds(gAgent.getRegion());
252} 423}
253 424
425bool LightShare::isValid()
426{
427 return mIsValid;
428}
254 429
255void WindlightMessage::process_packet( char* buf ) 430void LightShare::process_packet( char* buf )
256{ 431{
257 // *FIXME: Horrible idea, fragile, not byte-order or endian 432 // *FIXME: Horrible idea, fragile, not byte-order or endian
258 // safe, no validation, etc. etc. -Jacek 433 // safe, no validation, etc. etc. -Jacek
259 mPacket = (Meta7WindlightPacket*)buf; 434 mPacket = (Meta7WindlightPacket*)buf;
260} 435}
261 436
262 437void LightShare::process_water()
263void WindlightMessage::process_water()
264{ 438{
265 mWater->set("waterFogColor", 439 mWater->set("waterFogColor",
266 mPacket->waterColor.red / 256.f, 440 mPacket->waterColor.red / 256.f,
@@ -316,7 +490,7 @@ void WindlightMessage::process_water()
316} 490}
317 491
318 492
319void WindlightMessage::process_sky() 493void LightShare::process_sky()
320{ 494{
321 mSky->setSunAngle(F_TWO_PI * mPacket->sunMoonPosiiton); 495 mSky->setSunAngle(F_TWO_PI * mPacket->sunMoonPosiiton);
322 mSky->setEastAngle(F_TWO_PI * mPacket->eastAngle); 496 mSky->setEastAngle(F_TWO_PI * mPacket->eastAngle);
@@ -411,5 +585,3 @@ void WindlightMessage::process_sky()
411 585
412 mSky->setStarBrightness(mPacket->starBrightness); 586 mSky->setStarBrightness(mPacket->starBrightness);
413} 587}
414
415
diff --git a/linden/indra/newview/lightshare.h b/linden/indra/newview/llettherebelight.h
index e3cccf0..3c997e5 100644
--- a/linden/indra/newview/lightshare.h
+++ b/linden/indra/newview/llettherebelight.h
@@ -1,5 +1,5 @@
1/** 1/**
2 * @file lightshare.h 2 * @file llettherebelight.h
3 * @brief WindlightMessage class definition. 3 * @brief WindlightMessage class definition.
4 * 4 *
5 * Copyright (c) 2010, Jacek Antonelli 5 * Copyright (c) 2010, Jacek Antonelli
@@ -30,23 +30,34 @@
30#define LIGHTSHARE_H 30#define LIGHTSHARE_H
31 31
32#include <string> 32#include <string>
33#include "llwlparamset.h"
34#include "llwaterparamset.h"
35#include "lluuid.h"
33 36
34struct Meta7WindlightPacket; 37struct Meta7WindlightPacket;
35class LLMessageSystem;
36class LLSD;
37class LLTimer;
38class LLUUID;
39class LLWaterParamSet;
40class LLWLParamSet;
41 38
42 39
40typedef enum wl_scope
41{
42 WL_SCOPE_USER,
43 WL_SCOPE_REGION,
44 WL_SCOPE_PARCEL,
45 WL_SCOPE_RLV
46} WLScope;
47
48struct WLCombined
49{
50 LLWaterParamSet water;
51 LLWLParamSet sky;
52 BOOL enabled;
53};
54
43// Encapsulates a "Windlight" (LightShare) message sent from the 55// Encapsulates a "Windlight" (LightShare) message sent from the
44// region, allowing the settings to be applied at a later time. 56// region, allowing the settings to be applied at a later time.
45// 57//
46class WindlightMessage 58class LightShare
47{ 59{
48 public: 60public:
49
50 // The meanings of the LightShareAllowed user setting. 61 // The meanings of the LightShareAllowed user setting.
51 enum LIGHTSHARE_ALLOWED 62 enum LIGHTSHARE_ALLOWED
52 { 63 {
@@ -55,61 +66,49 @@ class WindlightMessage
55 LIGHTSHARE_ALWAYS = 2, 66 LIGHTSHARE_ALWAYS = 2,
56 }; 67 };
57 68
58 // Constructs a new WindlightMessage instance from a GenericMessage 69 // The name of the preset where the region settings are stored.
70 static const std::string sRegionPresetName;
71 // The name of the preset where the parcel settings are stored.
72 static const std::string sParcelPresetName;
73 // The name of the preset where the RLV settings are stored.
74 static const std::string sRLVPresetName;
75
76 // Constructs a new LightShare instance from a GenericMessage
59 // with the "Windlight" method, such as those sent by a 77 // with the "Windlight" method, such as those sent by a
60 // Lightshare-enabled OpenSim region. 78 // Lightshare-enabled OpenSim region.
61 WindlightMessage( LLMessageSystem* msg ); 79 LightShare( LLMessageSystem* msg );
62 80
63 ~WindlightMessage(); 81 ~LightShare();
64
65 // The name of the water preset where the region settings are stored.
66 static const std::string sWaterPresetName;
67
68 // The name of the sky preset where the region settings are stored.
69 static const std::string sSkyPresetName;
70 82
71 // Message handler for GenericMessage with the "Windlight" method. 83 // Message handler for GenericMessage with the "Windlight" method.
72 // Creates and applies a new WindlightMessage (or prompts user). 84 // Creates and applies a new LightShare (or prompts user).
73 static void processWindlight(LLMessageSystem* msg, void**); 85 static void processWindlight(LLMessageSystem* msg, void**);
74 86
75 // Callback when the user interacts with the notification. 87 static void applyMaybe(LLWaterParamSet* thisWater, LLUUID* thisVaterNormal, LLWLParamSet* thisSky);
76 static bool applyCallback(const LLSD& notification,
77 const LLSD& response);
78 88
79 // Called after the user has entered a new region, to reset the 89 // Called after the user has entered a new region, to reset the
80 // "ignore while in this region" state. 90 // "ignore while in this region" state.
81 static void resetRegion(); 91 static void resetRegion();
82 92
83 // Applies/activates the Windlight settings from the message.
84 bool apply();
85
86 // Returns true if the message contains valid Windlight settings. 93 // Returns true if the message contains valid Windlight settings.
87 // (But there's no real validation yet, so this is always true.) 94 // (But there's no real validation yet, so this is always true.)
88 bool isValid(); 95 bool isValid();
89 96
97 static void apply(LLWaterParamSet * newWater, LLUUID *newWaterNormal, LLWLParamSet *newSky, WLScope scope);
90 98
91 protected: 99private:
92
93 // Restart the timer for temporarily ignoring settings.
94 static void restartIgnoreTimer();
95
96 // Returns true if the ignore timer has expired (i.e. new settings
97 // should not be ignored anymore).
98 static bool ignoreTimerHasExpired();
99
100
101 private:
102
103 static WindlightMessage* sMostRecent;
104 static LLTimer* sIgnoreTimer; 100 static LLTimer* sIgnoreTimer;
105 static bool sIgnoreRegion; 101 static bool sIgnoreRegion;
106 102
107 Meta7WindlightPacket* mPacket; 103 Meta7WindlightPacket* mPacket;
108 LLWaterParamSet* mWater; 104 static LLWaterParamSet* mWater;
109 LLWLParamSet* mSky; 105 static LLWLParamSet* mSky;
110 LLUUID* mWaterNormal; 106 static LLUUID* mWaterNormal;
111 bool mIsValid; 107 bool mIsValid;
112 108
109 // Callback when the user interacts with the notification.
110 static bool applyCallback(const LLSD& notification, const LLSD& response);
111
113 // Converts the message's raw bytes into a Meta7WindlightPacket. 112 // Converts the message's raw bytes into a Meta7WindlightPacket.
114 void process_packet( char* buf ); 113 void process_packet( char* buf );
115 114
@@ -119,6 +118,15 @@ class WindlightMessage
119 // Constructs a LLWLParamSet from the Meta7WindlightPacket. 118 // Constructs a LLWLParamSet from the Meta7WindlightPacket.
120 void process_sky(); 119 void process_sky();
121 120
121 // Restart the timer for temporarily ignoring settings.
122 static void restartIgnoreTimer();
123
124 // Returns true if the ignore timer has expired (i.e. new settings
125 // should not be ignored anymore).
126 static bool ignoreTimerHasExpired();
127
128 static void mergeWaterSets(LLWaterParamSet* thisSet, LLWaterParamSet* oldSet);
129 static void mergeWLSets(LLWLParamSet* thisSet, LLWLParamSet* oldSet);
122}; 130};
123 131
124#endif 132#endif
diff --git a/linden/indra/newview/llfloaterenvsettings.cpp b/linden/indra/newview/llfloaterenvsettings.cpp
index 801ff49..2cb1988 100644
--- a/linden/indra/newview/llfloaterenvsettings.cpp
+++ b/linden/indra/newview/llfloaterenvsettings.cpp
@@ -291,21 +291,6 @@ void LLFloaterEnvSettings::onOpenWLManager(void* userData)
291 WLFloaterManager::show(); 291 WLFloaterManager::show();
292} 292}
293 293
294void LLFloaterEnvSettings::onSubmitWindlight(void* userData)
295{
296 Meta7WindlightPacket * wl = new Meta7WindlightPacket();
297
298 LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
299 wl->reflectionWaveletScale.X = param_mgr->mNormalScale.mX;
300 wl->reflectionWaveletScale.Y = param_mgr->mNormalScale.mY;
301 wl->reflectionWaveletScale.Z = param_mgr->mNormalScale.mZ;
302
303
304 std::vector<std::string> strings;
305 strings.push_back((char*)wl);
306 send_generic_message("Windlight", strings);
307}
308
309void LLFloaterEnvSettings::onUseEstateTime(void* userData) 294void LLFloaterEnvSettings::onUseEstateTime(void* userData)
310{ 295{
311 if(LLFloaterWindLight::isOpen()) 296 if(LLFloaterWindLight::isOpen())
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp
index 3530f54..9dd3aab 100644
--- a/linden/indra/newview/llfloaterwater.cpp
+++ b/linden/indra/newview/llfloaterwater.cpp
@@ -1,11 +1,11 @@
1/** 1/**
2 * @file llfloaterwater.cpp 2 * @file llfloaterwater.cpp
3 * @brief LLFloaterWater class definition 3 * @brief LLFloaterWater class definition
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.
@@ -62,6 +62,7 @@
62 62
63#include "llwaterparamset.h" 63#include "llwaterparamset.h"
64#include "llwaterparammanager.h" 64#include "llwaterparammanager.h"
65#include "llwlparammanager.h"
65#include "llpostprocess.h" 66#include "llpostprocess.h"
66 67
67#include "wlfloaterwindlightsend.h" 68#include "wlfloaterwindlightsend.h"
@@ -75,15 +76,15 @@ std::set<std::string> LLFloaterWater::sDefaultPresets;
75LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) 76LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater"))
76{ 77{
77 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); 78 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml");
78 79
79 // add the combo boxes 80 // add the combo boxes
80 LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); 81 LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo");
81 82
82 if(comboBox != NULL) { 83 if(comboBox != NULL) {
83 84
84 std::map<std::string, LLWaterParamSet>::iterator mIt = 85 std::map<std::string, LLWaterParamSet>::iterator mIt =
85 LLWaterParamManager::instance()->mParamList.begin(); 86 LLWaterParamManager::instance()->mParamList.begin();
86 for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) 87 for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++)
87 { 88 {
88 comboBox->add(mIt->first); 89 comboBox->add(mIt->first);
89 } 90 }
@@ -117,7 +118,7 @@ void LLFloaterWater::initCallbacks(void) {
117 initHelpBtn("WaterFogColorHelp", "HelpWaterFogColor"); 118 initHelpBtn("WaterFogColorHelp", "HelpWaterFogColor");
118 initHelpBtn("WaterFogDensityHelp", "HelpWaterFogDensity"); 119 initHelpBtn("WaterFogDensityHelp", "HelpWaterFogDensity");
119 initHelpBtn("WaterUnderWaterFogModHelp", "HelpUnderWaterFogMod"); 120 initHelpBtn("WaterUnderWaterFogModHelp", "HelpUnderWaterFogMod");
120 initHelpBtn("WaterGlowHelp", "HelpWaterGlow"); 121 initHelpBtn("WaterGlowHelp", "HelpWaterGlow");
121 initHelpBtn("WaterNormalScaleHelp", "HelpWaterNormalScale"); 122 initHelpBtn("WaterNormalScaleHelp", "HelpWaterNormalScale");
122 initHelpBtn("WaterFresnelScaleHelp", "HelpWaterFresnelScale"); 123 initHelpBtn("WaterFresnelScaleHelp", "HelpWaterFresnelScale");
123 initHelpBtn("WaterFresnelOffsetHelp", "HelpWaterFresnelOffset"); 124 initHelpBtn("WaterFresnelOffsetHelp", "HelpWaterFresnelOffset");
@@ -134,7 +135,7 @@ void LLFloaterWater::initCallbacks(void) {
134 135
135 childSetCommitCallback("WaterFogColor", onWaterFogColorMoved, &param_mgr->mFogColor); 136 childSetCommitCallback("WaterFogColor", onWaterFogColorMoved, &param_mgr->mFogColor);
136 137
137 // 138 //
138 childSetCommitCallback("WaterGlow", onColorControlAMoved, &param_mgr->mFogColor); 139 childSetCommitCallback("WaterGlow", onColorControlAMoved, &param_mgr->mFogColor);
139 140
140 // fog density 141 // fog density
@@ -212,11 +213,11 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res
212 213
213 // add the current parameters to the list 214 // add the current parameters to the list
214 // see if it's there first 215 // see if it's there first
215 std::map<std::string, LLWaterParamSet>::iterator mIt = 216 std::map<std::string, LLWaterParamSet>::iterator mIt =
216 param_mgr->mParamList.find(text); 217 param_mgr->mParamList.find(text);
217 218
218 // if not there, add a new one 219 // if not there, add a new one
219 if(mIt == param_mgr->mParamList.end()) 220 if(mIt == param_mgr->mParamList.end())
220 { 221 {
221 param_mgr->addParamSet(text, param_mgr->mCurParams); 222 param_mgr->addParamSet(text, param_mgr->mCurParams);
222 comboBox->add(text); 223 comboBox->add(text);
@@ -227,8 +228,8 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res
227 param_mgr->savePreset(text); 228 param_mgr->savePreset(text);
228 229
229 // otherwise, send a message to the user 230 // otherwise, send a message to the user
230 } 231 }
231 else 232 else
232 { 233 {
233 LLNotifications::instance().add("ExistsWaterPresetAlert"); 234 LLNotifications::instance().add("ExistsWaterPresetAlert");
234 } 235 }
@@ -261,13 +262,13 @@ void LLFloaterWater::syncMenu()
261 colCtrl->set(col); 262 colCtrl->set(col);
262 263
263 // fog and wavelets 264 // fog and wavelets
264 param_mgr->mFogDensity.mExp = 265 param_mgr->mFogDensity.mExp =
265 log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / 266 log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) /
266 log(param_mgr->mFogDensity.mBase); 267 log(param_mgr->mFogDensity.mBase);
267 param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); 268 param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp);
268 childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp); 269 childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp);
269 270
270 param_mgr->mUnderWaterFogMod.mX = 271 param_mgr->mUnderWaterFogMod.mX =
271 current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); 272 current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err);
272 childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX); 273 childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX);
273 274
@@ -433,14 +434,14 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, void* userData)
433 colorControl->mR = sldrCtrl->getValueF32(); 434 colorControl->mR = sldrCtrl->getValueF32();
434 435
435 // move i if it's the max 436 // move i if it's the max
436 if(colorControl->mR >= colorControl->mG 437 if(colorControl->mR >= colorControl->mG
437 && colorControl->mR >= colorControl->mB 438 && colorControl->mR >= colorControl->mB
438 && colorControl->mHasSliderName) 439 && colorControl->mHasSliderName)
439 { 440 {
440 colorControl->mI = colorControl->mR; 441 colorControl->mI = colorControl->mR;
441 std::string name = colorControl->mSliderName; 442 std::string name = colorControl->mSliderName;
442 name.append("I"); 443 name.append("I");
443 444
444 sWaterMenu->childSetValue(name, colorControl->mR); 445 sWaterMenu->childSetValue(name, colorControl->mR);
445 } 446 }
446 447
@@ -457,7 +458,7 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, void* userData)
457 colorControl->mG = sldrCtrl->getValueF32(); 458 colorControl->mG = sldrCtrl->getValueF32();
458 459
459 // move i if it's the max 460 // move i if it's the max
460 if(colorControl->mG >= colorControl->mR 461 if(colorControl->mG >= colorControl->mR
461 && colorControl->mG >= colorControl->mB 462 && colorControl->mG >= colorControl->mB
462 && colorControl->mHasSliderName) 463 && colorControl->mHasSliderName)
463 { 464 {
@@ -517,9 +518,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData)
517 WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); 518 WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData);
518 519
519 colorControl->mI = sldrCtrl->getValueF32(); 520 colorControl->mI = sldrCtrl->getValueF32();
520 521
521 // only for sliders where we pass a name 522 // only for sliders where we pass a name
522 if(colorControl->mHasSliderName) 523 if(colorControl->mHasSliderName)
523 { 524 {
524 // set it to the top 525 // set it to the top
525 F32 maxVal = std::max(std::max(colorControl->mR, colorControl->mG), colorControl->mB); 526 F32 maxVal = std::max(std::max(colorControl->mR, colorControl->mG), colorControl->mB);
@@ -541,7 +542,7 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData)
541 colorControl->mR = 0; 542 colorControl->mR = 0;
542 colorControl->mG = 0; 543 colorControl->mG = 0;
543 colorControl->mB = 0; 544 colorControl->mB = 0;
544 545
545 // if all at the start 546 // if all at the start
546 // set them all to the intensity 547 // set them all to the intensity
547 } 548 }
@@ -597,7 +598,7 @@ void LLFloaterWater::onFloatControlMoved(LLUICtrl* ctrl, void* userData)
597void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, void* userData) 598void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, void* userData)
598{ 599{
599 LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); 600 LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
600 WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); 601 WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData);
601 *colorControl = swatch->get(); 602 *colorControl = swatch->get();
602 603
603 colorControl->update(LLWaterParamManager::instance()->mCurParams); 604 colorControl->update(LLWaterParamManager::instance()->mCurParams);
@@ -652,7 +653,7 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData)
652 } 653 }
653 654
654 if (ctrl->getValue().asString() == "save_inventory_item") 655 if (ctrl->getValue().asString() == "save_inventory_item")
655 { 656 {
656 // Check if this is already a notecard. 657 // Check if this is already a notecard.
657 if(LLWaterParamManager::instance()->mCurParams.mInventoryID.notNull()) 658 if(LLWaterParamManager::instance()->mCurParams.mInventoryID.notNull())
658 { 659 {
@@ -662,13 +663,13 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData)
662 { 663 {
663 // Make sure we have a ".ww" extension. 664 // Make sure we have a ".ww" extension.
664 std::string name = comboBox->getSelectedItemLabel(); 665 std::string name = comboBox->getSelectedItemLabel();
665 if(name.length() > 2 && name.compare(name.length() - 3, 3, ".ww") != 0) 666 if(!LLWLParamManager::isWaterSettingsNotecard(name))
666 { 667 {
667 name += ".ww"; 668 name += ".ww";
668 } 669 }
669 LLPointer<KVFloaterWaterNotecardCreatedCallback> cb = new KVFloaterWaterNotecardCreatedCallback(); 670 LLPointer<KVFloaterWaterNotecardCreatedCallback> cb = new KVFloaterWaterNotecardCreatedCallback();
670 // Create a notecard and then save it. 671 // Create a notecard and then save it.
671 create_inventory_item(gAgent.getID(), 672 create_inventory_item(gAgent.getID(),
672 gAgent.getSessionID(), 673 gAgent.getSessionID(),
673 LLUUID::null, 674 LLUUID::null,
674 LLTransactionID::tnull, 675 LLTransactionID::tnull,
@@ -679,7 +680,7 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData)
679 NOT_WEARABLE, 680 NOT_WEARABLE,
680 PERM_ITEM_UNRESTRICTED, 681 PERM_ITEM_UNRESTRICTED,
681 cb); 682 cb);
682 683
683 } 684 }
684 } 685 }
685 else if (ctrl->getValue().asString() == "send_to_server_item") 686 else if (ctrl->getValue().asString() == "send_to_server_item")
@@ -690,13 +691,13 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData)
690 } 691 }
691 else 692 else
692 { 693 {
693 LLWaterParamManager::instance()->mCurParams.mName = 694 LLWaterParamManager::instance()->mCurParams.mName =
694 comboBox->getSelectedItemLabel(); 695 comboBox->getSelectedItemLabel();
695 696
696 // check to see if it's a default and shouldn't be overwritten 697 // check to see if it's a default and shouldn't be overwritten
697 std::set<std::string>::iterator sIt = sDefaultPresets.find( 698 std::set<std::string>::iterator sIt = sDefaultPresets.find(
698 comboBox->getSelectedItemLabel()); 699 comboBox->getSelectedItemLabel());
699 if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) 700 if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets"))
700 { 701 {
701 LLNotifications::instance().add("WLNoEditDefault"); 702 LLNotifications::instance().add("WLNoEditDefault");
702 return; 703 return;
@@ -710,7 +711,7 @@ bool LLFloaterWater::saveNotecardCallback(const LLSD& notification, const LLSD&
710{ 711{
711 S32 option = LLNotification::getSelectedOption(notification, response); 712 S32 option = LLNotification::getSelectedOption(notification, response);
712 // if they choose save, do it. Otherwise, don't do anything 713 // if they choose save, do it. Otherwise, don't do anything
713 if(option == 0) 714 if(option == 0)
714 { 715 {
715 LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); 716 LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
716 param_mgr->setParamSet(param_mgr->mCurParams.mName, param_mgr->mCurParams); 717 param_mgr->setParamSet(param_mgr->mCurParams.mName, param_mgr->mCurParams);
@@ -723,12 +724,12 @@ bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& res
723{ 724{
724 S32 option = LLNotification::getSelectedOption(notification, response); 725 S32 option = LLNotification::getSelectedOption(notification, response);
725 // if they choose save, do it. Otherwise, don't do anything 726 // if they choose save, do it. Otherwise, don't do anything
726 if(option == 0) 727 if(option == 0)
727 { 728 {
728 LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); 729 LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
729 730
730 param_mgr->setParamSet( 731 param_mgr->setParamSet(
731 param_mgr->mCurParams.mName, 732 param_mgr->mCurParams.mName,
732 param_mgr->mCurParams); 733 param_mgr->mCurParams);
733 734
734 // comment this back in to save to file 735 // comment this back in to save to file
@@ -755,13 +756,13 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r
755{ 756{
756 S32 option = LLNotification::getSelectedOption(notification, response); 757 S32 option = LLNotification::getSelectedOption(notification, response);
757 // if they choose delete, do it. Otherwise, don't do anything 758 // if they choose delete, do it. Otherwise, don't do anything
758 if(option == 0) 759 if(option == 0)
759 { 760 {
760 LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); 761 LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo");
761 LLFloaterDayCycle* day_cycle = NULL; 762 LLFloaterDayCycle* day_cycle = NULL;
762 LLComboBox* key_combo = NULL; 763 LLComboBox* key_combo = NULL;
763 764
764 if(LLFloaterDayCycle::isOpen()) 765 if(LLFloaterDayCycle::isOpen())
765 { 766 {
766 day_cycle = LLFloaterDayCycle::instance(); 767 day_cycle = LLFloaterDayCycle::instance();
767 key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); 768 key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets");
@@ -771,20 +772,20 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r
771 772
772 // check to see if it's a default and shouldn't be deleted 773 // check to see if it's a default and shouldn't be deleted
773 std::set<std::string>::iterator sIt = sDefaultPresets.find(name); 774 std::set<std::string>::iterator sIt = sDefaultPresets.find(name);
774 if(sIt != sDefaultPresets.end()) 775 if(sIt != sDefaultPresets.end())
775 { 776 {
776 LLNotifications::instance().add("WaterNoEditDefault"); 777 LLNotifications::instance().add("WaterNoEditDefault");
777 return false; 778 return false;
778 } 779 }
779 780
780 LLWaterParamManager::instance()->removeParamSet(name, true); 781 LLWaterParamManager::instance()->removeParamSet(name, true);
781 782
782 // remove and choose another 783 // remove and choose another
783 S32 new_index = combo_box->getCurrentIndex(); 784 S32 new_index = combo_box->getCurrentIndex();
784 785
785 combo_box->remove(name); 786 combo_box->remove(name);
786 787
787 if(key_combo != NULL) 788 if(key_combo != NULL)
788 { 789 {
789 key_combo->remove(name); 790 key_combo->remove(name);
790 791
@@ -793,12 +794,12 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r
793 } 794 }
794 795
795 // pick the previously selected index after delete 796 // pick the previously selected index after delete
796 if(new_index > 0) 797 if(new_index > 0)
797 { 798 {
798 new_index--; 799 new_index--;
799 } 800 }
800 801
801 if(combo_box->getItemCount() > 0) 802 if(combo_box->getItemCount() > 0)
802 { 803 {
803 combo_box->setCurrentByIndex(new_index); 804 combo_box->setCurrentByIndex(new_index);
804 } 805 }
@@ -810,12 +811,12 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r
810void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) 811void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData)
811{ 812{
812 LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); 813 LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl);
813 814
814 if(combo_box->getSimple() == "") 815 if(combo_box->getSimple() == "")
815 { 816 {
816 return; 817 return;
817 } 818 }
818 819
819 LLWaterParamManager::instance()->loadPreset( 820 LLWaterParamManager::instance()->loadPreset(
820 combo_box->getSelectedValue().asString()); 821 combo_box->getSelectedValue().asString());
821 sWaterMenu->syncMenu(); 822 sWaterMenu->syncMenu();
@@ -827,12 +828,12 @@ void LLFloaterWater::onClickNext(void* user_data)
827 LLWaterParamSet& currentParams = param_mgr->mCurParams; 828 LLWaterParamSet& currentParams = param_mgr->mCurParams;
828 829
829 // find place of current param 830 // find place of current param
830 std::map<std::string, LLWaterParamSet>::iterator mIt = 831 std::map<std::string, LLWaterParamSet>::iterator mIt =
831 param_mgr->mParamList.find(currentParams.mName); 832 param_mgr->mParamList.find(currentParams.mName);
832 833
833 // if at the end, loop 834 // if at the end, loop
834 std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; 835 std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last;
835 if(mIt == last) 836 if(mIt == last)
836 { 837 {
837 mIt = param_mgr->mParamList.begin(); 838 mIt = param_mgr->mParamList.begin();
838 } 839 }
@@ -851,11 +852,11 @@ void LLFloaterWater::onClickPrev(void* user_data)
851 LLWaterParamSet & currentParams = param_mgr->mCurParams; 852 LLWaterParamSet & currentParams = param_mgr->mCurParams;
852 853
853 // find place of current param 854 // find place of current param
854 std::map<std::string, LLWaterParamSet>::iterator mIt = 855 std::map<std::string, LLWaterParamSet>::iterator mIt =
855 param_mgr->mParamList.find(currentParams.mName); 856 param_mgr->mParamList.find(currentParams.mName);
856 857
857 // if at the beginning, loop 858 // if at the beginning, loop
858 if(mIt == param_mgr->mParamList.begin()) 859 if(mIt == param_mgr->mParamList.begin())
859 { 860 {
860 std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; 861 std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last;
861 mIt = last; 862 mIt = last;
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp
index 8f2eafb..52d6e14 100644
--- a/linden/indra/newview/llfloaterwindlight.cpp
+++ b/linden/indra/newview/llfloaterwindlight.cpp
@@ -873,7 +873,7 @@ void LLFloaterWindLight::onSavePreset(LLUICtrl* ctrl, void* userData)
873 { 873 {
874 // Make sure we have a ".wl" extension. 874 // Make sure we have a ".wl" extension.
875 std::string name = comboBox->getSelectedItemLabel(); 875 std::string name = comboBox->getSelectedItemLabel();
876 if(name.length() > 2 && name.compare(name.length() - 3, 3, ".wl") != 0) 876 if(!LLWLParamManager::isSkySettingsNotecard(name))
877 { 877 {
878 name += ".wl"; 878 name += ".wl";
879 } 879 }
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index c67c3c2..6e6b39c 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -3109,11 +3109,11 @@ void LLNotecardBridge::openItem()
3109 LLViewerInventoryItem* item = getItem(); 3109 LLViewerInventoryItem* item = getItem();
3110 if (item) 3110 if (item)
3111 { 3111 {
3112 if(isSkySetting()) 3112 if(LLWLParamManager::isSkySettingsNotecard(getName()))
3113 { 3113 {
3114 LLWLParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID); 3114 LLWLParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID);
3115 } 3115 }
3116 else if(isWaterSetting()) 3116 else if(LLWLParamManager::isWaterSettingsNotecard(getName()))
3117 { 3117 {
3118 LLWaterParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID); 3118 LLWaterParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID);
3119 } 3119 }
@@ -3144,13 +3144,13 @@ void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
3144 else 3144 else
3145 { 3145 {
3146 3146
3147 if(isWindLight()) 3147 if(LLWLParamManager::isSettingsNotecard(getName()))
3148 { 3148 {
3149 if(isSkySetting()) 3149 if(LLWLParamManager::isSkySettingsNotecard(getName()))
3150 { 3150 {
3151 items.push_back(std::string("Use WindLight Settings")); 3151 items.push_back(std::string("Use WindLight Settings"));
3152 } 3152 }
3153 else if(isWaterSetting()) 3153 else if(LLWLParamManager::isWaterSettingsNotecard(getName()))
3154 { 3154 {
3155 items.push_back(std::string("Use WaterLight Settings")); 3155 items.push_back(std::string("Use WaterLight Settings"));
3156 } 3156 }
@@ -3207,11 +3207,11 @@ void LLNotecardBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
3207 3207
3208LLUIImagePtr LLNotecardBridge::getIcon() const 3208LLUIImagePtr LLNotecardBridge::getIcon() const
3209{ 3209{
3210 if(isSkySetting()) 3210 if(LLWLParamManager::isSkySettingsNotecard(getName()))
3211 { 3211 {
3212 return LLUI::getUIImage("Inv_WindLight"); 3212 return LLUI::getUIImage("Inv_WindLight");
3213 } 3213 }
3214 else if(isWaterSetting()) 3214 else if(LLWLParamManager::isWaterSettingsNotecard(getName()))
3215 { 3215 {
3216 return LLUI::getUIImage("Inv_WaterLight"); 3216 return LLUI::getUIImage("Inv_WaterLight");
3217 } 3217 }
@@ -3221,20 +3221,6 @@ LLUIImagePtr LLNotecardBridge::getIcon() const
3221 } 3221 }
3222} 3222}
3223 3223
3224bool LLNotecardBridge::isSkySetting() const
3225{
3226 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0);
3227}
3228
3229bool LLNotecardBridge::isWaterSetting() const
3230{
3231 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".ww") == 0);
3232}
3233
3234bool LLNotecardBridge::isWindLight() const
3235{
3236 return (isSkySetting() || isWaterSetting());
3237}
3238 3224
3239// +=================================================+ 3225// +=================================================+
3240// | LLGestureBridge | 3226// | LLGestureBridge |
diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h
index 5a53aa5..0318e6c 100644
--- a/linden/indra/newview/llinventorybridge.h
+++ b/linden/indra/newview/llinventorybridge.h
@@ -511,9 +511,6 @@ public:
511 virtual const std::string& getPrefix() { return sPrefix; } 511 virtual const std::string& getPrefix() { return sPrefix; }
512 512
513 virtual LLUIImagePtr getIcon() const; 513 virtual LLUIImagePtr getIcon() const;
514 bool isSkySetting() const;
515 bool isWaterSetting() const;
516 bool isWindLight() const;
517 virtual void openItem(); 514 virtual void openItem();
518 virtual void buildContextMenu(LLMenuGL& menu, U32 flags); 515 virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
519 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); 516 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp
index 277ab15..8103ee9 100644
--- a/linden/indra/newview/llpanelinventory.cpp
+++ b/linden/indra/newview/llpanelinventory.cpp
@@ -81,6 +81,7 @@
81#include "llviewerobjectlist.h" 81#include "llviewerobjectlist.h"
82#include "llviewerwindow.h" 82#include "llviewerwindow.h"
83#include "llwearable.h" 83#include "llwearable.h"
84#include "llwlparammanager.h"
84 85
85#include "hippogridmanager.h" 86#include "hippogridmanager.h"
86 87
@@ -1380,9 +1381,6 @@ public:
1380 virtual LLUIImagePtr getIcon() const; 1381 virtual LLUIImagePtr getIcon() const;
1381 virtual void openItem(); 1382 virtual void openItem();
1382 virtual BOOL removeItem(); 1383 virtual BOOL removeItem();
1383 bool isSkySetting() const;
1384 bool isWaterSetting() const;
1385 bool isWindLight() const;
1386}; 1384};
1387 1385
1388LLTaskNotecardBridge::LLTaskNotecardBridge( 1386LLTaskNotecardBridge::LLTaskNotecardBridge(
@@ -1412,7 +1410,7 @@ void LLTaskNotecardBridge::openItem()
1412 return; 1410 return;
1413 } 1411 }
1414// [/RLVa:KB] 1412// [/RLVa:KB]
1415 if(isWindLight()) 1413 if(LLWLParamManager::isSettingsNotecard(getName()))
1416 { 1414 {
1417 return; 1415 return;
1418 } 1416 }
@@ -1442,11 +1440,11 @@ BOOL LLTaskNotecardBridge::removeItem()
1442} 1440}
1443LLUIImagePtr LLTaskNotecardBridge::getIcon() const 1441LLUIImagePtr LLTaskNotecardBridge::getIcon() const
1444{ 1442{
1445 if(isSkySetting()) 1443 if(LLWLParamManager::isSkySettingsNotecard(getName()))
1446 { 1444 {
1447 return LLUI::getUIImage("Inv_WindLight"); 1445 return LLUI::getUIImage("Inv_WindLight");
1448 } 1446 }
1449 else if(isWaterSetting()) 1447 else if(LLWLParamManager::isWaterSettingsNotecard(getName()))
1450 { 1448 {
1451 return LLUI::getUIImage("Inv_WaterLight"); 1449 return LLUI::getUIImage("Inv_WaterLight");
1452 } 1450 }
@@ -1456,22 +1454,6 @@ LLUIImagePtr LLTaskNotecardBridge::getIcon() const
1456 } 1454 }
1457} 1455}
1458 1456
1459bool LLTaskNotecardBridge::isSkySetting() const
1460{
1461 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0);
1462}
1463
1464bool LLTaskNotecardBridge::isWaterSetting() const
1465{
1466 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".ww") == 0);
1467}
1468
1469bool LLTaskNotecardBridge::isWindLight() const
1470{
1471 return (isSkySetting() || isWaterSetting());
1472}
1473
1474
1475///---------------------------------------------------------------------------- 1457///----------------------------------------------------------------------------
1476/// Class LLTaskGestureBridge 1458/// Class LLTaskGestureBridge
1477///---------------------------------------------------------------------------- 1459///----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llviewergenericmessage.cpp b/linden/indra/newview/llviewergenericmessage.cpp
index 8078888..779ed01 100644
--- a/linden/indra/newview/llviewergenericmessage.cpp
+++ b/linden/indra/newview/llviewergenericmessage.cpp
@@ -1,12 +1,12 @@
1/** 1/**
2 * @file llviewergenericmessage.cpp 2 * @file llviewergenericmessage.cpp
3 * @brief Handle processing of "generic messages" which contain short lists of strings. 3 * @brief Handle processing of "generic messages" which contain short lists of strings.
4 * @author James Cook 4 * @author James Cook
5 * 5 *
6 * $LicenseInfo:firstyear=2007&license=viewergpl$ 6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2007-2009, Linden Research, Inc. 8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0 12 * to you under the terms of the GNU General Public License, version 2.0
@@ -14,17 +14,17 @@
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception 22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 * 23 *
24 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations. 26 * and agree to abide by those obligations.
27 * 27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE. 30 * COMPLETENESS OR PERFORMANCE.
@@ -39,7 +39,7 @@
39#include "message.h" 39#include "message.h"
40#include "llagent.h" 40#include "llagent.h"
41#include "lluuid.h" 41#include "lluuid.h"
42#include "lightshare.h" 42#include "llettherebelight.h"
43 43
44 44
45LLDispatcher gGenericDispatcher; 45LLDispatcher gGenericDispatcher;
@@ -84,11 +84,11 @@ void process_generic_message(LLMessageSystem* msg, void**)
84 msg->getUUID("AgentData", "AgentID", agent_id); 84 msg->getUUID("AgentData", "AgentID", agent_id);
85 std::string method; 85 std::string method;
86 msg->getStringFast(_PREHASH_MethodData, _PREHASH_Method, method); 86 msg->getStringFast(_PREHASH_MethodData, _PREHASH_Method, method);
87 87
88 // TODO: Use a proper dispatcher. 88 // TODO: Use a proper dispatcher.
89 if(method == "Windlight") 89 if(method == "Windlight")
90 { 90 {
91 WindlightMessage::processWindlight(msg, NULL); 91 LightShare::processWindlight(msg, NULL);
92 return; 92 return;
93 } 93 }
94 94
@@ -106,7 +106,7 @@ void process_generic_message(LLMessageSystem* msg, void**)
106 106
107 if(!gGenericDispatcher.dispatch(request, invoice, strings)) 107 if(!gGenericDispatcher.dispatch(request, invoice, strings))
108 { 108 {
109 llwarns << "GenericMessage " << request << " failed to dispatch" 109 llwarns << "GenericMessage " << request << " failed to dispatch"
110 << llendl; 110 << llendl;
111 } 111 }
112 } 112 }
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 9dd02eb..92e3fa9 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -1,12 +1,12 @@
1 1
2/** 2/**
3 * @file llviewermessage.cpp 3 * @file llviewermessage.cpp
4 * @brief Dumping ground for viewer-side message system callbacks. 4 * @brief Dumping ground for viewer-side message system callbacks.
5 * 5 *
6 * $LicenseInfo:firstyear=2002&license=viewergpl$ 6 * $LicenseInfo:firstyear=2002&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2002-2009, Linden Research, Inc. 8 * Copyright (c) 2002-2009, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0 12 * to you under the terms of the GNU General Public License, version 2.0
@@ -14,17 +14,17 @@
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception 22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 * 23 *
24 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations. 26 * and agree to abide by those obligations.
27 * 27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE. 30 * COMPLETENESS OR PERFORMANCE.
@@ -37,7 +37,7 @@
37 37
38#include <deque> 38#include <deque>
39 39
40#include "llaudioengine.h" 40#include "llaudioengine.h"
41#include "indra_constants.h" 41#include "indra_constants.h"
42#include "lscript_byteformat.h" 42#include "lscript_byteformat.h"
43#include "mean_collision_data.h" 43#include "mean_collision_data.h"
@@ -65,7 +65,7 @@
65#include "lltimer.h" 65#include "lltimer.h"
66#include "llmd5.h" 66#include "llmd5.h"
67 67
68#include "lightshare.h" 68#include "llettherebelight.h"
69#include "llagent.h" 69#include "llagent.h"
70#include "llcallingcard.h" 70#include "llcallingcard.h"
71#include "llconsole.h" 71#include "llconsole.h"
@@ -132,6 +132,7 @@
132#include "llvlmanager.h" 132#include "llvlmanager.h"
133#include "llvoavatar.h" 133#include "llvoavatar.h"
134#include "llvotextbubble.h" 134#include "llvotextbubble.h"
135#include "llwlparammanager.h"
135#include "llweb.h" 136#include "llweb.h"
136#include "llworld.h" 137#include "llworld.h"
137#include "pipeline.h" 138#include "pipeline.h"
@@ -151,7 +152,6 @@
151 152
152#include "hippogridmanager.h" 153#include "hippogridmanager.h"
153#include "hippolimits.h" 154#include "hippolimits.h"
154#include "wlsettingsmanager.h"
155 155
156#if LL_WINDOWS // For Windows specific error handler 156#if LL_WINDOWS // For Windows specific error handler
157#include "llwindebug.h" // For the invalid message handler 157#include "llwindebug.h" // For the invalid message handler
@@ -195,8 +195,8 @@ const U32 OFFER_THROTTLE_MAX_COUNT=5; //number of items per time period
195const F32 OFFER_THROTTLE_TIME=10.f; //time period in seconds 195const F32 OFFER_THROTTLE_TIME=10.f; //time period in seconds
196 196
197//script permissions 197//script permissions
198const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = 198const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] =
199 { 199 {
200 "ScriptTakeMoney", 200 "ScriptTakeMoney",
201 "ActOnControlInputs", 201 "ActOnControlInputs",
202 "RemapControlInputs", 202 "RemapControlInputs",
@@ -210,7 +210,7 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] =
210 "ControlYourCamera" 210 "ControlYourCamera"
211 }; 211 };
212 212
213const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = 213const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =
214{ 214{
215 TRUE, // ScriptTakeMoney, 215 TRUE, // ScriptTakeMoney,
216 FALSE, // ActOnControlInputs 216 FALSE, // ActOnControlInputs
@@ -462,7 +462,7 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
462// char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */ 462// char image_uuid_str[UUID_STR_SIZE]; /* Flawfinder: ignore */
463// memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */ 463// memcpy(image_uuid_str, pos_uuid+2, UUID_STR_SIZE-1); /* Flawfinder: ignore */
464// image_uuid_str[UUID_STR_SIZE-1] = 0; 464// image_uuid_str[UUID_STR_SIZE-1] = 0;
465 465
466// LLUUID image_uuid(image_uuid_str); 466// LLUUID image_uuid(image_uuid_str);
467 467
468// LL_INFOS("Messaging") << "Found UUID: " << image_uuid << LL_ENDL; 468// LL_INFOS("Messaging") << "Found UUID: " << image_uuid << LL_ENDL;
@@ -537,7 +537,7 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
537// else 537// else
538// { 538// {
539// LLFILE* fIn = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ 539// LLFILE* fIn = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
540// if (fIn) 540// if (fIn)
541// { 541// {
542// LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C; 542// LLPointer<LLImageJ2C> ImageUtility = new LLImageJ2C;
543// LLPointer<LLImageTGA> TargaUtility = new LLImageTGA; 543// LLPointer<LLImageTGA> TargaUtility = new LLImageTGA;
@@ -558,13 +558,13 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
558 558
559// ImageUtility->updateData(); 559// ImageUtility->updateData();
560// ImageUtility->decode(image, 100000.0f); 560// ImageUtility->decode(image, 100000.0f);
561 561
562// TargaUtility->encode(image); 562// TargaUtility->encode(image);
563// U8 *data = TargaUtility->getData(); 563// U8 *data = TargaUtility->getData();
564// S32 data_size = TargaUtility->getDataSize(); 564// S32 data_size = TargaUtility->getDataSize();
565 565
566// std::string file_path = gDirUtilp->getDirName(filename); 566// std::string file_path = gDirUtilp->getDirName(filename);
567 567
568// std::string output_file = llformat("%s/image-%03d.tga", file_path.c_str(), image_num);//filename; 568// std::string output_file = llformat("%s/image-%03d.tga", file_path.c_str(), image_num);//filename;
569// //S32 name_len = output_file.length(); 569// //S32 name_len = output_file.length();
570// //strcpy(&output_file[name_len-3], "tga"); 570// //strcpy(&output_file[name_len-3], "tga");
@@ -749,10 +749,10 @@ private:
749 std::string mFromName; 749 std::string mFromName;
750}; 750};
751 751
752//unlike the FetchObserver for AgentOffer, we only make one 752//unlike the FetchObserver for AgentOffer, we only make one
753//instance of the AddedObserver for TaskOffers 753//instance of the AddedObserver for TaskOffers
754//and it never dies. We do this because we don't know the UUID of 754//and it never dies. We do this because we don't know the UUID of
755//task offers until they are accepted, so we don't wouldn't 755//task offers until they are accepted, so we don't wouldn't
756//know what to watch for, so instead we just watch for all additions. 756//know what to watch for, so instead we just watch for all additions.
757class LLOpenTaskOffer : public LLInventoryAddedObserver 757class LLOpenTaskOffer : public LLInventoryAddedObserver
758{ 758{
@@ -769,7 +769,7 @@ LLOpenTaskOffer* gNewInventoryObserver=NULL;
769 769
770void start_new_inventory_observer() 770void start_new_inventory_observer()
771{ 771{
772 if (!gNewInventoryObserver) //task offer observer 772 if (!gNewInventoryObserver) //task offer observer
773 { 773 {
774 // Observer is deleted by gInventory 774 // Observer is deleted by gInventory
775 gNewInventoryObserver = new LLOpenTaskOffer; 775 gNewInventoryObserver = new LLOpenTaskOffer;
@@ -828,7 +828,7 @@ protected:
828 828
829 829
830//Returns TRUE if we are OK, FALSE if we are throttled 830//Returns TRUE if we are OK, FALSE if we are throttled
831//Set check_only true if you want to know the throttle status 831//Set check_only true if you want to know the throttle status
832//without registering a hit 832//without registering a hit
833bool check_offer_throttle(const std::string& from_name, bool check_only) 833bool check_offer_throttle(const std::string& from_name, bool check_only)
834{ 834{
@@ -844,7 +844,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
844 { 844 {
845 return gThrottleTimer.hasExpired(); 845 return gThrottleTimer.hasExpired();
846 } 846 }
847 847
848 if(gThrottleTimer.checkExpirationAndReset(OFFER_THROTTLE_TIME)) 848 if(gThrottleTimer.checkExpirationAndReset(OFFER_THROTTLE_TIME))
849 { 849 {
850 LL_DEBUGS("Messaging") << "Throttle Expired" << LL_ENDL; 850 LL_DEBUGS("Messaging") << "Throttle Expired" << LL_ENDL;
@@ -890,7 +890,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
890 } 890 }
891 } 891 }
892} 892}
893 893
894void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) 894void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
895{ 895{
896 std::vector<LLUUID>::const_iterator it = items.begin(); 896 std::vector<LLUUID>::const_iterator it = items.begin();
@@ -921,11 +921,9 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
921 { 921 {
922 case LLAssetType::AT_NOTECARD: 922 case LLAssetType::AT_NOTECARD:
923 // Don't show WindLight settings as notecards. 923 // Don't show WindLight settings as notecards.
924 // *TODO: centralise all these damned .wl/.ww checks somewhere. 924 if(!LLWLParamManager::isSettingsNotecard(item->getName()))
925 if((item->getName().length() > 2 && item->getName().compare(item->getName().length() - 3, 3, ".wl") != 0) &&
926 (item->getName().compare(item->getName().length() - 3, 3, ".ww") != 0))
927 { 925 {
928 open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), 926 open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(),
929 LLUUID::null, show_keep_discard, LLUUID::null, FALSE); 927 LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
930 } 928 }
931 break; 929 break;
@@ -941,7 +939,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
941 } 939 }
942 } 940 }
943 //highlight item, if it's not in the trash or lost+found 941 //highlight item, if it's not in the trash or lost+found
944 942
945 // Don't auto-open the inventory floater 943 // Don't auto-open the inventory floater
946 LLInventoryView* view = LLInventoryView::getActiveInventory(); 944 LLInventoryView* view = LLInventoryView::getActiveInventory();
947 if(!view) 945 if(!view)
@@ -1021,7 +1019,7 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
1021 OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} 1019 OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {}
1022 BOOL matches(const LLNotificationPtr notification) const 1020 BOOL matches(const LLNotificationPtr notification) const
1023 { 1021 {
1024 if(notification->getName() == "ObjectGiveItem" 1022 if(notification->getName() == "ObjectGiveItem"
1025 || notification->getName() == "ObjectGiveItemUnknownUser" 1023 || notification->getName() == "ObjectGiveItemUnknownUser"
1026 || notification->getName() == "UserGiveItem") 1024 || notification->getName() == "UserGiveItem")
1027 { 1025 {
@@ -1097,7 +1095,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
1097 std::string name; 1095 std::string name;
1098 gAgent.buildFullname(name); 1096 gAgent.buildFullname(name);
1099 msg->addStringFast(_PREHASH_FromAgentName, name); 1097 msg->addStringFast(_PREHASH_FromAgentName, name);
1100 msg->addStringFast(_PREHASH_Message, ""); 1098 msg->addStringFast(_PREHASH_Message, "");
1101 msg->addU32Fast(_PREHASH_ParentEstateID, 0); 1099 msg->addU32Fast(_PREHASH_ParentEstateID, 0);
1102 msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); 1100 msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
1103 msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); 1101 msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
@@ -1157,9 +1155,9 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
1157 { 1155 {
1158 from_string = chatHistory_string = mFromName; 1156 from_string = chatHistory_string = mFromName;
1159 } 1157 }
1160 1158
1161 bool busy=FALSE; 1159 bool busy=FALSE;
1162 1160
1163 switch(button) 1161 switch(button)
1164 { 1162 {
1165 case IOR_ACCEPT: 1163 case IOR_ACCEPT:
@@ -1181,7 +1179,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
1181 // ACCEPT. The math for the dialog works, because the accept 1179 // ACCEPT. The math for the dialog works, because the accept
1182 // for inventory_offered, task_inventory_offer or 1180 // for inventory_offered, task_inventory_offer or
1183 // group_notice_inventory is 1 greater than the offer integer value. 1181 // group_notice_inventory is 1 greater than the offer integer value.
1184 // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED, 1182 // Generates IM_INVENTORY_ACCEPTED, IM_TASK_INVENTORY_ACCEPTED,
1185 // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED 1183 // or IM_GROUP_NOTICE_INVENTORY_ACCEPTED
1186 msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); 1184 msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1));
1187 msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), 1185 msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData),
@@ -1281,7 +1279,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
1281 LLFloaterChat::addChatHistory(chat); 1279 LLFloaterChat::addChatHistory(chat);
1282 1280
1283 // If it's from an agent, we have to fetch the item to throw 1281 // If it's from an agent, we have to fetch the item to throw
1284 // it away. If it's from a task or group, just denying the 1282 // it away. If it's from a task or group, just denying the
1285 // request will suffice to discard the item. 1283 // request will suffice to discard the item.
1286 if(IM_INVENTORY_OFFERED == mIM) 1284 if(IM_INVENTORY_OFFERED == mIM)
1287 { 1285 {
@@ -1299,7 +1297,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
1299 { 1297 {
1300 opener = discard_agent_offer; 1298 opener = discard_agent_offer;
1301 } 1299 }
1302 1300
1303 } 1301 }
1304 if (busy && (!mFromGroup && !mFromObject)) 1302 if (busy && (!mFromGroup && !mFromObject))
1305 { 1303 {
@@ -1331,7 +1329,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1331 info->forceResponse(IOR_BUSY); 1329 info->forceResponse(IOR_BUSY);
1332 return; 1330 return;
1333 } 1331 }
1334 1332
1335 //If muted, don't even go through the messaging stuff. Just curtail the offer here. 1333 //If muted, don't even go through the messaging stuff. Just curtail the offer here.
1336 if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName)) 1334 if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName))
1337 { 1335 {
@@ -1370,7 +1368,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1370 } 1368 }
1371// [/RLVa:KB] 1369// [/RLVa:KB]
1372 } 1370 }
1373 1371
1374 LLSD args; 1372 LLSD args;
1375 args["[OBJECTNAME]"] = msg; 1373 args["[OBJECTNAME]"] = msg;
1376 1374
@@ -1473,7 +1471,7 @@ static LLNotificationFunctorRegistration group_vote_callback_reg("GroupVote", gr
1473bool lure_callback(const LLSD& notification, const LLSD& response) 1471bool lure_callback(const LLSD& notification, const LLSD& response)
1474{ 1472{
1475 S32 option = 0; 1473 S32 option = 0;
1476 if (response.isInteger()) 1474 if (response.isInteger())
1477 { 1475 {
1478 option = response.asInteger(); 1476 option = response.asInteger();
1479 } 1477 }
@@ -1481,7 +1479,7 @@ bool lure_callback(const LLSD& notification, const LLSD& response)
1481 { 1479 {
1482 option = LLNotification::getSelectedOption(notification, response); 1480 option = LLNotification::getSelectedOption(notification, response);
1483 } 1481 }
1484 1482
1485 LLUUID from_id = notification["payload"]["from_id"].asUUID(); 1483 LLUUID from_id = notification["payload"]["from_id"].asUUID();
1486 LLUUID lure_id = notification["payload"]["lure_id"].asUUID(); 1484 LLUUID lure_id = notification["payload"]["lure_id"].asUUID();
1487 BOOL godlike = notification["payload"]["godlike"].asBoolean(); 1485 BOOL godlike = notification["payload"]["godlike"].asBoolean();
@@ -1541,7 +1539,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1541 S32 binary_bucket_size; 1539 S32 binary_bucket_size;
1542 LLChat chat; 1540 LLChat chat;
1543 std::string buffer; 1541 std::string buffer;
1544 1542
1545 // *TODO:translate - need to fix the full name to first/last (maybe) 1543 // *TODO:translate - need to fix the full name to first/last (maybe)
1546 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id); 1544 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, from_id);
1547 msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group); 1545 msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, from_group);
@@ -1566,7 +1564,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1566 BOOL is_owned_by_me = FALSE; 1564 BOOL is_owned_by_me = FALSE;
1567 1565
1568 LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id); 1566 LLUUID computed_session_id = LLIMMgr::computeSessionID(dialog,from_id);
1569 1567
1570 chat.mMuted = is_muted && !is_linden; 1568 chat.mMuted = is_muted && !is_linden;
1571 chat.mFromID = from_id; 1569 chat.mFromID = from_id;
1572 chat.mFromName = name; 1570 chat.mFromName = name;
@@ -1594,7 +1592,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1594 || dialog == IM_TYPING_STOP 1592 || dialog == IM_TYPING_STOP
1595 || dialog == IM_BUSY_AUTO_RESPONSE) 1593 || dialog == IM_BUSY_AUTO_RESPONSE)
1596 { 1594 {
1597 1595
1598 if(session_id != computed_session_id) 1596 if(session_id != computed_session_id)
1599 { 1597 {
1600 session_id = computed_session_id; 1598 session_id = computed_session_id;
@@ -1833,7 +1831,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1833 } 1831 }
1834 } 1832 }
1835 //InstantMessageResponseItem< 1833 //InstantMessageResponseItem<
1836 1834
1837 } 1835 }
1838 } 1836 }
1839 } 1837 }
@@ -1853,10 +1851,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1853 LLNotifications::instance().add("SystemMessageTip",args); 1851 LLNotifications::instance().add("SystemMessageTip",args);
1854 break; 1852 break;
1855 1853
1856 case IM_NOTHING_SPECIAL: 1854 case IM_NOTHING_SPECIAL:
1857 // Don't show dialog, just do IM 1855 // Don't show dialog, just do IM
1858 if (!gAgent.isGodlike() 1856 if (!gAgent.isGodlike()
1859 && gAgent.getRegion()->isPrelude() 1857 && gAgent.getRegion()->isPrelude()
1860 && to_id.isNull() ) 1858 && to_id.isNull() )
1861 { 1859 {
1862 // do nothing -- don't distract newbies in 1860 // do nothing -- don't distract newbies in
@@ -1873,11 +1871,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1873// [/RLVa:KB] 1871// [/RLVa:KB]
1874// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) 1872// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM)
1875// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) 1873// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
1876 else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && 1874 else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) &&
1877 ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, from_id))) ) 1875 ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, from_id))) )
1878// [/RLVa:KB] 1876// [/RLVa:KB]
1879 { 1877 {
1880 // return a standard "busy" message, but only do it to online IM 1878 // return a standard "busy" message, but only do it to online IM
1881 // (i.e. not other auto responses and not store-and-forward IM) 1879 // (i.e. not other auto responses and not store-and-forward IM)
1882 if (!gIMMgr->hasSession(session_id)) 1880 if (!gIMMgr->hasSession(session_id))
1883 { 1881 {
@@ -1903,7 +1901,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1903 // now store incoming IM in chat history 1901 // now store incoming IM in chat history
1904 1902
1905 buffer = separator_string + message.substr(message_offset); 1903 buffer = separator_string + message.substr(message_offset);
1906 1904
1907 LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; 1905 LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
1908 1906
1909 // add to IM panel, but do not bother the user 1907 // add to IM panel, but do not bother the user
@@ -1934,7 +1932,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1934 { 1932 {
1935// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) 1933// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e)
1936 // Filter region messages that weren't sent by a Linden 1934 // Filter region messages that weren't sent by a Linden
1937 if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) && 1935 if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) &&
1938 (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) ) 1936 (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) )
1939 { 1937 {
1940 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) 1938 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
@@ -2049,7 +2047,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2049 U8 item_name[DB_INV_ITEM_NAME_BUF_SIZE]; 2047 U8 item_name[DB_INV_ITEM_NAME_BUF_SIZE];
2050 }* notice_bin_bucket; 2048 }* notice_bin_bucket;
2051 2049
2052 // Make sure the binary bucket is big enough to hold the header 2050 // Make sure the binary bucket is big enough to hold the header
2053 // and a null terminated item name. 2051 // and a null terminated item name.
2054 if ( (binary_bucket_size < (S32)((sizeof(notice_bucket_header_t) + sizeof(U8)))) 2052 if ( (binary_bucket_size < (S32)((sizeof(notice_bucket_header_t) + sizeof(U8))))
2055 || (binary_bucket[binary_bucket_size - 1] != '\0') ) 2053 || (binary_bucket[binary_bucket_size - 1] != '\0') )
@@ -2070,7 +2068,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2070 if (has_inventory) 2068 if (has_inventory)
2071 { 2069 {
2072 info = new LLOfferInfo; 2070 info = new LLOfferInfo;
2073 2071
2074 info->mIM = IM_GROUP_NOTICE; 2072 info->mIM = IM_GROUP_NOTICE;
2075 info->mFromID = from_id; 2073 info->mFromID = from_id;
2076 info->mFromGroup = from_group; 2074 info->mFromGroup = from_group;
@@ -2086,7 +2084,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2086 info->mDesc = item_name; 2084 info->mDesc = item_name;
2087 info->mHost = msg->getSender(); 2085 info->mHost = msg->getSender();
2088 } 2086 }
2089 2087
2090 std::string str(message); 2088 std::string str(message);
2091 2089
2092 // Tokenize the string. 2090 // Tokenize the string.
@@ -2290,7 +2288,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2290 LL_WARNS("Messaging") << "Received IM: IM_GROUP_ELECTION_DEPRECATED" << LL_ENDL; 2288 LL_WARNS("Messaging") << "Received IM: IM_GROUP_ELECTION_DEPRECATED" << LL_ENDL;
2291 } 2289 }
2292 break; 2290 break;
2293 2291
2294 case IM_SESSION_SEND: 2292 case IM_SESSION_SEND:
2295 { 2293 {
2296 if (!is_linden && is_busy) 2294 if (!is_linden && is_busy)
@@ -2352,7 +2350,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2352 { 2350 {
2353 group_name = std::string((char*)binary_bucket); 2351 group_name = std::string((char*)binary_bucket);
2354 } 2352 }
2355 chat.mText = std::string("IM [") + group_name + std::string("] ") + name 2353 chat.mText = std::string("IM [") + group_name + std::string("] ") + name
2356 + separator_string + saved + message.substr(message_offset); 2354 + separator_string + saved + message.substr(message_offset);
2357 } 2355 }
2358 else 2356 else
@@ -2399,7 +2397,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2399 } 2397 }
2400 2398
2401 std::string tempname = name; 2399 std::string tempname = name;
2402 2400
2403 size_t found = tempname.find(" "); 2401 size_t found = tempname.find(" ");
2404 while(found != std::string::npos) 2402 while(found != std::string::npos)
2405 { 2403 {
@@ -2411,7 +2409,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2411 { 2409 {
2412 name = ">>"; 2410 name = ">>";
2413 chat.mFromName = name; 2411 chat.mFromName = name;
2414 2412
2415 } 2413 }
2416 2414
2417 std::ostringstream link; 2415 std::ostringstream link;
@@ -2463,14 +2461,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2463 gIMMgr->addMessage(session_id, from_id, name, buffer); 2461 gIMMgr->addMessage(session_id, from_id, name, buffer);
2464 } 2462 }
2465 break; 2463 break;
2466 2464
2467 case IM_LURE_USER: 2465 case IM_LURE_USER:
2468 { 2466 {
2469 if (is_muted) 2467 if (is_muted)
2470 { 2468 {
2471 return; 2469 return;
2472 } 2470 }
2473 else if (is_busy) 2471 else if (is_busy)
2474 { 2472 {
2475 busy_message(msg,from_id); 2473 busy_message(msg,from_id);
2476 } 2474 }
@@ -2606,7 +2604,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2606 } 2604 }
2607 2605
2608 std::string url; 2606 std::string url;
2609 2607
2610 url.assign((char*)binary_bucket, binary_bucket_size-1); 2608 url.assign((char*)binary_bucket, binary_bucket_size-1);
2611 args["MESSAGE"] = message; 2609 args["MESSAGE"] = message;
2612 args["URL"] = url; 2610 args["URL"] = url;
@@ -2656,11 +2654,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2656 // as the database should already include the relationship. But it 2654 // as the database should already include the relationship. But it
2657 // doesn't hurt for dupes. 2655 // doesn't hurt for dupes.
2658 LLAvatarTracker::formFriendship(from_id); 2656 LLAvatarTracker::formFriendship(from_id);
2659 2657
2660 std::vector<std::string> strings; 2658 std::vector<std::string> strings;
2661 strings.push_back(from_id.asString()); 2659 strings.push_back(from_id.asString());
2662 send_generic_message("requestonlinenotification", strings); 2660 send_generic_message("requestonlinenotification", strings);
2663 2661
2664 args["NAME"] = name; 2662 args["NAME"] = name;
2665 LLNotifications::instance().add("FriendshipAccepted", args); 2663 LLNotifications::instance().add("FriendshipAccepted", args);
2666 } 2664 }
@@ -2680,7 +2678,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
2680 } 2678 }
2681} 2679}
2682 2680
2683void busy_message (LLMessageSystem* msg, LLUUID from_id) 2681void busy_message (LLMessageSystem* msg, LLUUID from_id)
2684{ 2682{
2685 if (gAgent.getBusy()) 2683 if (gAgent.getBusy())
2686 { 2684 {
@@ -2723,7 +2721,7 @@ bool callingcard_offer_callback(const LLSD& notification, const LLSD& response)
2723 msg->sendReliable(LLHost(notification["payload"]["sender"].asString())); 2721 msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
2724 break; 2722 break;
2725 case 1: 2723 case 1:
2726 // decline 2724 // decline
2727 msg->newMessageFast(_PREHASH_DeclineCallingCard); 2725 msg->newMessageFast(_PREHASH_DeclineCallingCard);
2728 msg->nextBlockFast(_PREHASH_AgentData); 2726 msg->nextBlockFast(_PREHASH_AgentData);
2729 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2727 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -2774,7 +2772,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**)
2774 2772
2775 if(!source_name.empty()) 2773 if(!source_name.empty())
2776 { 2774 {
2777 if (gAgent.getBusy() 2775 if (gAgent.getBusy()
2778 || LLMuteList::getInstance()->isMuted(source_id, source_name, LLMute::flagTextChat)) 2776 || LLMuteList::getInstance()->isMuted(source_id, source_name, LLMute::flagTextChat))
2779 { 2777 {
2780 // automatically decline offer 2778 // automatically decline offer
@@ -2831,13 +2829,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2831 2829
2832 msg->getString("ChatData", "FromName", from_name); 2830 msg->getString("ChatData", "FromName", from_name);
2833 chat.mFromName = from_name; 2831 chat.mFromName = from_name;
2834 2832
2835 msg->getUUID("ChatData", "SourceID", from_id); 2833 msg->getUUID("ChatData", "SourceID", from_id);
2836 chat.mFromID = from_id; 2834 chat.mFromID = from_id;
2837 2835
2838 // Object owner for objects 2836 // Object owner for objects
2839 msg->getUUID("ChatData", "OwnerID", owner_id); 2837 msg->getUUID("ChatData", "OwnerID", owner_id);
2840 2838
2841 msg->getU8Fast(_PREHASH_ChatData, _PREHASH_SourceType, source_temp); 2839 msg->getU8Fast(_PREHASH_ChatData, _PREHASH_SourceType, source_temp);
2842 chat.mSourceType = (EChatSourceType)source_temp; 2840 chat.mSourceType = (EChatSourceType)source_temp;
2843 2841
@@ -2846,9 +2844,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2846 2844
2847 msg->getU8Fast(_PREHASH_ChatData, _PREHASH_Audible, audible_temp); 2845 msg->getU8Fast(_PREHASH_ChatData, _PREHASH_Audible, audible_temp);
2848 chat.mAudible = (EChatAudible)audible_temp; 2846 chat.mAudible = (EChatAudible)audible_temp;
2849 2847
2850 chat.mTime = LLFrameTimer::getElapsedSeconds(); 2848 chat.mTime = LLFrameTimer::getElapsedSeconds();
2851 2849
2852 BOOL is_busy = gAgent.getBusy(); 2850 BOOL is_busy = gAgent.getBusy();
2853 2851
2854 BOOL is_muted = FALSE; 2852 BOOL is_muted = FALSE;
@@ -2856,7 +2854,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2856 is_muted = LLMuteList::getInstance()->isMuted( 2854 is_muted = LLMuteList::getInstance()->isMuted(
2857 from_id, 2855 from_id,
2858 from_name, 2856 from_name,
2859 LLMute::flagTextChat) 2857 LLMute::flagTextChat)
2860 || LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagTextChat); 2858 || LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagTextChat);
2861 is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && 2859 is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
2862 LLMuteList::getInstance()->isLinden(from_name); 2860 LLMuteList::getInstance()->isLinden(from_name);
@@ -2866,9 +2864,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2866 if (chatter) 2864 if (chatter)
2867 { 2865 {
2868 chat.mPosAgent = chatter->getPositionAgent(); 2866 chat.mPosAgent = chatter->getPositionAgent();
2869 2867
2870 // Make swirly things only for talking objects. (not script debug messages, though) 2868 // Make swirly things only for talking objects. (not script debug messages, though)
2871// if (chat.mSourceType == CHAT_SOURCE_OBJECT 2869// if (chat.mSourceType == CHAT_SOURCE_OBJECT
2872// && chat.mChatType != CHAT_TYPE_DEBUG_MSG) 2870// && chat.mChatType != CHAT_TYPE_DEBUG_MSG)
2873// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g) 2871// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g)
2874 // Don't show swirly things for llOwnerSay() chat here because we handle those further down 2872 // Don't show swirly things for llOwnerSay() chat here because we handle those further down
@@ -2880,7 +2878,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2880 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); 2878 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
2881 psc->setSourceObject(chatter); 2879 psc->setSourceObject(chatter);
2882 psc->setColor(color); 2880 psc->setColor(color);
2883 //We set the particles to be owned by the object's owner, 2881 //We set the particles to be owned by the object's owner,
2884 //just in case they should be muted by the mute list 2882 //just in case they should be muted by the mute list
2885 psc->setOwnerUUID(owner_id); 2883 psc->setOwnerUUID(owner_id);
2886 LLViewerPartSim::getInstance()->addPartSource(psc); 2884 LLViewerPartSim::getInstance()->addPartSource(psc);
@@ -2890,7 +2888,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2890 if (is_audible 2888 if (is_audible
2891 && (is_linden || (!is_muted && !is_busy))) 2889 && (is_linden || (!is_muted && !is_busy)))
2892 { 2890 {
2893 if (chat.mChatType != CHAT_TYPE_START 2891 if (chat.mChatType != CHAT_TYPE_START
2894 && chat.mChatType != CHAT_TYPE_STOP) 2892 && chat.mChatType != CHAT_TYPE_STOP)
2895 { 2893 {
2896 gAgent.heardChat(chat.mFromID); 2894 gAgent.heardChat(chat.mFromID);
@@ -2900,7 +2898,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2900 is_owned_by_me = chatter->permYouOwner(); 2898 is_owned_by_me = chatter->permYouOwner();
2901 } 2899 }
2902 2900
2903 if(chat.mSourceType == CHAT_SOURCE_OBJECT 2901 if(chat.mSourceType == CHAT_SOURCE_OBJECT
2904 && chat.mChatType != CHAT_TYPE_DEBUG_MSG 2902 && chat.mChatType != CHAT_TYPE_DEBUG_MSG
2905 && !owner_id.isNull() 2903 && !owner_id.isNull()
2906 && owner_id != gAgent.getID()) 2904 && owner_id != gAgent.getID())
@@ -2962,7 +2960,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2962 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); 2960 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg);
2963 2961
2964// [RLVa:KB] - Checked: 2009-10-06 (RLVa-1.0.4d) | Modified: RLVa-1.0.4d 2962// [RLVa:KB] - Checked: 2009-10-06 (RLVa-1.0.4d) | Modified: RLVa-1.0.4d
2965 if ( (rlv_handler_t::isEnabled()) && 2963 if ( (rlv_handler_t::isEnabled()) &&
2966 (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) ) 2964 (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) )
2967 { 2965 {
2968 // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment) 2966 // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment)
@@ -2971,7 +2969,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2971 // Filtering "rules": 2969 // Filtering "rules":
2972 // avatar => filter all avie text (unless it's this avie or they're an exemption) 2970 // avatar => filter all avie text (unless it's this avie or they're an exemption)
2973 // objects => filter everything except attachments this avie owns 2971 // objects => filter everything except attachments this avie owns
2974 if ( ( (CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID()) ) || 2972 if ( ( (CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID()) ) ||
2975 ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) ) ) 2973 ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) ) )
2976 { 2974 {
2977 if (!rlvIsEmote(mesg)) 2975 if (!rlvIsEmote(mesg))
@@ -2994,7 +2992,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2994 { 2992 {
2995 if (chat.mFromID != gAgent.getID()) 2993 if (chat.mFromID != gAgent.getID())
2996 from_name = RlvStrings::getAnonym(from_name); 2994 from_name = RlvStrings::getAnonym(from_name);
2997 } 2995 }
2998 else 2996 else
2999 { 2997 {
3000 if ( (!is_owned_by_me) || (!is_attachment) ) 2998 if ( (!is_owned_by_me) || (!is_attachment) )
@@ -3036,7 +3034,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3036 if (LLFloaterMap::getInstance()) 3034 if (LLFloaterMap::getInstance())
3037 { 3035 {
3038 PanelRadarEntry* entry = LLFloaterMap::getInstance()->getRadar()->getEntry(from_id); 3036 PanelRadarEntry* entry = LLFloaterMap::getInstance()->getRadar()->getEntry(from_id);
3039 if (entry) 3037 if (entry)
3040 { 3038 {
3041 entry->setStatus(RADAR_STATUS_TYPING); 3039 entry->setStatus(RADAR_STATUS_TYPING);
3042 } 3040 }
@@ -3057,7 +3055,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3057 if (LLFloaterMap::getInstance()) 3055 if (LLFloaterMap::getInstance())
3058 { 3056 {
3059 PanelRadarEntry* entry = LLFloaterMap::getInstance()->getRadar()->getEntry(from_id); 3057 PanelRadarEntry* entry = LLFloaterMap::getInstance()->getRadar()->getEntry(from_id);
3060 if (entry) 3058 if (entry)
3061 { 3059 {
3062 entry->setStatus(RADAR_STATUS_NONE); 3060 entry->setStatus(RADAR_STATUS_NONE);
3063 } 3061 }
@@ -3074,7 +3072,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3074 3072
3075 if (!is_muted && !is_busy) 3073 if (!is_muted && !is_busy)
3076 { 3074 {
3077 3075
3078 BOOL sUseChatBubbles = gSavedSettings.getBOOL("UseChatBubbles"); 3076 BOOL sUseChatBubbles = gSavedSettings.getBOOL("UseChatBubbles");
3079 if(sUseChatBubbles) 3077 if(sUseChatBubbles)
3080 { 3078 {
@@ -3160,7 +3158,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3160 verb = " retained: @"; 3158 verb = " retained: @";
3161 mesg = strRetained; 3159 mesg = strRetained;
3162 } 3160 }
3163 else 3161 else
3164 { 3162 {
3165 verb = ": @"; 3163 verb = ": @";
3166 if (!strExecuted.empty()) 3164 if (!strExecuted.empty())
@@ -3181,7 +3179,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3181 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); 3179 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
3182 psc->setSourceObject(chatter); 3180 psc->setSourceObject(chatter);
3183 psc->setColor(color); 3181 psc->setColor(color);
3184 //We set the particles to be owned by the object's owner, 3182 //We set the particles to be owned by the object's owner,
3185 //just in case they should be muted by the mute list 3183 //just in case they should be muted by the mute list
3186 psc->setOwnerUUID(owner_id); 3184 psc->setOwnerUUID(owner_id);
3187 LLViewerPartSim::getInstance()->addPartSource(psc); 3185 LLViewerPartSim::getInstance()->addPartSource(psc);
@@ -3209,7 +3207,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3209 chat.mText += verb; 3207 chat.mText += verb;
3210 chat.mText += mesg; 3208 chat.mText += mesg;
3211 } 3209 }
3212 3210
3213 if (chatter) 3211 if (chatter)
3214 { 3212 {
3215 chat.mPosAgent = chatter->getPositionAgent(); 3213 chat.mPosAgent = chatter->getPositionAgent();
@@ -3228,9 +3226,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3228 // T * * * F Yes Yes 3226 // T * * * F Yes Yes
3229 3227
3230 chat.mMuted = is_muted && !is_linden; 3228 chat.mMuted = is_muted && !is_linden;
3231 3229
3232 3230
3233 if (!visible_in_chat_bubble 3231 if (!visible_in_chat_bubble
3234 && (is_linden || !is_busy || is_owned_by_me)) 3232 && (is_linden || !is_busy || is_owned_by_me))
3235 { 3233 {
3236 // show on screen and add to history 3234 // show on screen and add to history
@@ -3246,10 +3244,10 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3246 3244
3247 3245
3248// Simulator we're on is informing the viewer that the agent 3246// Simulator we're on is informing the viewer that the agent
3249// is starting to teleport (perhaps to another sim, perhaps to the 3247// is starting to teleport (perhaps to another sim, perhaps to the
3250// same sim). If we initiated the teleport process by sending some kind 3248// same sim). If we initiated the teleport process by sending some kind
3251// of TeleportRequest, then this info is redundant, but if the sim 3249// of TeleportRequest, then this info is redundant, but if the sim
3252// initiated the teleport (via a script call, being killed, etc.) 3250// initiated the teleport (via a script call, being killed, etc.)
3253// then this info is news to us. 3251// then this info is news to us.
3254void process_teleport_start(LLMessageSystem *msg, void**) 3252void process_teleport_start(LLMessageSystem *msg, void**)
3255{ 3253{
@@ -3276,7 +3274,7 @@ void process_teleport_start(LLMessageSystem *msg, void**)
3276 gTeleportDisplay = TRUE; 3274 gTeleportDisplay = TRUE;
3277 gAgent.setTeleportState( LLAgent::TELEPORT_START ); 3275 gAgent.setTeleportState( LLAgent::TELEPORT_START );
3278 make_ui_sound("UISndTeleportOut"); 3276 make_ui_sound("UISndTeleportOut");
3279 3277
3280 // Don't call LLFirstUse::useTeleport here because this could be 3278 // Don't call LLFirstUse::useTeleport here because this could be
3281 // due to being killed, which would send you home, not to a Telehub 3279 // due to being killed, which would send you home, not to a Telehub
3282 } 3280 }
@@ -3313,7 +3311,7 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
3313 //if we don't find the coresponding mapping in our progress mappings 3311 //if we don't find the coresponding mapping in our progress mappings
3314 std::string message = buffer; 3312 std::string message = buffer;
3315 3313
3316 if (LLAgent::sTeleportProgressMessages.find(buffer) != 3314 if (LLAgent::sTeleportProgressMessages.find(buffer) !=
3317 LLAgent::sTeleportProgressMessages.end() ) 3315 LLAgent::sTeleportProgressMessages.end() )
3318 { 3316 {
3319 message = LLAgent::sTeleportProgressMessages[buffer]; 3317 message = LLAgent::sTeleportProgressMessages[buffer];
@@ -3374,7 +3372,7 @@ public:
3374 3372
3375 3373
3376 3374
3377class LLPostTeleportNotifiers : public LLEventTimer 3375class LLPostTeleportNotifiers : public LLEventTimer
3378{ 3376{
3379public: 3377public:
3380 LLPostTeleportNotifiers(); 3378 LLPostTeleportNotifiers();
@@ -3401,10 +3399,10 @@ BOOL LLPostTeleportNotifiers::tick()
3401 LLInventoryFetchDescendentsObserver::folder_ref_t folders; 3399 LLInventoryFetchDescendentsObserver::folder_ref_t folders;
3402 LLUUID folder_id; 3400 LLUUID folder_id;
3403 folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD); 3401 folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
3404 if(folder_id.notNull()) 3402 if(folder_id.notNull())
3405 folders.push_back(folder_id); 3403 folders.push_back(folder_id);
3406 folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); 3404 folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
3407 if(folder_id.notNull()) 3405 if(folder_id.notNull())
3408 folders.push_back(folder_id); 3406 folders.push_back(folder_id);
3409 if(!folders.empty()) 3407 if(!folders.empty())
3410 { 3408 {
@@ -3460,7 +3458,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3460 msg->getU64Fast(_PREHASH_Info, _PREHASH_RegionHandle, region_handle); 3458 msg->getU64Fast(_PREHASH_Info, _PREHASH_RegionHandle, region_handle);
3461 U32 teleport_flags; 3459 U32 teleport_flags;
3462 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); 3460 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
3463 3461
3464 U32 region_size_x = 256; 3462 U32 region_size_x = 256;
3465 msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x); 3463 msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
3466 U32 region_size_y = 256; 3464 U32 region_size_y = 256;
@@ -3472,17 +3470,17 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3472 region_size_x = 256; 3470 region_size_x = 256;
3473 region_size_y = 256; 3471 region_size_y = 256;
3474 } 3472 }
3475 3473
3476 std::string seedCap; 3474 std::string seedCap;
3477 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); 3475 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
3478 3476
3479 // update home location if we are teleporting out of prelude - specific to teleporting to welcome area 3477 // update home location if we are teleporting out of prelude - specific to teleporting to welcome area
3480 if((teleport_flags & TELEPORT_FLAGS_SET_HOME_TO_TARGET) 3478 if((teleport_flags & TELEPORT_FLAGS_SET_HOME_TO_TARGET)
3481 && (!gAgent.isGodlike())) 3479 && (!gAgent.isGodlike()))
3482 { 3480 {
3483 gAgent.setHomePosRegion(region_handle, pos); 3481 gAgent.setHomePosRegion(region_handle, pos);
3484 3482
3485 // Create a timer that will send notices when teleporting is all finished. Since this is 3483 // Create a timer that will send notices when teleporting is all finished. Since this is
3486 // based on the LLEventTimer class, it will be managed by that class and not orphaned or leaked. 3484 // based on the LLEventTimer class, it will be managed by that class and not orphaned or leaked.
3487 new LLPostTeleportNotifiers(); 3485 new LLPostTeleportNotifiers();
3488 } 3486 }
@@ -3546,8 +3544,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3546// gViewerWindow->setShowProgress(TRUE); 3544// gViewerWindow->setShowProgress(TRUE);
3547 3545
3548 // Tell the LightShare handler that we have changed regions. 3546 // Tell the LightShare handler that we have changed regions.
3549 WindlightMessage::resetRegion(); 3547 LightShare::resetRegion();
3550 WLSettingsManager::wlresetRegion();
3551} 3548}
3552 3549
3553// stuff we have to do every time we get an AvatarInitComplete from a sim 3550// stuff we have to do every time we get an AvatarInitComplete from a sim
@@ -3585,7 +3582,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3585 msg->getVector3Fast(_PREHASH_Data, _PREHASH_LookAt, look_at); 3582 msg->getVector3Fast(_PREHASH_Data, _PREHASH_LookAt, look_at);
3586 U64 region_handle; 3583 U64 region_handle;
3587 msg->getU64Fast(_PREHASH_Data, _PREHASH_RegionHandle, region_handle); 3584 msg->getU64Fast(_PREHASH_Data, _PREHASH_RegionHandle, region_handle);
3588 3585
3589 std::string version_channel; 3586 std::string version_channel;
3590 msg->getString("SimData", "ChannelVersion", version_channel); 3587 msg->getString("SimData", "ChannelVersion", version_channel);
3591 3588
@@ -3607,8 +3604,8 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3607 LL_WARNS("Messaging") << "current region " << gAgent.getRegion()->getOriginGlobal() << LL_ENDL; 3604 LL_WARNS("Messaging") << "current region " << gAgent.getRegion()->getOriginGlobal() << LL_ENDL;
3608 } 3605 }
3609 3606
3610 LL_WARNS("Messaging") << "Agent being sent to invalid home region: " 3607 LL_WARNS("Messaging") << "Agent being sent to invalid home region: "
3611 << x << ":" << y 3608 << x << ":" << y
3612 << " current pos " << gAgent.getPositionGlobal() 3609 << " current pos " << gAgent.getPositionGlobal()
3613 << LL_ENDL; 3610 << LL_ENDL;
3614 LLAppViewer::instance()->forceDisconnect("You were sent to an invalid region."); 3611 LLAppViewer::instance()->forceDisconnect("You were sent to an invalid region.");
@@ -3656,7 +3653,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3656// if (avatarp) 3653// if (avatarp)
3657 { 3654 {
3658 // Chat the "back" SLURL. (DEV-4907) 3655 // Chat the "back" SLURL. (DEV-4907)
3659 // Show this in the console if DisableTeleportScreens is true 3656 // Show this in the console if DisableTeleportScreens is true
3660 // Why? Because it's nifty, that's why -- MC 3657 // Why? Because it's nifty, that's why -- MC
3661 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); 3658 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL());
3662 chat.mSourceType = CHAT_SOURCE_SYSTEM; 3659 chat.mSourceType = CHAT_SOURCE_SYSTEM;
@@ -3746,7 +3743,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3746 { 3743 {
3747 avatarp->mFootPlane.clearVec(); 3744 avatarp->mFootPlane.clearVec();
3748 } 3745 }
3749 3746
3750 // send walk-vs-run status 3747 // send walk-vs-run status
3751 gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); 3748 gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun());
3752 3749
@@ -3803,7 +3800,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
3803 LLHost sim_host(sim_ip, sim_port); 3800 LLHost sim_host(sim_ip, sim_port);
3804 U64 region_handle; 3801 U64 region_handle;
3805 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); 3802 msg->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
3806 3803
3807 std::string seedCap; 3804 std::string seedCap;
3808 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap); 3805 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
3809 3806
@@ -3825,8 +3822,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
3825 regionp->setSeedCapability(seedCap); 3822 regionp->setSeedCapability(seedCap);
3826 3823
3827 // Tell the LightShare handler that we have changed regions. 3824 // Tell the LightShare handler that we have changed regions.
3828 WindlightMessage::resetRegion(); 3825 LightShare::resetRegion();
3829 WLSettingsManager::wlresetRegion();
3830} 3826}
3831 3827
3832 3828
@@ -3872,11 +3868,11 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
3872 const U8 DUP_MSGS = 1; // HACK! number of times to repeat data on motionless agent 3868 const U8 DUP_MSGS = 1; // HACK! number of times to repeat data on motionless agent
3873 3869
3874 // Store data on last sent update so that if no changes, no send 3870 // Store data on last sent update so that if no changes, no send
3875 static LLVector3 last_camera_pos_agent, 3871 static LLVector3 last_camera_pos_agent,
3876 last_camera_at, 3872 last_camera_at,
3877 last_camera_left, 3873 last_camera_left,
3878 last_camera_up; 3874 last_camera_up;
3879 3875
3880 static LLVector3 cam_center_chg, 3876 static LLVector3 cam_center_chg,
3881 cam_rot_chg; 3877 cam_rot_chg;
3882 3878
@@ -3929,13 +3925,13 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
3929 3925
3930 head_rot_chg = dot(last_head_rot, head_rotation); 3926 head_rot_chg = dot(last_head_rot, head_rotation);
3931 3927
3932 if (force_send || 3928 if (force_send ||
3933 (cam_center_chg.magVec() > TRANSLATE_THRESHOLD) || 3929 (cam_center_chg.magVec() > TRANSLATE_THRESHOLD) ||
3934 (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) || 3930 (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) ||
3935 (last_render_state != render_state) || 3931 (last_render_state != render_state) ||
3936 (cam_rot_chg.magVec() > ROTATION_THRESHOLD) || 3932 (cam_rot_chg.magVec() > ROTATION_THRESHOLD) ||
3937 control_flag_change != 0 || 3933 control_flag_change != 0 ||
3938 flag_change != 0) 3934 flag_change != 0)
3939 { 3935 {
3940/* 3936/*
3941 if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT) 3937 if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT)
@@ -3943,7 +3939,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
3943 //LL_INFOS("Messaging") << "head rot " << head_rotation << LL_ENDL; 3939 //LL_INFOS("Messaging") << "head rot " << head_rotation << LL_ENDL;
3944 LL_INFOS("Messaging") << "head_rot_chg = " << head_rot_chg << LL_ENDL; 3940 LL_INFOS("Messaging") << "head_rot_chg = " << head_rot_chg << LL_ENDL;
3945 } 3941 }
3946 if (cam_rot_chg.magVec() > ROTATION_THRESHOLD) 3942 if (cam_rot_chg.magVec() > ROTATION_THRESHOLD)
3947 { 3943 {
3948 LL_INFOS("Messaging") << "cam rot " << cam_rot_chg.magVec() << LL_ENDL; 3944 LL_INFOS("Messaging") << "cam rot " << cam_rot_chg.magVec() << LL_ENDL;
3949 } 3945 }
@@ -3974,8 +3970,8 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
3974 // some threshold from the last update, however this can break fine 3970 // some threshold from the last update, however this can break fine
3975 // adjustments when trying to aim an attached gun, so what we do here 3971 // adjustments when trying to aim an attached gun, so what we do here
3976 // (where we would normally skip sending an update when nothing has changed) 3972 // (where we would normally skip sending an update when nothing has changed)
3977 // is gradually reduce the threshold to allow a better update to 3973 // is gradually reduce the threshold to allow a better update to
3978 // eventually get sent... should update to within 0.5 degrees in less 3974 // eventually get sent... should update to within 0.5 degrees in less
3979 // than a second. 3975 // than a second.
3980 if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT + (MAX_HEAD_ROT_QDOT - THRESHOLD_HEAD_ROT_QDOT) * duplicate_count / AGENT_UPDATES_PER_SECOND) 3976 if (head_rot_chg < THRESHOLD_HEAD_ROT_QDOT + (MAX_HEAD_ROT_QDOT - THRESHOLD_HEAD_ROT_QDOT) * duplicate_count / AGENT_UPDATES_PER_SECOND)
3981 { 3977 {
@@ -4008,13 +4004,13 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
4008// { 4004// {
4009// LL_INFOS("Messaging") << "Sending camera center " << camera_pos_agent << LL_ENDL; 4005// LL_INFOS("Messaging") << "Sending camera center " << camera_pos_agent << LL_ENDL;
4010// } 4006// }
4011 4007
4012 msg->addVector3Fast(_PREHASH_CameraCenter, camera_pos_agent); 4008 msg->addVector3Fast(_PREHASH_CameraCenter, camera_pos_agent);
4013 msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis()); 4009 msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis());
4014 msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis()); 4010 msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis());
4015 msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); 4011 msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis());
4016 msg->addF32Fast(_PREHASH_Far, gAgent.mDrawDistance); 4012 msg->addF32Fast(_PREHASH_Far, gAgent.mDrawDistance);
4017 4013
4018 msg->addU32Fast(_PREHASH_ControlFlags, control_flags); 4014 msg->addU32Fast(_PREHASH_ControlFlags, control_flags);
4019 4015
4020 if (gDebugClicks) 4016 if (gDebugClicks)
@@ -4043,7 +4039,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
4043 4039
4044// LL_DEBUGS("Messaging") << "agent " << avatar_pos_agent << " cam " << camera_pos_agent << LL_ENDL; 4040// LL_DEBUGS("Messaging") << "agent " << avatar_pos_agent << " cam " << camera_pos_agent << LL_ENDL;
4045 4041
4046 // Copy the old data 4042 // Copy the old data
4047 last_head_rot = head_rotation; 4043 last_head_rot = head_rotation;
4048 last_render_state = render_state; 4044 last_render_state = render_state;
4049 last_camera_pos_agent = camera_pos_agent; 4045 last_camera_pos_agent = camera_pos_agent;
@@ -4062,7 +4058,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
4062extern U32 gObjectBits; 4058extern U32 gObjectBits;
4063 4059
4064void process_object_update(LLMessageSystem *mesgsys, void **user_data) 4060void process_object_update(LLMessageSystem *mesgsys, void **user_data)
4065{ 4061{
4066 LLMemType mt(LLMemType::MTYPE_OBJECT); 4062 LLMemType mt(LLMemType::MTYPE_OBJECT);
4067 // Update the data counters 4063 // Update the data counters
4068 if (mesgsys->getReceiveCompressedSize()) 4064 if (mesgsys->getReceiveCompressedSize())
@@ -4268,7 +4264,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
4268 4264
4269 // Don't play sounds triggered by someone you muted. 4265 // Don't play sounds triggered by someone you muted.
4270 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; 4266 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return;
4271 4267
4272 // Don't play sounds from an object you muted 4268 // Don't play sounds from an object you muted
4273 if (LLMuteList::getInstance()->isMuted(object_id)) return; 4269 if (LLMuteList::getInstance()->isMuted(object_id)) return;
4274 4270
@@ -4298,7 +4294,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
4298 { 4294 {
4299 return; 4295 return;
4300 }*/ 4296 }*/
4301 4297
4302 gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global); 4298 gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);
4303} 4299}
4304 4300
@@ -4322,10 +4318,10 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
4322 4318
4323 if (LLMuteList::getInstance()->isMuted(object_id)) return; 4319 if (LLMuteList::getInstance()->isMuted(object_id)) return;
4324 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; 4320 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return;
4325 4321
4326 LLAudioSource *sourcep = objectp->getAudioSource(owner_id); 4322 LLAudioSource *sourcep = objectp->getAudioSource(owner_id);
4327 if (!sourcep) return; 4323 if (!sourcep) return;
4328 4324
4329 LLAudioData *datap = gAudiop->getAudioData(sound_id); 4325 LLAudioData *datap = gAudiop->getAudioData(sound_id);
4330 4326
4331 // Note that I don't actually do any loading of the 4327 // Note that I don't actually do any loading of the
@@ -4339,7 +4335,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
4339 { 4335 {
4340 return; 4336 return;
4341 }*/ 4337 }*/
4342 4338
4343 // Add audioData starts a transfer internally. 4339 // Add audioData starts a transfer internally.
4344 sourcep->addAudioData(datap, FALSE); 4340 sourcep->addAudioData(datap, FALSE);
4345} 4341}
@@ -4367,12 +4363,12 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data)
4367 // we don't know about this object, just bail 4363 // we don't know about this object, just bail
4368 return; 4364 return;
4369 } 4365 }
4370 4366
4371 if (LLMuteList::getInstance()->isMuted(object_id)) return; 4367 if (LLMuteList::getInstance()->isMuted(object_id)) return;
4372 4368
4373 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; 4369 if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return;
4374 4370
4375 4371
4376 // Don't play sounds from a region with maturity above current agent maturity 4372 // Don't play sounds from a region with maturity above current agent maturity
4377 // Actually, let's -- MC 4373 // Actually, let's -- MC
4378 /*LLVector3d pos = objectp->getPositionGlobal(); 4374 /*LLVector3d pos = objectp->getPositionGlobal();
@@ -4380,7 +4376,7 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data)
4380 { 4376 {
4381 return; 4377 return;
4382 }*/ 4378 }*/
4383 4379
4384 objectp->setAttachedSound(sound_id, owner_id, gain, flags); 4380 objectp->setAttachedSound(sound_id, owner_id, gain, flags);
4385} 4381}
4386 4382
@@ -4419,7 +4415,7 @@ void process_health_message(LLMessageSystem *mesgsys, void **user_data)
4419 4415
4420 4416
4421void process_sim_stats(LLMessageSystem *msg, void **user_data) 4417void process_sim_stats(LLMessageSystem *msg, void **user_data)
4422{ 4418{
4423 S32 count = msg->getNumberOfBlocks("Stat"); 4419 S32 count = msg->getNumberOfBlocks("Stat");
4424 for (S32 i = 0; i < count; ++i) 4420 for (S32 i = 0; i < count; ++i)
4425 { 4421 {
@@ -4568,7 +4564,7 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data)
4568 BOOL was_flying = gAgent.getFlying(); 4564 BOOL was_flying = gAgent.getFlying();
4569 regionp->setRegionFlags(region_flags); 4565 regionp->setRegionFlags(region_flags);
4570 regionp->setMaxTasks(max_tasks_per_region); 4566 regionp->setMaxTasks(max_tasks_per_region);
4571 // HACK: This makes agents drop from the sky if the region is 4567 // HACK: This makes agents drop from the sky if the region is
4572 // set to no fly while people are still in the sim. 4568 // set to no fly while people are still in the sim.
4573 if (was_flying && regionp->getBlockFly()) 4569 if (was_flying && regionp->getBlockFly())
4574 { 4570 {
@@ -4585,7 +4581,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
4585 LLUUID uuid; 4581 LLUUID uuid;
4586 S32 anim_sequence_id; 4582 S32 anim_sequence_id;
4587 LLVOAvatar *avatarp; 4583 LLVOAvatar *avatarp;
4588 4584
4589 mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); 4585 mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid);
4590 4586
4591 //clear animation flags 4587 //clear animation flags
@@ -4602,7 +4598,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
4602 S32 num_source_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationSourceList); 4598 S32 num_source_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationSourceList);
4603 4599
4604 avatarp->mSignaledAnimations.clear(); 4600 avatarp->mSignaledAnimations.clear();
4605 4601
4606 if (avatarp->isSelf()) 4602 if (avatarp->isSelf())
4607 { 4603 {
4608 LLUUID object_id; 4604 LLUUID object_id;
@@ -4612,7 +4608,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
4612 mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i); 4608 mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i);
4613 mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i); 4609 mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i);
4614 4610
4615 LL_DEBUGS("Messaging") << "Animation id " << animation_id 4611 LL_DEBUGS("Messaging") << "Animation id " << animation_id
4616 << " from self using sequence id " << anim_sequence_id << LL_ENDL; 4612 << " from self using sequence id " << anim_sequence_id << LL_ENDL;
4617 4613
4618 avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; 4614 avatarp->mSignaledAnimations[animation_id] = anim_sequence_id;
@@ -4620,7 +4616,7 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
4620 if (i < num_source_blocks) 4616 if (i < num_source_blocks)
4621 { 4617 {
4622 mesgsys->getUUIDFast(_PREHASH_AnimationSourceList, _PREHASH_ObjectID, object_id, i); 4618 mesgsys->getUUIDFast(_PREHASH_AnimationSourceList, _PREHASH_ObjectID, object_id, i);
4623 4619
4624 LLViewerObject* object = gObjectList.findObject(object_id); 4620 LLViewerObject* object = gObjectList.findObject(object_id);
4625 if (object) 4621 if (object)
4626 { 4622 {
@@ -4652,8 +4648,8 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
4652 mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i); 4648 mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i);
4653 mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i); 4649 mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i);
4654 avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; 4650 avatarp->mSignaledAnimations[animation_id] = anim_sequence_id;
4655 LL_DEBUGS("Messaging") << "Received animation id " << animation_id 4651 LL_DEBUGS("Messaging") << "Received animation id " << animation_id
4656 << " from " << uuid 4652 << " from " << uuid
4657 << " using sequence id " << anim_sequence_id << LL_ENDL; 4653 << " using sequence id " << anim_sequence_id << LL_ENDL;
4658 } 4654 }
4659 } 4655 }
@@ -4728,7 +4724,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
4728 { 4724 {
4729 gAgent.setSitCamera(sitObjectID, camera_eye, camera_at); 4725 gAgent.setSitCamera(sitObjectID, camera_eye, camera_at);
4730 } 4726 }
4731 4727
4732 gAgent.mForceMouselook = force_mouselook; 4728 gAgent.mForceMouselook = force_mouselook;
4733 4729
4734 LLViewerObject* object = gObjectList.findObject(sitObjectID); 4730 LLViewerObject* object = gObjectList.findObject(sitObjectID);
@@ -4824,7 +4820,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
4824 LLFollowCamMgr::setFocusThreshold(source_id, value); 4820 LLFollowCamMgr::setFocusThreshold(source_id, value);
4825 break; 4821 break;
4826 case FOLLOWCAM_ACTIVE: 4822 case FOLLOWCAM_ACTIVE:
4827 //if 1, set using followcam,. 4823 //if 1, set using followcam,.
4828 LLFollowCamMgr::setCameraActive(source_id, value != 0.f); 4824 LLFollowCamMgr::setCameraActive(source_id, value != 0.f);
4829 break; 4825 break;
4830 case FOLLOWCAM_POSITION_X: 4826 case FOLLOWCAM_POSITION_X:
@@ -4876,7 +4872,7 @@ void process_set_follow_cam_properties(LLMessageSystem *mesgsys, void **user_dat
4876 LLFollowCamMgr::setFocusOffset(source_id, focus_offset); 4872 LLFollowCamMgr::setFocusOffset(source_id, focus_offset);
4877 } 4873 }
4878} 4874}
4879//end Ventrella 4875//end Ventrella
4880 4876
4881 4877
4882// Culled from newsim lltask.cpp 4878// Culled from newsim lltask.cpp
@@ -5068,7 +5064,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** )
5068bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) 5064bool handle_special_notification_callback(const LLSD& notification, const LLSD& response)
5069{ 5065{
5070 S32 option = LLNotification::getSelectedOption(notification, response); 5066 S32 option = LLNotification::getSelectedOption(notification, response);
5071 5067
5072 if (0 == option) 5068 if (0 == option)
5073 { 5069 {
5074 // set the preference to the maturity of the region we're calling 5070 // set the preference to the maturity of the region we're calling
@@ -5077,7 +5073,7 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD&
5077 gAgent.sendMaturityPreferenceToServer(preferredMaturity); 5073 gAgent.sendMaturityPreferenceToServer(preferredMaturity);
5078 5074
5079 } 5075 }
5080 5076
5081 return false; 5077 return false;
5082} 5078}
5083 5079
@@ -5086,10 +5082,10 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
5086{ 5082{
5087 int regionAccess = llsdBlock["_region_access"].asInteger(); 5083 int regionAccess = llsdBlock["_region_access"].asInteger();
5088 llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); 5084 llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess);
5089 5085
5090 // we're going to throw the LLSD in there in case anyone ever wants to use it 5086 // we're going to throw the LLSD in there in case anyone ever wants to use it
5091 LLNotifications::instance().add(notificationID+"_Notify", llsdBlock); 5087 LLNotifications::instance().add(notificationID+"_Notify", llsdBlock);
5092 5088
5093 if (regionAccess == SIM_ACCESS_MATURE) 5089 if (regionAccess == SIM_ACCESS_MATURE)
5094 { 5090 {
5095 if (gAgent.isTeen()) 5091 if (gAgent.isTeen())
@@ -5138,7 +5134,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
5138 llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl; 5134 llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl;
5139 } 5135 }
5140 } 5136 }
5141 5137
5142 if ( 5138 if (
5143 (notificationID == "RegionEntryAccessBlocked") || 5139 (notificationID == "RegionEntryAccessBlocked") ||
5144 (notificationID == "LandClaimAccessBlocked") || 5140 (notificationID == "LandClaimAccessBlocked") ||
@@ -5149,32 +5145,32 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
5149 (Commented so a grep will find the notification strings, since 5145 (Commented so a grep will find the notification strings, since
5150 we construct them on the fly; if you add additional notifications, 5146 we construct them on the fly; if you add additional notifications,
5151 please update the comment.) 5147 please update the comment.)
5152 5148
5153 Could throw any of the following notifications: 5149 Could throw any of the following notifications:
5154 5150
5155 RegionEntryAccessBlocked 5151 RegionEntryAccessBlocked
5156 RegionEntryAccessBlocked_Notify 5152 RegionEntryAccessBlocked_Notify
5157 RegionEntryAccessBlocked_Change 5153 RegionEntryAccessBlocked_Change
5158 RegionEntryAccessBlocked_KB 5154 RegionEntryAccessBlocked_KB
5159 LandClaimAccessBlocked 5155 LandClaimAccessBlocked
5160 LandClaimAccessBlocked_Notify 5156 LandClaimAccessBlocked_Notify
5161 LandClaimAccessBlocked_Change 5157 LandClaimAccessBlocked_Change
5162 LandClaimAccessBlocked_KB 5158 LandClaimAccessBlocked_KB
5163 LandBuyAccessBlocked 5159 LandBuyAccessBlocked
5164 LandBuyAccessBlocked_Notify 5160 LandBuyAccessBlocked_Notify
5165 LandBuyAccessBlocked_Change 5161 LandBuyAccessBlocked_Change
5166 LandBuyAccessBlocked_KB 5162 LandBuyAccessBlocked_KB
5167 5163
5168 -----------------------------------------------------------------------*/ 5164 -----------------------------------------------------------------------*/
5169 if (handle_special_notification(notificationID, llsdBlock)) 5165 if (handle_special_notification(notificationID, llsdBlock))
5170 { 5166 {
5171 return true; 5167 return true;
5172 } 5168 }
5173 } 5169 }
5174 5170
5175 LLNotifications::instance().add(notificationID, llsdBlock); 5171 LLNotifications::instance().add(notificationID, llsdBlock);
5176 return true; 5172 return true;
5177 } 5173 }
5178 return false; 5174 return false;
5179} 5175}
5180 5176
@@ -5184,7 +5180,7 @@ void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
5184 // make sure the cursor is back to the usual default since the 5180 // make sure the cursor is back to the usual default since the
5185 // alert is probably due to some kind of error. 5181 // alert is probably due to some kind of error.
5186 gViewerWindow->getWindow()->resetBusyCount(); 5182 gViewerWindow->getWindow()->resetBusyCount();
5187 5183
5188 if (!attempt_standard_notification(msgsystem)) 5184 if (!attempt_standard_notification(msgsystem))
5189 { 5185 {
5190 BOOL modal = FALSE; 5186 BOOL modal = FALSE;
@@ -5205,7 +5201,7 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
5205 // make sure the cursor is back to the usual default since the 5201 // make sure the cursor is back to the usual default since the
5206 // alert is probably due to some kind of error. 5202 // alert is probably due to some kind of error.
5207 gViewerWindow->getWindow()->resetBusyCount(); 5203 gViewerWindow->getWindow()->resetBusyCount();
5208 5204
5209 if (!attempt_standard_notification(msgsystem)) 5205 if (!attempt_standard_notification(msgsystem))
5210 { 5206 {
5211 BOOL modal = FALSE; 5207 BOOL modal = FALSE;
@@ -5334,7 +5330,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
5334{ 5330{
5335 if (gAgent.inPrelude()) 5331 if (gAgent.inPrelude())
5336 { 5332 {
5337 // In prelude, bumping is OK. This dialog is rather confusing to 5333 // In prelude, bumping is OK. This dialog is rather confusing to
5338 // newbies, so we don't show it. Drop the packet on the floor. 5334 // newbies, so we don't show it. Drop the packet on the floor.
5339 return; 5335 return;
5340 } 5336 }
@@ -5391,7 +5387,7 @@ void process_frozen_message(LLMessageSystem *msgsystem, void **user_data)
5391 // alert is probably due to some kind of error. 5387 // alert is probably due to some kind of error.
5392 gViewerWindow->getWindow()->resetBusyCount(); 5388 gViewerWindow->getWindow()->resetBusyCount();
5393 BOOL b_frozen; 5389 BOOL b_frozen;
5394 5390
5395 msgsystem->getBOOL("FrozenData", "Data", b_frozen); 5391 msgsystem->getBOOL("FrozenData", "Data", b_frozen);
5396 5392
5397 // TODO: make being frozen change view 5393 // TODO: make being frozen change view
@@ -5410,8 +5406,8 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
5410 5406
5411 S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); 5407 S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
5412 5408
5413 LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is " 5409 LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is "
5414 << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() 5410 << gHippoGridManager->getConnectedGrid()->getCurrencySymbol()
5415 << upload_cost << LL_ENDL; 5411 << upload_cost << LL_ENDL;
5416 5412
5417 LLFloaterImagePreview::setUploadAmount(upload_cost); 5413 LLFloaterImagePreview::setUploadAmount(upload_cost);
@@ -5434,13 +5430,13 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
5434 { 5430 {
5435 // check to see if the person we are asking 5431 // check to see if the person we are asking
5436 5432
5437 // "'[OBJECTNAME]', an object owned by '[OWNERNAME]', 5433 // "'[OBJECTNAME]', an object owned by '[OWNERNAME]',
5438 // located in [REGIONNAME] at [REGIONPOS], 5434 // located in [REGIONNAME] at [REGIONPOS],
5439 // has been <granted|denied> permission to: [PERMISSIONS]." 5435 // has been <granted|denied> permission to: [PERMISSIONS]."
5440 5436
5441 LLUIString notice(LLFloaterChat::getInstance()->getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied")); 5437 LLUIString notice(LLFloaterChat::getInstance()->getString(granted ? "ScriptQuestionCautionChatGranted" : "ScriptQuestionCautionChatDenied"));
5442 5438
5443 // always include the object name and owner name 5439 // always include the object name and owner name
5444 notice.setArg("[OBJECTNAME]", notification["payload"]["object_name"].asString()); 5440 notice.setArg("[OBJECTNAME]", notification["payload"]["object_name"].asString());
5445 notice.setArg("[OWNERNAME]", notification["payload"]["owner_name"].asString()); 5441 notice.setArg("[OWNERNAME]", notification["payload"]["owner_name"].asString());
5446 5442
@@ -5452,7 +5448,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
5452 { 5448 {
5453 // found the viewerobject, get it's position in its region 5449 // found the viewerobject, get it's position in its region
5454 LLVector3 objpos(viewobj->getPosition()); 5450 LLVector3 objpos(viewobj->getPosition());
5455 5451
5456 // try to lookup the name of the region the object is in 5452 // try to lookup the name of the region the object is in
5457 LLViewerRegion* viewregion = viewobj->getRegion(); 5453 LLViewerRegion* viewregion = viewobj->getRegion();
5458 if (viewregion) 5454 if (viewregion)
@@ -5479,7 +5475,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
5479 notice.setArg("[REGIONPOS]", "(unknown position)"); 5475 notice.setArg("[REGIONPOS]", "(unknown position)");
5480 } 5476 }
5481 5477
5482 // check each permission that was requested, and list each 5478 // check each permission that was requested, and list each
5483 // permission that has been flagged as a caution permission 5479 // permission that has been flagged as a caution permission
5484 BOOL caution = FALSE; 5480 BOOL caution = FALSE;
5485 S32 count = 0; 5481 S32 count = 0;
@@ -5531,7 +5527,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response)
5531 { 5527 {
5532 new_questions = 0; 5528 new_questions = 0;
5533 allowed = FALSE; 5529 allowed = FALSE;
5534 } 5530 }
5535 5531
5536 LLUUID task_id = notification["payload"]["task_id"].asUUID(); 5532 LLUUID task_id = notification["payload"]["task_id"].asUUID();
5537 LLUUID item_id = notification["payload"]["item_id"].asUUID(); 5533 LLUUID item_id = notification["payload"]["item_id"].asUUID();
@@ -5623,10 +5619,10 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
5623 { 5619 {
5624 throttle_name = taskid.getString(); 5620 throttle_name = taskid.getString();
5625 } 5621 }
5626 5622
5627 // don't display permission requests if this object is muted 5623 // don't display permission requests if this object is muted
5628 if (LLMuteList::getInstance()->isMuted(taskid)) return; 5624 if (LLMuteList::getInstance()->isMuted(taskid)) return;
5629 5625
5630 // throttle excessive requests from any specific user's scripts 5626 // throttle excessive requests from any specific user's scripts
5631 typedef LLKeyThrottle<std::string> LLStringThrottle; 5627 typedef LLKeyThrottle<std::string> LLStringThrottle;
5632 static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL ); 5628 static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL );
@@ -5663,7 +5659,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
5663 { 5659 {
5664 LLStringUtil::format_map_t args; 5660 LLStringUtil::format_map_t args;
5665 args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); 5661 args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();
5666 5662
5667 count++; 5663 count++;
5668 script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i], args) + "\n"; 5664 script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i], args) + "\n";
5669 5665
@@ -6016,7 +6012,7 @@ void send_group_notice(const LLUUID& group_id,
6016 { 6012 {
6017 bucket_to_send = (U8*) EMPTY_BINARY_BUCKET; 6013 bucket_to_send = (U8*) EMPTY_BINARY_BUCKET;
6018 } 6014 }
6019 6015
6020 6016
6021 send_improved_im( 6017 send_improved_im(
6022 group_id, 6018 group_id,
@@ -6081,7 +6077,7 @@ void handle_lure(const LLUUID& invitee)
6081} 6077}
6082 6078
6083// Prompt for a message to the invited user. 6079// Prompt for a message to the invited user.
6084void handle_lure(LLDynamicArray<LLUUID>& ids) 6080void handle_lure(LLDynamicArray<LLUUID>& ids)
6085{ 6081{
6086 LLSD edit_args; 6082 LLSD edit_args;
6087// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) 6083// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a)
@@ -6126,7 +6122,7 @@ void send_improved_im(const LLUUID& to_id,
6126 U8 offline, 6122 U8 offline,
6127 EInstantMessage dialog, 6123 EInstantMessage dialog,
6128 const LLUUID& id, 6124 const LLUUID& id,
6129 U32 timestamp, 6125 U32 timestamp,
6130 const U8* binary_bucket, 6126 const U8* binary_bucket,
6131 S32 binary_bucket_size) 6127 S32 binary_bucket_size)
6132{ 6128{
@@ -6185,7 +6181,7 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
6185 LL_WARNS("Messaging") << "process_user_info_reply - " 6181 LL_WARNS("Messaging") << "process_user_info_reply - "
6186 << "wrong agent id." << LL_ENDL; 6182 << "wrong agent id." << LL_ENDL;
6187 } 6183 }
6188 6184
6189 BOOL im_via_email; 6185 BOOL im_via_email;
6190 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email); 6186 msg->getBOOLFast(_PREHASH_UserData, _PREHASH_IMViaEMail, im_via_email);
6191 std::string email; 6187 std::string email;
@@ -6239,7 +6235,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
6239 6235
6240 LLSD payload; 6236 LLSD payload;
6241 6237
6242 std::string message; 6238 std::string message;
6243 std::string first_name; 6239 std::string first_name;
6244 std::string last_name; 6240 std::string last_name;
6245 std::string title; 6241 std::string title;
@@ -6259,7 +6255,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
6259 { 6255 {
6260 std::vector<LLMute> mutes = LLMuteList::getInstance()->getMutes(); 6256 std::vector<LLMute> mutes = LLMuteList::getInstance()->getMutes();
6261 for (U32 i = 0; i < mutes.size(); i++) 6257 for (U32 i = 0; i < mutes.size(); i++)
6262 { 6258 {
6263 //this is almost like saying (mutes[i].mType != LLMute::Object), but more verbose ... -Kaku 6259 //this is almost like saying (mutes[i].mType != LLMute::Object), but more verbose ... -Kaku
6264 if ( 6260 if (
6265 ((mutes[i].mType == LLMute::AGENT) 6261 ((mutes[i].mType == LLMute::AGENT)
@@ -6522,7 +6518,7 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
6522 // remove above two lines and replace with below line 6518 // remove above two lines and replace with below line
6523 // to re-enable parcel browser for llMapDestination() 6519 // to re-enable parcel browser for llMapDestination()
6524 // LLURLDispatcher::dispatch(LLURLDispatcher::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE); 6520 // LLURLDispatcher::dispatch(LLURLDispatcher::buildSLURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]), FALSE);
6525 6521
6526} 6522}
6527 6523
6528void process_covenant_reply(LLMessageSystem* msg, void**) 6524void process_covenant_reply(LLMessageSystem* msg, void**)
@@ -6555,7 +6551,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
6555 LLFloaterBuyLand::updateLastModified(last_modified); 6551 LLFloaterBuyLand::updateLastModified(last_modified);
6556 6552
6557 gCacheName->getName(estate_owner_id, callbackCacheEstateOwnerName); 6553 gCacheName->getName(estate_owner_id, callbackCacheEstateOwnerName);
6558 6554
6559 // load the actual covenant asset data 6555 // load the actual covenant asset data
6560 const BOOL high_priority = TRUE; 6556 const BOOL high_priority = TRUE;
6561 if (covenant_id.notNull()) 6557 if (covenant_id.notNull())
@@ -6593,7 +6589,7 @@ void callbackCacheEstateOwnerName(const LLUUID& id,
6593 BOOL is_group, void*) 6589 BOOL is_group, void*)
6594{ 6590{
6595 std::string name; 6591 std::string name;
6596 6592
6597 if (id.isNull()) 6593 if (id.isNull())
6598 { 6594 {
6599 name = "(none)"; 6595 name = "(none)";
@@ -6617,9 +6613,9 @@ void onCovenantLoadComplete(LLVFS *vfs,
6617 if(0 == status) 6613 if(0 == status)
6618 { 6614 {
6619 LLVFile file(vfs, asset_uuid, type, LLVFile::READ); 6615 LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
6620 6616
6621 S32 file_length = file.getSize(); 6617 S32 file_length = file.getSize();
6622 6618
6623 char* buffer = new char[file_length+1]; 6619 char* buffer = new char[file_length+1];
6624 if (buffer == NULL) 6620 if (buffer == NULL)
6625 { 6621 {
@@ -6628,10 +6624,10 @@ void onCovenantLoadComplete(LLVFS *vfs,
6628 } 6624 }
6629 6625
6630 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */ 6626 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
6631 6627
6632 // put a EOS at the end 6628 // put a EOS at the end
6633 buffer[file_length] = 0; 6629 buffer[file_length] = 0;
6634 6630
6635 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) 6631 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
6636 { 6632 {
6637 LLViewerTextEditor* editor = 6633 LLViewerTextEditor* editor =
@@ -6660,7 +6656,7 @@ void onCovenantLoadComplete(LLVFS *vfs,
6660 else 6656 else
6661 { 6657 {
6662 LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); 6658 LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
6663 6659
6664 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || 6660 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
6665 LL_ERR_FILE_EMPTY == status) 6661 LL_ERR_FILE_EMPTY == status)
6666 { 6662 {
@@ -6674,7 +6670,7 @@ void onCovenantLoadComplete(LLVFS *vfs,
6674 { 6670 {
6675 covenant_text = "Unable to load estate covenant at this time."; 6671 covenant_text = "Unable to load estate covenant at this time.";
6676 } 6672 }
6677 6673
6678 LL_WARNS("Messaging") << "Problem loading notecard: " << status << LL_ENDL; 6674 LL_WARNS("Messaging") << "Problem loading notecard: " << status << LL_ENDL;
6679 } 6675 }
6680 LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid); 6676 LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid);
@@ -6692,7 +6688,7 @@ void process_feature_disabled_message(LLMessageSystem* msg, void**)
6692 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage, messageText,0); 6688 msg->getStringFast(_PREHASH_FailureInfo,_PREHASH_ErrorMessage, messageText,0);
6693 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID); 6689 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_AgentID,agentID);
6694 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID); 6690 msg->getUUIDFast(_PREHASH_FailureInfo,_PREHASH_TransactionID,transactionID);
6695 6691
6696 LL_WARNS("Messaging") << "Blacklisted Feature Response:" << messageText << LL_ENDL; 6692 LL_WARNS("Messaging") << "Blacklisted Feature Response:" << messageText << LL_ENDL;
6697} 6693}
6698 6694
diff --git a/linden/indra/newview/llwaterparammanager.cpp b/linden/indra/newview/llwaterparammanager.cpp
index 0156622..2386631 100644
--- a/linden/indra/newview/llwaterparammanager.cpp
+++ b/linden/indra/newview/llwaterparammanager.cpp
@@ -3,9 +3,9 @@
3 * @brief Implementation for the LLWaterParamManager class. 3 * @brief Implementation for the LLWaterParamManager 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.
@@ -69,6 +69,7 @@
69 69
70#include "llwlparammanager.h" 70#include "llwlparammanager.h"
71#include "llwaterparamset.h" 71#include "llwaterparamset.h"
72#include "llettherebelight.h"
72#include "llpostprocess.h" 73#include "llpostprocess.h"
73#include "llfloaterwater.h" 74#include "llfloaterwater.h"
74 75
@@ -102,9 +103,9 @@ void LLWaterParamManager::loadAllPresets(const std::string& file_name)
102{ 103{
103 std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", "")); 104 std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", ""));
104 LL_DEBUGS2("AppInit", "ShaderLoading") << "Loading Default water settings from " << path_name << LL_ENDL; 105 LL_DEBUGS2("AppInit", "ShaderLoading") << "Loading Default water settings from " << path_name << LL_ENDL;
105 106
106 bool found = true; 107 bool found = true;
107 while(found) 108 while(found)
108 { 109 {
109 std::string name; 110 std::string name;
110 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false); 111 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false);
@@ -128,9 +129,9 @@ void LLWaterParamManager::loadAllPresets(const std::string& file_name)
128 129
129 std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); 130 std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", ""));
130 LL_DEBUGS2("AppInit", "Shaders") << "Loading User water settings from " << path_name2 << LL_ENDL; 131 LL_DEBUGS2("AppInit", "Shaders") << "Loading User water settings from " << path_name2 << LL_ENDL;
131 132
132 found = true; 133 found = true;
133 while(found) 134 while(found)
134 { 135 {
135 std::string name; 136 std::string name;
136 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false); 137 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false);
@@ -159,7 +160,7 @@ void LLWaterParamManager::loadPreset(const std::string & name,bool propagate)
159 if(propagate) 160 if(propagate)
160 { 161 {
161 getParamSet(name, mCurParams); 162 getParamSet(name, mCurParams);
162 propagateParameters(); 163 LightShare::apply(&mCurParams, NULL, NULL, WL_SCOPE_USER);
163 } 164 }
164 return; 165 return;
165 } 166 }
@@ -174,10 +175,10 @@ void LLWaterParamManager::loadPreset(const std::string & name,bool propagate)
174 175
175 std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", escaped_filename)); 176 std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", escaped_filename));
176 LL_DEBUGS2("AppInit", "Shaders") << "Loading water settings from " << pathName << LL_ENDL; 177 LL_DEBUGS2("AppInit", "Shaders") << "Loading water settings from " << pathName << LL_ENDL;
177 178
178 std::ifstream presetsXML; 179 std::ifstream presetsXML;
179 presetsXML.open(pathName.c_str()); 180 presetsXML.open(pathName.c_str());
180 181
181 // That failed, try loading from the users area instead. 182 // That failed, try loading from the users area instead.
182 if(!presetsXML) 183 if(!presetsXML)
183 { 184 {
@@ -190,8 +191,8 @@ void LLWaterParamManager::loadPreset(const std::string & name,bool propagate)
190 { 191 {
191 loadPresetXML(name, presetsXML); 192 loadPresetXML(name, presetsXML);
192 presetsXML.close(); 193 presetsXML.close();
193 } 194 }
194 else 195 else
195 { 196 {
196 llwarns << "Can't find " << name << llendl; 197 llwarns << "Can't find " << name << llendl;
197 return; 198 return;
@@ -200,21 +201,21 @@ void LLWaterParamManager::loadPreset(const std::string & name,bool propagate)
200 if(propagate) 201 if(propagate)
201 { 202 {
202 getParamSet(name, mCurParams); 203 getParamSet(name, mCurParams);
203 propagateParameters(); 204 LightShare::apply(&mCurParams, NULL, NULL, WL_SCOPE_USER);
204 } 205 }
205} 206}
206 207
207bool LLWaterParamManager::loadPresetXML(const std::string& name, std::istream& preset_stream, bool propagate /* = false */, bool check_if_real /* = false */) 208bool LLWaterParamManager::loadPresetXML(const std::string& name, std::istream& preset_stream, bool propagate /* = false */, bool check_if_real /* = false */)
208{ 209{
209 LLSD paramsData(LLSD::emptyMap()); 210 LLSD paramsData(LLSD::emptyMap());
210 211
211 LLPointer<LLSDParser> parser = new LLSDXMLParser(); 212 LLPointer<LLSDParser> parser = new LLSDXMLParser();
212 213
213 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) 214 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
214 { 215 {
215 return false; 216 return false;
216 } 217 }
217 218
218 if(check_if_real) 219 if(check_if_real)
219 { 220 {
220 static const char* expected_windlight_settings[] = { 221 static const char* expected_windlight_settings[] = {
@@ -240,17 +241,17 @@ bool LLWaterParamManager::loadPresetXML(const std::string& name, std::istream& p
240 } 241 }
241 } 242 }
242 } 243 }
243 244
244 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); 245 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
245 if(mIt == mParamList.end()) 246 if(mIt == mParamList.end())
246 { 247 {
247 addParamSet(name, paramsData); 248 addParamSet(name, paramsData);
248 } 249 }
249 else 250 else
250 { 251 {
251 setParamSet(name, paramsData); 252 setParamSet(name, paramsData);
252 } 253 }
253 254
254 if(propagate) 255 if(propagate)
255 { 256 {
256 getParamSet(name, mCurParams); 257 getParamSet(name, mCurParams);
@@ -306,19 +307,19 @@ bool LLWaterParamManager::savePresetToNotecard(const std::string & name)
306{ 307{
307 // make an empty llsd 308 // make an empty llsd
308 LLSD paramsData(LLSD::emptyMap()); 309 LLSD paramsData(LLSD::emptyMap());
309 310
310 // fill it with LLSD windlight params 311 // fill it with LLSD windlight params
311 paramsData = mParamList[name].getAll(); 312 paramsData = mParamList[name].getAll();
312 313
313 // get some XML 314 // get some XML
314 std::ostringstream presetsXML; 315 std::ostringstream presetsXML;
315 LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); 316 LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
316 formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); 317 formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
317 318
318 // Write it to a notecard 319 // Write it to a notecard
319 LLNotecard notecard; 320 LLNotecard notecard;
320 notecard.setText(presetsXML.str()); 321 notecard.setText(presetsXML.str());
321 322
322 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID); 323 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID);
323 if(!item) 324 if(!item)
324 { 325 {
@@ -332,13 +333,13 @@ bool LLWaterParamManager::savePresetToNotecard(const std::string & name)
332 LLAssetID asset_id; 333 LLAssetID asset_id;
333 tid.generate(); 334 tid.generate();
334 asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); 335 asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
335 336
336 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND); 337 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND);
337 338
338 std::ostringstream stream; 339 std::ostringstream stream;
339 notecard.exportStream(stream); 340 notecard.exportStream(stream);
340 std::string buffer = stream.str(); 341 std::string buffer = stream.str();
341 342
342 S32 size = buffer.length() + 1; 343 S32 size = buffer.length() + 1;
343 file.setMaxSize(size); 344 file.setMaxSize(size);
344 file.write((U8*)buffer.c_str(), size); 345 file.write((U8*)buffer.c_str(), size);
@@ -351,7 +352,7 @@ bool LLWaterParamManager::savePresetToNotecard(const std::string & name)
351 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL; 352 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL;
352 return false; 353 return false;
353 } 354 }
354 355
355 propagateParameters(); 356 propagateParameters();
356 return true; 357 return true;
357} 358}
@@ -374,8 +375,8 @@ void LLWaterParamManager::propagateParameters(void)
374 } 375 }
375 376
376 bool err; 377 bool err;
377 F32 fog_density_slider = 378 F32 fog_density_slider =
378 log(mCurParams.getFloat(mFogDensity.mName, err)) / 379 log(mCurParams.getFloat(mFogDensity.mName, err)) /
379 log(mFogDensity.mBase); 380 log(mFogDensity.mBase);
380 381
381 setDensitySliderValue(fog_density_slider); 382 setDensitySliderValue(fog_density_slider);
@@ -398,12 +399,12 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
398void LLWaterParamManager::update(LLViewerCamera * cam) 399void LLWaterParamManager::update(LLViewerCamera * cam)
399{ 400{
400 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); 401 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM);
401 402
402 // update the shaders and the menu 403 // update the shaders and the menu
403 propagateParameters(); 404 propagateParameters();
404 405
405 // sync menus if they exist 406 // sync menus if they exist
406 if(LLFloaterWater::isOpen()) 407 if(LLFloaterWater::isOpen())
407 { 408 {
408 LLFloaterWater::instance()->syncMenu(); 409 LLFloaterWater::instance()->syncMenu();
409 } 410 }
@@ -411,12 +412,12 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
411 stop_glerror(); 412 stop_glerror();
412 413
413 // only do this if we're dealing with shaders 414 // only do this if we're dealing with shaders
414 if(gPipeline.canUseVertexShaders()) 415 if(gPipeline.canUseVertexShaders())
415 { 416 {
416 //transform water plane to eye space 417 //transform water plane to eye space
417 glh::vec3f norm(0.f, 0.f, 1.f); 418 glh::vec3f norm(0.f, 0.f, 1.f);
418 glh::vec3f p(0.f, 0.f, gAgent.getRegion()->getWaterHeight()+0.1f); 419 glh::vec3f p(0.f, 0.f, gAgent.getRegion()->getWaterHeight()+0.1f);
419 420
420 F32 modelView[16]; 421 F32 modelView[16];
421 for (U32 i = 0; i < 16; i++) 422 for (U32 i = 0; i < 16; i++)
422 { 423 {
@@ -434,13 +435,13 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
434 mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm)); 435 mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm));
435 436
436 LLVector3 sunMoonDir; 437 LLVector3 sunMoonDir;
437 if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS) 438 if (gSky.getSunDirection().mV[2] > NIGHTTIME_ELEVATION_COS)
438 { 439 {
439 sunMoonDir = gSky.getSunDirection(); 440 sunMoonDir = gSky.getSunDirection();
440 } 441 }
441 else 442 else
442 { 443 {
443 sunMoonDir = gSky.getMoonDirection(); 444 sunMoonDir = gSky.getMoonDirection();
444 } 445 }
445 sunMoonDir.normVec(); 446 sunMoonDir.normVec();
446 mWaterFogKS = 1.f/llmax(sunMoonDir.mV[2], WATER_FOG_LIGHT_CLAMP); 447 mWaterFogKS = 1.f/llmax(sunMoonDir.mV[2], WATER_FOG_LIGHT_CLAMP);
@@ -510,8 +511,8 @@ bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet&
510{ 511{
511 // add a new one if not one there already 512 // add a new one if not one there already
512 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); 513 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
513 if(mIt == mParamList.end()) 514 if(mIt == mParamList.end())
514 { 515 {
515 mParamList[name] = param; 516 mParamList[name] = param;
516 return true; 517 return true;
517 } 518 }
@@ -538,7 +539,7 @@ bool LLWaterParamManager::getParamSet(const std::string& name, LLWaterParamSet&
538{ 539{
539 // find it and set it 540 // find it and set it
540 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); 541 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
541 if(mIt != mParamList.end()) 542 if(mIt != mParamList.end())
542 { 543 {
543 param = mParamList[name]; 544 param = mParamList[name];
544 param.mName = name; 545 param.mName = name;
@@ -558,11 +559,11 @@ bool LLWaterParamManager::setParamSet(const std::string& name, LLWaterParamSet&
558bool LLWaterParamManager::setParamSet(const std::string& name, const LLSD & param) 559bool LLWaterParamManager::setParamSet(const std::string& name, const LLSD & param)
559{ 560{
560 // quick, non robust (we won't be working with files, but assets) check 561 // quick, non robust (we won't be working with files, but assets) check
561 if(!param.isMap()) 562 if(!param.isMap())
562 { 563 {
563 return false; 564 return false;
564 } 565 }
565 566
566 mParamList[name].setAll(param); 567 mParamList[name].setAll(param);
567 568
568 return true; 569 return true;
@@ -572,7 +573,7 @@ bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_fr
572{ 573{
573 // remove from param list 574 // remove from param list
574 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); 575 std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
575 if(mIt != mParamList.end()) 576 if(mIt != mParamList.end())
576 { 577 {
577 mParamList.erase(mIt); 578 mParamList.erase(mIt);
578 } 579 }
@@ -581,13 +582,13 @@ bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_fr
581 { 582 {
582 583
583 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); 584 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", ""));
584 585
585 // use full curl escaped name 586 // use full curl escaped name
586 char * curl_str = curl_escape(name.c_str(), name.size()); 587 char * curl_str = curl_escape(name.c_str(), name.size());
587 std::string escaped_name(curl_str); 588 std::string escaped_name(curl_str);
588 curl_free(curl_str); 589 curl_free(curl_str);
589 curl_str = NULL; 590 curl_str = NULL;
590 591
591 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml"); 592 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml");
592 } 593 }
593 594
@@ -599,7 +600,7 @@ F32 LLWaterParamManager::getFogDensity(void)
599 bool err; 600 bool err;
600 601
601 F32 fogDensity = mCurParams.getFloat("waterFogDensity", err); 602 F32 fogDensity = mCurParams.getFloat("waterFogDensity", err);
602 603
603 // modify if we're underwater 604 // modify if we're underwater
604 const F32 water_height = gAgent.getRegion() ? gAgent.getRegion()->getWaterHeight() : 0.f; 605 const F32 water_height = gAgent.getRegion() ? gAgent.getRegion()->getWaterHeight() : 0.f;
605 F32 camera_height = gAgent.getCameraPositionAgent().mV[2]; 606 F32 camera_height = gAgent.getCameraPositionAgent().mV[2];
@@ -659,7 +660,7 @@ void LLWaterParamManager::loadWaterNotecard(LLVFS *vfs, const LLUUID& asset_id,
659 } 660 }
660 else 661 else
661 { 662 {
662 // We can do this because we know mCurParams 663 // We can do this because we know mCurParams
663 sInstance->mParamList[name].mInventoryID = inventory_id; 664 sInstance->mParamList[name].mInventoryID = inventory_id;
664 } 665 }
665 } 666 }
diff --git a/linden/indra/newview/llwaterparamset.h b/linden/indra/newview/llwaterparamset.h
index efbad31..09da42b 100644
--- a/linden/indra/newview/llwaterparamset.h
+++ b/linden/indra/newview/llwaterparamset.h
@@ -47,12 +47,14 @@ class LLWaterParamSet;
47class LLWaterParamSet 47class LLWaterParamSet
48{ 48{
49 friend class LLWaterParamManager; 49 friend class LLWaterParamManager;
50 friend class LLWLParamManager;
51 friend class LightShare;
50 52
51public: 53public:
52 std::string mName; 54 std::string mName;
53 LLUUID mInventoryID; 55 LLUUID mInventoryID;
54 56
55private: 57protected:
56 58
57 LLSD mParamValues; 59 LLSD mParamValues;
58 60
diff --git a/linden/indra/newview/llwlparammanager.cpp b/linden/indra/newview/llwlparammanager.cpp
index 8007cce..59de0ad 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.
@@ -33,6 +33,8 @@
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "llwlparammanager.h" 35#include "llwlparammanager.h"
36#include "llwaterparammanager.h"
37#include "llettherebelight.h"
36 38
37#include "pipeline.h" 39#include "pipeline.h"
38#include "llsky.h" 40#include "llsky.h"
@@ -60,6 +62,7 @@
60#include "llfloaterdaycycle.h" 62#include "llfloaterdaycycle.h"
61#include "llfloaterenvsettings.h" 63#include "llfloaterenvsettings.h"
62 64
65#include "llworld.h"
63 66
64// For notecard loading 67// For notecard loading
65#include "llvfile.h" 68#include "llvfile.h"
@@ -124,9 +127,9 @@ void LLWLParamManager::loadPresets(const std::string& file_name)
124{ 127{
125 std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", "")); 128 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; 129 LL_DEBUGS2("AppInit", "ShaderLoading") << "Loading Default WindLight settings from " << path_name << LL_ENDL;
127 130
128 bool found = true; 131 bool found = true;
129 while(found) 132 while(found)
130 { 133 {
131 std::string name; 134 std::string name;
132 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false); 135 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false);
@@ -150,9 +153,9 @@ void LLWLParamManager::loadPresets(const std::string& file_name)
150 153
151 std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); 154 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; 155 LL_INFOS2("AppInit", "Shaders") << "Loading User WindLight settings from " << path_name2 << LL_ENDL;
153 156
154 found = true; 157 found = true;
155 while(found) 158 while(found)
156 { 159 {
157 std::string name; 160 std::string name;
158 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false); 161 found = gDirUtilp->getNextFileInDir(path_name2, "*.xml", name, false);
@@ -176,14 +179,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 */) 179bool LLWLParamManager::loadPresetXML(const std::string& name, std::istream& preset_stream, bool propagate /* = false */, bool check_if_real /* = false */)
177{ 180{
178 LLSD paramsData(LLSD::emptyMap()); 181 LLSD paramsData(LLSD::emptyMap());
179 182
180 LLPointer<LLSDParser> parser = new LLSDXMLParser(); 183 LLPointer<LLSDParser> parser = new LLSDXMLParser();
181 184
182 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE) 185 if(parser->parse(preset_stream, paramsData, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
183 { 186 {
184 return false; 187 return false;
185 } 188 }
186 189
187 if(check_if_real) 190 if(check_if_real)
188 { 191 {
189 static const char* expected_windlight_settings[] = { 192 static const char* expected_windlight_settings[] = {
@@ -220,13 +223,13 @@ bool LLWLParamManager::loadPresetXML(const std::string& name, std::istream& pres
220 } 223 }
221 } 224 }
222 } 225 }
223 226
224 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 227 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
225 if(mIt == mParamList.end()) 228 if(mIt == mParamList.end())
226 { 229 {
227 addParamSet(name, paramsData); 230 addParamSet(name, paramsData);
228 } 231 }
229 else 232 else
230 { 233 {
231 setParamSet(name, paramsData); 234 setParamSet(name, paramsData);
232 } 235 }
@@ -258,12 +261,12 @@ void LLWLParamManager::savePresets(const std::string & fileName)
258 //and not over the RO system wide version. 261 //and not over the RO system wide version.
259 262
260 LLSD paramsData(LLSD::emptyMap()); 263 LLSD paramsData(LLSD::emptyMap());
261 264
262 std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName)); 265 std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName));
263 266
264 for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin(); 267 for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin();
265 mIt != mParamList.end(); 268 mIt != mParamList.end();
266 ++mIt) 269 ++mIt)
267 { 270 {
268 paramsData[mIt->first] = mIt->second.getAll(); 271 paramsData[mIt->first] = mIt->second.getAll();
269 } 272 }
@@ -295,7 +298,7 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
295 // Write it to a notecard 298 // Write it to a notecard
296 LLNotecard notecard; 299 LLNotecard notecard;
297 notecard.setText(presetsXML.str()); 300 notecard.setText(presetsXML.str());
298 301
299 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID); 302 LLInventoryItem *item = gInventory.getItem(mParamList[name].mInventoryID);
300 if(!item) 303 if(!item)
301 { 304 {
@@ -309,13 +312,13 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
309 LLAssetID asset_id; 312 LLAssetID asset_id;
310 tid.generate(); 313 tid.generate();
311 asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); 314 asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
312 315
313 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND); 316 LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND);
314 317
315 std::ostringstream stream; 318 std::ostringstream stream;
316 notecard.exportStream(stream); 319 notecard.exportStream(stream);
317 std::string buffer = stream.str(); 320 std::string buffer = stream.str();
318 321
319 S32 size = buffer.length() + 1; 322 S32 size = buffer.length() + 1;
320 file.setMaxSize(size); 323 file.setMaxSize(size);
321 file.write((U8*)buffer.c_str(), size); 324 file.write((U8*)buffer.c_str(), size);
@@ -328,7 +331,7 @@ bool LLWLParamManager::savePresetToNotecard(const std::string & name)
328 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL; 331 LL_WARNS("WindLight") << "Stuff the legacy system." << LL_ENDL;
329 return false; 332 return false;
330 } 333 }
331 334
332 propagateParameters(); 335 propagateParameters();
333 return true; 336 return true;
334} 337}
@@ -341,7 +344,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
341 if(propagate) 344 if(propagate)
342 { 345 {
343 getParamSet(name, mCurParams); 346 getParamSet(name, mCurParams);
344 propagateParameters(); 347 LightShare::apply(NULL, NULL, &mCurParams, WL_SCOPE_USER);
345 } 348 }
346 return; 349 return;
347 } 350 }
@@ -355,7 +358,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
355 escaped_filename += ".xml"; 358 escaped_filename += ".xml";
356 359
357 std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename)); 360 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; 361 LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL;
359 362
360 llifstream presetsXML; 363 llifstream presetsXML;
361 presetsXML.open(pathName.c_str()); 364 presetsXML.open(pathName.c_str());
@@ -364,7 +367,7 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
364 if(!presetsXML) 367 if(!presetsXML)
365 { 368 {
366 pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename); 369 pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename);
367 LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL; 370 LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL;
368 presetsXML.open(pathName.c_str()); 371 presetsXML.open(pathName.c_str());
369 } 372 }
370 373
@@ -372,22 +375,22 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
372 { 375 {
373 loadPresetXML(name, presetsXML); 376 loadPresetXML(name, presetsXML);
374 presetsXML.close(); 377 presetsXML.close();
375 } 378 }
376 else 379 else
377 { 380 {
378 llwarns << "Can't find " << name << llendl; 381 llwarns << "Can't find " << name << llendl;
379 return; 382 return;
380 } 383 }
381 384
382 385
383 if(propagate) 386 if(propagate)
384 { 387 {
385 getParamSet(name, mCurParams); 388 getParamSet(name, mCurParams);
386 propagateParameters(); 389 LightShare::apply(NULL, NULL, &mCurParams, WL_SCOPE_USER);
387 } 390 }
388 391
389 notifyObservers(); 392 notifyObservers();
390} 393}
391 394
392void LLWLParamManager::savePreset(const std::string & name) 395void LLWLParamManager::savePreset(const std::string & name)
393{ 396{
@@ -427,7 +430,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader)
427 { 430 {
428 shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); 431 shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV);
429 shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); 432 shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV);
430 } 433 }
431 434
432 else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) 435 else if (shader->mShaderGroup == LLGLSLShader::SG_SKY)
433 { 436 {
@@ -435,13 +438,13 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader)
435 } 438 }
436 439
437 shader->uniform1f("scene_light_strength", mSceneLightStrength); 440 shader->uniform1f("scene_light_strength", mSceneLightStrength);
438 441
439} 442}
440 443
441void LLWLParamManager::propagateParameters(void) 444void LLWLParamManager::propagateParameters(void)
442{ 445{
443 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); 446 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM);
444 447
445 LLVector4 sunDir; 448 LLVector4 sunDir;
446 LLVector4 moonDir; 449 LLVector4 moonDir;
447 450
@@ -491,7 +494,7 @@ void LLWLParamManager::propagateParameters(void)
491 // bind the variables for all shaders only if we're using WindLight 494 // bind the variables for all shaders only if we're using WindLight
492 LLViewerShaderMgr::shader_iter shaders_iter, end_shaders; 495 LLViewerShaderMgr::shader_iter shaders_iter, end_shaders;
493 end_shaders = LLViewerShaderMgr::instance()->endShaders(); 496 end_shaders = LLViewerShaderMgr::instance()->endShaders();
494 for(shaders_iter = LLViewerShaderMgr::instance()->beginShaders(); shaders_iter != end_shaders; ++shaders_iter) 497 for(shaders_iter = LLViewerShaderMgr::instance()->beginShaders(); shaders_iter != end_shaders; ++shaders_iter)
495 { 498 {
496 if (shaders_iter->mProgramObject != 0 499 if (shaders_iter->mProgramObject != 0
497 && (gPipeline.canUseWindLightShaders() 500 && (gPipeline.canUseWindLightShaders()
@@ -512,29 +515,29 @@ void LLWLParamManager::propagateParameters(void)
512void LLWLParamManager::update(LLViewerCamera * cam) 515void LLWLParamManager::update(LLViewerCamera * cam)
513{ 516{
514 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM); 517 LLFastTimer ftm(LLFastTimer::FTM_UPDATE_WLPARAM);
515 518
516 // update clouds, sun, and general 519 // update clouds, sun, and general
517 mCurParams.updateCloudScrolling(); 520 mCurParams.updateCloudScrolling();
518 521
519 // update only if running 522 // update only if running
520 if(mAnimator.mIsRunning) 523 if(mAnimator.mIsRunning)
521 { 524 {
522 mAnimator.update(mCurParams); 525 mAnimator.update(mCurParams);
523 } 526 }
524 527
525 // update the shaders and the menu 528 // update the shaders and the menu
526 propagateParameters(); 529 propagateParameters();
527 530
528 // sync menus if they exist 531 // sync menus if they exist
529 if(LLFloaterWindLight::isOpen()) 532 if(LLFloaterWindLight::isOpen())
530 { 533 {
531 LLFloaterWindLight::instance()->syncMenu(); 534 LLFloaterWindLight::instance()->syncMenu();
532 } 535 }
533 if(LLFloaterDayCycle::isOpen()) 536 if(LLFloaterDayCycle::isOpen())
534 { 537 {
535 LLFloaterDayCycle::instance()->syncMenu(); 538 LLFloaterDayCycle::instance()->syncMenu();
536 } 539 }
537 if(LLFloaterEnvSettings::isOpen()) 540 if(LLFloaterEnvSettings::isOpen())
538 { 541 {
539 LLFloaterEnvSettings::instance()->syncMenu(); 542 LLFloaterEnvSettings::instance()->syncMenu();
540 } 543 }
@@ -547,8 +550,8 @@ void LLWLParamManager::update(LLViewerCamera * cam)
547 // executed some of the time. For example for water shaders only. 550 // executed some of the time. For example for water shaders only.
548 { 551 {
549 F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD; 552 F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD;
550 553
551 LLVector3 lightNorm3(mLightDir); 554 LLVector3 lightNorm3(mLightDir);
552 lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f)); 555 lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f));
553 mRotatedLightDir = LLVector4(lightNorm3, 0.f); 556 mRotatedLightDir = LLVector4(lightNorm3, 0.f);
554 557
@@ -621,7 +624,7 @@ void LLWLParamManager::cleanupClass()
621 624
622void LLWLParamManager::resetAnimator(F32 curTime, bool run) 625void LLWLParamManager::resetAnimator(F32 curTime, bool run)
623{ 626{
624 mAnimator.setTrack(mDay.mTimeMap, mDay.mDayRate, 627 mAnimator.setTrack(mDay.mTimeMap, mDay.mDayRate,
625 curTime, run); 628 curTime, run);
626 629
627 return; 630 return;
@@ -630,8 +633,8 @@ bool LLWLParamManager::addParamSet(const std::string& name, LLWLParamSet& param)
630{ 633{
631 // add a new one if not one there already 634 // add a new one if not one there already
632 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 635 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
633 if(mIt == mParamList.end()) 636 if(mIt == mParamList.end())
634 { 637 {
635 mParamList[name] = param; 638 mParamList[name] = param;
636 return true; 639 return true;
637 } 640 }
@@ -658,7 +661,7 @@ bool LLWLParamManager::getParamSet(const std::string& name, LLWLParamSet& param)
658{ 661{
659 // find it and set it 662 // find it and set it
660 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 663 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
661 if(mIt != mParamList.end()) 664 if(mIt != mParamList.end())
662 { 665 {
663 param = mParamList[name]; 666 param = mParamList[name];
664 param.mName = name; 667 param.mName = name;
@@ -678,11 +681,11 @@ bool LLWLParamManager::setParamSet(const std::string& name, LLWLParamSet& param)
678bool LLWLParamManager::setParamSet(const std::string& name, const LLSD & param) 681bool LLWLParamManager::setParamSet(const std::string& name, const LLSD & param)
679{ 682{
680 // quick, non robust (we won't be working with files, but assets) check 683 // quick, non robust (we won't be working with files, but assets) check
681 if(!param.isMap()) 684 if(!param.isMap())
682 { 685 {
683 return false; 686 return false;
684 } 687 }
685 688
686 mParamList[name].setAll(param); 689 mParamList[name].setAll(param);
687 690
688 return true; 691 return true;
@@ -692,7 +695,7 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
692{ 695{
693 // remove from param list 696 // remove from param list
694 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); 697 std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
695 if(mIt != mParamList.end()) 698 if(mIt != mParamList.end())
696 { 699 {
697 mParamList.erase(mIt); 700 mParamList.erase(mIt);
698 } 701 }
@@ -701,11 +704,11 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
701 704
702 // remove all references 705 // remove all references
703 bool stat = true; 706 bool stat = true;
704 do 707 do
705 { 708 {
706 // get it 709 // get it
707 stat = mDay.getKey(name, key); 710 stat = mDay.getKey(name, key);
708 if(stat == false) 711 if(stat == false)
709 { 712 {
710 break; 713 break;
711 } 714 }
@@ -714,17 +717,17 @@ bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_
714 stat = mDay.removeKey(key); 717 stat = mDay.removeKey(key);
715 718
716 } while(stat == true); 719 } while(stat == true);
717 720
718 if(delete_from_disk) 721 if(delete_from_disk)
719 { 722 {
720 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); 723 std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", ""));
721 724
722 // use full curl escaped name 725 // use full curl escaped name
723 char * curl_str = curl_escape(name.c_str(), name.size()); 726 char * curl_str = curl_escape(name.c_str(), name.size());
724 std::string escaped_name(curl_str); 727 std::string escaped_name(curl_str);
725 curl_free(curl_str); 728 curl_free(curl_str);
726 curl_str = NULL; 729 curl_str = NULL;
727 730
728 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml"); 731 gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml");
729 } 732 }
730 733
@@ -797,7 +800,7 @@ void LLWLParamManager::loadWindlightNotecard(LLVFS *vfs, const LLUUID& asset_id,
797 } 800 }
798 else 801 else
799 { 802 {
800 // We can do this because we know mCurParams 803 // We can do this because we know mCurParams
801 sInstance->mParamList[name].mInventoryID = inventory_id; 804 sInstance->mParamList[name].mInventoryID = inventory_id;
802 } 805 }
803 } 806 }
@@ -836,3 +839,21 @@ void LLWLParamManager::notifyObservers()
836 observer->changed(); 839 observer->changed();
837 } 840 }
838} 841}
842
843// static
844bool LLWLParamManager::isWaterSettingsNotecard(std::string name)
845{
846 return (name.length() > 2 && name.compare(name.length() - 3, 3, ".ww") == 0);
847}
848
849// static
850bool LLWLParamManager::isSkySettingsNotecard(std::string name)
851{
852 return (name.length() > 2 && name.compare(name.length() - 3, 3, ".wl") == 0);
853}
854
855// static
856bool LLWLParamManager::isSettingsNotecard(std::string name)
857{
858 return (isSkySettingsNotecard(name) || isWaterSettingsNotecard(name));
859}
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
56struct WLColorControl { 57struct 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
135class LLWLParamManager 137class 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
226public: 233public:
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
282private: 289private:
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
297inline F32 LLWLParamManager::getDomeOffset(void) const 303inline F32 LLWLParamManager::getDomeOffset(void) const
diff --git a/linden/indra/newview/llwlparamset.h b/linden/indra/newview/llwlparamset.h
index 038490d..ce01f84 100644
--- a/linden/indra/newview/llwlparamset.h
+++ b/linden/indra/newview/llwlparamset.h
@@ -3,9 +3,9 @@
3 * @brief Interface for the LLWLParamSet class. 3 * @brief Interface for the LLWLParamSet class.
4 * 4 *
5 * $LicenseInfo:firstyear=2005&license=viewergpl$ 5 * $LicenseInfo:firstyear=2005&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2005-2009, Linden Research, Inc. 7 * Copyright (c) 2005-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.
@@ -46,16 +46,16 @@ class LLWLParamSet;
46/// A class representing a set of parameter values for the WindLight shaders. 46/// A class representing a set of parameter values for the WindLight shaders.
47class LLWLParamSet { 47class LLWLParamSet {
48 48
49 friend class LLWLParamManager; 49 friend class LightShare;
50 50
51public: 51public:
52 std::string mName; 52 std::string mName;
53 LLUUID mInventoryID; 53 LLUUID mInventoryID;
54 54
55private: 55protected:
56 56
57 LLSD mParamValues; 57 LLSD mParamValues;
58 58
59 float mCloudScrollXOffset, mCloudScrollYOffset; 59 float mCloudScrollXOffset, mCloudScrollYOffset;
60 60
61public: 61public:
@@ -67,10 +67,10 @@ public:
67 67
68 /// set the total llsd 68 /// set the total llsd
69 void setAll(const LLSD& val); 69 void setAll(const LLSD& val);
70 70
71 /// get the total llsd 71 /// get the total llsd
72 const LLSD& getAll(); 72 const LLSD& getAll();
73 73
74 74
75 /// Set a float parameter. 75 /// Set a float parameter.
76 /// \param paramName The name of the parameter to set. 76 /// \param paramName The name of the parameter to set.
@@ -120,61 +120,61 @@ public:
120 120
121 /// Get an integer parameter 121 /// Get an integer parameter
122 /// \param paramName The name of the parameter to set. 122 /// \param paramName The name of the parameter to set.
123 /// \param error A flag to set if it's not the proper return type 123 /// \param error A flag to set if it's not the proper return type
124 F32 getFloat(const std::string& paramName, bool& error); 124 F32 getFloat(const std::string& paramName, bool& error);
125 125
126 126
127 // specific getters and setters 127 // specific getters and setters
128 128
129 129
130 /// set the star's brightness 130 /// set the star's brightness
131 /// \param val brightness value 131 /// \param val brightness value
132 void setStarBrightness(F32 val); 132 void setStarBrightness(F32 val);
133 133
134 /// get the star brightness value; 134 /// get the star brightness value;
135 F32 getStarBrightness(); 135 F32 getStarBrightness();
136 136
137 void setSunAngle(F32 val); 137 void setSunAngle(F32 val);
138 F32 getSunAngle(); 138 F32 getSunAngle();
139 139
140 void setEastAngle(F32 val); 140 void setEastAngle(F32 val);
141 F32 getEastAngle(); 141 F32 getEastAngle();
142 142
143 143
144 144
145 /// set the cloud scroll x enable value 145 /// set the cloud scroll x enable value
146 /// \param val scroll x value 146 /// \param val scroll x value
147 void setEnableCloudScrollX(bool val); 147 void setEnableCloudScrollX(bool val);
148 148
149 /// get the scroll x enable value; 149 /// get the scroll x enable value;
150 bool getEnableCloudScrollX(); 150 bool getEnableCloudScrollX();
151 151
152 /// set the star's brightness 152 /// set the star's brightness
153 /// \param val scroll y bool value 153 /// \param val scroll y bool value
154 void setEnableCloudScrollY(bool val); 154 void setEnableCloudScrollY(bool val);
155 155
156 /// get the scroll enable y value; 156 /// get the scroll enable y value;
157 bool getEnableCloudScrollY(); 157 bool getEnableCloudScrollY();
158 158
159 /// set the cloud scroll x enable value 159 /// set the cloud scroll x enable value
160 /// \param val scroll x value 160 /// \param val scroll x value
161 void setCloudScrollX(F32 val); 161 void setCloudScrollX(F32 val);
162 162
163 /// get the scroll x enable value; 163 /// get the scroll x enable value;
164 F32 getCloudScrollX(); 164 F32 getCloudScrollX();
165 165
166 /// set the star's brightness 166 /// set the star's brightness
167 /// \param val scroll y bool value 167 /// \param val scroll y bool value
168 void setCloudScrollY(F32 val); 168 void setCloudScrollY(F32 val);
169 169
170 /// get the scroll enable y value; 170 /// get the scroll enable y value;
171 F32 getCloudScrollY(); 171 F32 getCloudScrollY();
172 172
173 /// interpolate two parameter sets 173 /// interpolate two parameter sets
174 /// \param src The parameter set to start with 174 /// \param src The parameter set to start with
175 /// \param dest The parameter set to end with 175 /// \param dest The parameter set to end with
176 /// \param weight The amount to interpolate 176 /// \param weight The amount to interpolate
177 void mix(LLWLParamSet& src, LLWLParamSet& dest, 177 void mix(LLWLParamSet& src, LLWLParamSet& dest,
178 F32 weight); 178 F32 weight);
179 179
180 void updateCloudScrolling(void); 180 void updateCloudScrolling(void);
diff --git a/linden/indra/newview/windlightsettingsupdate.cpp b/linden/indra/newview/windlightsettingsupdate.cpp
deleted file mode 100644
index ad6e7c9..0000000
--- a/linden/indra/newview/windlightsettingsupdate.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
1/*
2 * @file kowopenregionsettings.cpp
3 * @brief Handler for OpenRegionInfo event queue message.
4 *
5 * Copyright (c) 2010, Patrick Sapinski
6 *
7 * The source code in this file ("Source Code") is provided to you
8 * under the terms of the GNU General Public License, version 2.0
9 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
10 * this distribution, or online at
11 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at
17 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29#include "llhttpnode.h"
30#include "hippolimits.h"
31#include "llfloatertools.h"
32#include "llviewercontrol.h"
33#include "llagent.h"
34#include "llsurface.h"
35#include "llviewerregion.h"
36#include "llviewerobject.h"
37
38#include "linden_common.h"
39#include "llwaterparammanager.h"
40#include "llwaterparamset.h"
41#include "llwlparammanager.h"
42#include "llwlparamset.h"
43#include "message.h"
44#include "meta7windlight.h"
45#include "lightshare.h"
46#include "wlsettingsmanager.h"
47
48//DEBUG includes
49//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
50
51class WindLightSettingsUpdate : public LLHTTPNode
52{
53 /*virtual*/ void post(
54 LLHTTPNode::ResponsePtr response,
55 const LLSD& context,
56 const LLSD& input) const
57 {
58 if (!input.isMap() || !input.has("body"))
59 {
60 llinfos << "malformed WindLightSettingsUpdate update!" << llendl;
61 return;
62 }
63 LLWaterParamSet* mWater;
64 LLWLParamSet* mSky;
65 LLUUID* mWaterNormal;
66
67 mWater = new LLWaterParamSet();
68 mSky = new LLWLParamSet();
69 mWaterNormal = new LLUUID();
70
71 LLSD body = input["body"];
72
73 mWater->set("waterFogColor",
74 body["waterColorX"].asReal() / 256.f,
75 body["waterColorY"].asReal() / 256.f,
76 body["waterColorZ"].asReal() / 256.f,
77 body["waterColorW"].asReal() / 256.f);
78 mWater->set("waterFogDensity", body["waterFogDensityExponent"].asReal());
79 mWater->set("underWaterFogMod", body["underwaterFogModifier"].asReal());
80 mWater->set("normScale", body["reflectionWaveletScaleX"].asReal(),
81 body["reflectionWaveletScaleY"].asReal(),
82 body["reflectionWaveletScaleZ"].asReal());
83 mWater->set("fresnelScale", body["fresnelScale"].asReal());
84 mWater->set("fresnelOffset", body["fresnelOffset"].asReal());
85 mWater->set("scaleAbove", body["refractScaleAbove"].asReal());
86 mWater->set("scaleBelow", body["refractScaleBelow"].asReal());
87 mWater->set("blurMultiplier", body["blurMultiplier"].asReal());
88 mWater->set("wave2Dir", body["bigWaveDirectionX"].asReal(),
89 body["bigWaveDirectionY"].asReal());
90 mWater->set("wave1Dir", body["littleWaveDirectionX"].asReal(),
91 body["littleWaveDirectionY"].asReal());
92 mWaterNormal->parseUUID(body["normalMapTexture"].asUUID().asString(), mWaterNormal);
93
94 mSky->setSunAngle(body["sunMoonPosition"].asReal());
95 mSky->setEastAngle(body["eastAngle"].asReal());
96
97 mSky->set("sunlight_color",
98 body["sunMoonColorX"].asReal() * 3.0f,
99 body["sunMoonColorY"].asReal() * 3.0f,
100 body["sunMoonColorZ"].asReal() * 3.0f,
101 body["sunMoonColorW"].asReal() * 3.0f);
102
103 mSky->set("ambient",
104 body["ambientX"].asReal() * 3.0f,
105 body["ambientY"].asReal() * 3.0f,
106 body["ambientZ"].asReal() * 3.0f,
107 body["ambientW"].asReal() * 3.0f);
108
109 mSky->set("blue_horizon",
110 body["horizonX"].asReal() * 2.0f,
111 body["horizonY"].asReal() * 2.0f,
112 body["horizonZ"].asReal() * 2.0f,
113 body["horizonW"].asReal() * 2.0f);
114
115 mSky->set("blue_density",
116 body["blueDensityX"].asReal(),
117 body["blueDensityY"].asReal(),
118 body["blueDensityZ"].asReal(),
119 1.0);
120
121 mSky->set("haze_horizon",
122 body["hazeHorizon"].asReal(),
123 body["hazeHorizon"].asReal(),
124 body["hazeHorizon"].asReal(),
125 1.f);
126
127 mSky->set("haze_density",
128 body["hazeDensity"].asReal(),
129 0.f, 0.f, 1.f);
130
131 mSky->set("cloud_shadow",
132 body["cloudCoverage"].asReal(),
133 0.f, 0.f, 1.f);
134
135 mSky->set("density_multiplier",
136 body["densityMultiplier"].asReal() / 1000.0f,
137 0.f, 0.f, 1.f);
138
139 mSky->set("distance_multiplier",
140 body["distanceMultiplier"].asReal(),
141 0.f, 0.f, 1.f);
142
143 mSky->set("max_y",
144 body["maxAltitude"].asReal(),
145 0.f, 0.f, 1.f);
146
147 mSky->set("cloud_color",
148 body["cloudColorX"].asReal(),
149 body["cloudColorY"].asReal(),
150 body["cloudColorZ"].asReal(),
151 body["cloudColorW"].asReal());
152
153 mSky->set("cloud_pos_density1",
154 body["cloudXYDensityX"].asReal(),
155 body["cloudXYDensityY"].asReal(),
156 body["cloudXYDensityZ"].asReal(),
157 1.f);
158
159 mSky->set("cloud_pos_density2",
160 body["cloudDetailXYDensityX"].asReal(),
161 body["cloudDetailXYDensityY"].asReal(),
162 body["cloudDetailXYDensityZ"].asReal(),
163 1.f);
164
165 mSky->set("cloud_scale",
166 body["cloudScale"].asReal(),
167 0.f, 0.f, 1.f);
168
169 mSky->set("gamma",
170 body["sceneGamma"].asReal(),
171 0.f, 0.f, 1.f);
172
173 mSky->set("glow",
174 (2 - body["sunGlowSize"].asReal()) * 20,
175 0.f,
176 -body["sunGlowFocus"].asReal() * 5,
177 1.f);
178
179 mSky->setCloudScrollX(body["cloudScrollX"].asReal() + 10.0f);
180 mSky->setCloudScrollY(body["cloudScrollY"].asReal() + 10.0f);
181
182 mSky->setEnableCloudScrollX(!body["cloudScrollXLock"].asBoolean());
183 mSky->setEnableCloudScrollY(!body["cloudScrollYLock"].asBoolean());
184
185 mSky->setStarBrightness(body["starBrightness"].asReal());
186
187 mSky->set("fade", body["fade"].asReal());
188
189 //Update this here.. since it isn't a part of WL... go figure
190 gHippoLimits->skyUseClassicClouds = body["drawClassicClouds"].asBoolean();
191 gSavedSettings.setF32("ClassicCloudHeight",body["classicCloudHeight"].asReal());
192 gSavedSettings.setF32("ClassicCloudRange",body["classicCloudRange"].asReal());
193
194 WLSettingsManager::Apply(mSky, mWater, mWaterNormal);
195}
196};
197
198LLHTTPRegistration<WindLightSettingsUpdate>
199gHTTPRegistrationWindLightSettingsUpdate(
200 "/message/WindLightSettingsUpdate"); \ No newline at end of file
diff --git a/linden/indra/newview/wlfloatermanager.cpp b/linden/indra/newview/wlfloatermanager.cpp
index 63abe14..382244d 100644
--- a/linden/indra/newview/wlfloatermanager.cpp
+++ b/linden/indra/newview/wlfloatermanager.cpp
@@ -1,11 +1,11 @@
1/** 1/**
2* @file wlfloaterwindlightsend.cpp 2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition 3* @brief WLFloaterWindLightSend class definition
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.
@@ -70,17 +70,17 @@
70#include "llviewerparcelmgr.h" 70#include "llviewerparcelmgr.h"
71#include "llparcel.h" 71#include "llparcel.h"
72#include "wlretrievesettings.h" 72#include "wlretrievesettings.h"
73#include "wlsettingsmanager.h" 73#include "llettherebelight.h"
74#include "wlfloaterwindlightsend.h" 74#include "wlfloaterwindlightsend.h"
75 75
76#undef max 76#undef max
77WLFloaterManager* WLFloaterManager::sWindLight; 77WLFloaterManager* WLFloaterManager::sWindLight;
78std::map<std::string, LLWLParamSet*> WLFloaterManager::mWLParamList; 78std::map<std::string, LLWLParamSet*> WLFloaterManager::mWLParamList;
79std::map<std::string, LLWaterParamSet*> WLFloaterManager::mWaterParamList; 79std::map<std::string, LLWaterParamSet*> WLFloaterManager::mWaterParamList;
80std::map<std::string, LLUUID*> WLFloaterManager::mWaterNormalParamList; 80std::map<std::string, LLUUID*> WLFloaterManager::mWaterNormalParamList;
81std::map<std::string, LLSD> WLFloaterManager::mMinAltParamList; 81std::map<std::string, LLSD> WLFloaterManager::mMinAltParamList;
82std::map<std::string, LLSD> WLFloaterManager::mMaxAltParamList; 82std::map<std::string, LLSD> WLFloaterManager::mMaxAltParamList;
83std::map<std::string, LLSD> WLFloaterManager::mFadeParamList; 83std::map<std::string, LLSD> WLFloaterManager::mFadeParamList;
84 84
85WLFloaterManager::WLFloaterManager() : LLFloater(std::string("windlight manager floater")) 85WLFloaterManager::WLFloaterManager() : LLFloater(std::string("windlight manager floater"))
86{ 86{
@@ -214,7 +214,7 @@ void WLFloaterManager::onShow(void* userData)
214 LLWaterParamSet* mWater = mgr->mWaterParamList[name]; 214 LLWaterParamSet* mWater = mgr->mWaterParamList[name];
215 LLUUID* mWaterNormal = mgr->mWaterNormalParamList[name]; 215 LLUUID* mWaterNormal = mgr->mWaterNormalParamList[name];
216 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL) 216 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
217 WLSettingsManager::Apply(mSky, mWater, mWaterNormal); 217 LightShare::applyMaybe(mWater, mWaterNormal, mSky);
218} 218}
219void WLFloaterManager::onSetToCurrent(void* userData) 219void WLFloaterManager::onSetToCurrent(void* userData)
220{ 220{
@@ -233,10 +233,10 @@ void WLFloaterManager::onSetToCurrent(void* userData)
233 if(name == "(Region Settings)") 233 if(name == "(Region Settings)")
234 { 234 {
235 type = 0; 235 type = 0;
236 } 236 }
237 237
238 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL) 238 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
239 WLFloaterWindLightSend::SendSettings(false, type, NULL, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal); 239 WLFloaterWindLightSend::SendSettings(false, type, NULL, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal);
240} 240}
241void WLFloaterManager::onRemove(void* userData) 241void WLFloaterManager::onRemove(void* userData)
242{ 242{
@@ -258,7 +258,7 @@ void WLFloaterManager::onRemove(void* userData)
258 } 258 }
259 259
260 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL) 260 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
261 WLFloaterWindLightSend::SendSettings(true, type, false, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal); 261 WLFloaterWindLightSend::SendSettings(true, type, false, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal);
262} 262}
263 263
264 264
@@ -269,13 +269,12 @@ void WLFloaterManager::UpdateFloater()
269 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo"); 269 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo");
270 comboBox->clear(); 270 comboBox->clear();
271 comboBox->removeall(); 271 comboBox->removeall();
272 std::map<std::string, LLWLParamSet*>::iterator mIt = 272 std::map<std::string, LLWLParamSet*>::iterator mIt =
273 WLFloaterManager::instance()->mWLParamList.begin(); 273 WLFloaterManager::instance()->mWLParamList.begin();
274 for(; mIt != WLFloaterManager::instance()->mWLParamList.end(); mIt++) 274 for(; mIt != WLFloaterManager::instance()->mWLParamList.end(); mIt++)
275 { 275 {
276 comboBox->add(mIt->first); 276 comboBox->add(mIt->first);
277 } 277 }
278 //Reorder them 278 //Reorder them
279 comboBox->sortByName(); 279 comboBox->sortByName();
280} 280}
281
diff --git a/linden/indra/newview/wlretrievesettings.cpp b/linden/indra/newview/wlretrievesettings.cpp
index afa84f2..a8ed2b5 100644
--- a/linden/indra/newview/wlretrievesettings.cpp
+++ b/linden/indra/newview/wlretrievesettings.cpp
@@ -1,11 +1,11 @@
1/** 1/**
2* @file wlfloaterwindlightsend.cpp 2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition 3* @brief WLFloaterWindLightSend class definition
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.
@@ -67,8 +67,7 @@
67#include "hippolimits.h" 67#include "hippolimits.h"
68#include "wlfloaterwindlightsend.h" 68#include "wlfloaterwindlightsend.h"
69#include "llviewerregion.h" 69#include "llviewerregion.h"
70#include "wlsettingsmanager.h" 70#include "llettherebelight.h"
71#include "lightshare.h"
72 71
73#include "linden_common.h" 72#include "linden_common.h"
74#include "llviewercontrol.h" 73#include "llviewercontrol.h"
@@ -93,7 +92,7 @@ void retrieveWindlightSettings::result(const LLSD& content)
93 for(LLSD::array_const_iterator wls = content["WindLight"].beginArray(); 92 for(LLSD::array_const_iterator wls = content["WindLight"].beginArray();
94 wls != content["WindLight"].endArray(); 93 wls != content["WindLight"].endArray();
95 ++wls) 94 ++wls)
96 { 95 {
97 LLSD windLightLLSD = *wls; 96 LLSD windLightLLSD = *wls;
98 LLWaterParamSet* mWater; 97 LLWaterParamSet* mWater;
99 LLWLParamSet* mSky; 98 LLWLParamSet* mSky;
@@ -235,4 +234,4 @@ void retrieveWindlightSettings::error(U32 status, const std::string& reason)
235{ 234{
236 LL_INFOS("Inventory") << "retrieveWindlightSettings::error " 235 LL_INFOS("Inventory") << "retrieveWindlightSettings::error "
237 << status << ": " << reason << LL_ENDL; 236 << status << ": " << reason << LL_ENDL;
238} \ No newline at end of file 237}
diff --git a/linden/indra/newview/wlsettingsmanager.cpp b/linden/indra/newview/wlsettingsmanager.cpp
deleted file mode 100644
index c0a07e1..0000000
--- a/linden/indra/newview/wlsettingsmanager.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
1/**
2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition
4*
5* $LicenseInfo:firstyear=2007&license=viewergpl$
6*
7* Copyright (c) 2007-2009, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
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
12* ("GPL"), unless you have obtained a separate licensing agreement
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
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16*
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
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at
21* http://secondlifegrid.net/programs/open_source/licensing/flossexception
22*
23* By copying, modifying or distributing this software, you acknowledge
24* that you have read and understood your obligations described above,
25* and agree to abide by those obligations.
26*
27* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29* COMPLETENESS OR PERFORMANCE.
30* $/LicenseInfo$
31*/
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterwindlight.h"
36
37#include "pipeline.h"
38#include "llsky.h"
39
40#include "llsliderctrl.h"
41#include "llmultislider.h"
42#include "llmultisliderctrl.h"
43#include "llspinctrl.h"
44#include "llcheckboxctrl.h"
45#include "lluictrlfactory.h"
46#include "llviewercamera.h"
47#include "llcombobox.h"
48#include "lllineeditor.h"
49#include "llfloaterdaycycle.h"
50#include "lltabcontainer.h"
51#include "llboost.h"
52
53#include "llagent.h"
54#include "llinventorymodel.h"
55#include "llviewerinventory.h"
56
57#include "v4math.h"
58#include "llviewerdisplay.h"
59#include "llviewercontrol.h"
60#include "llviewerwindow.h"
61#include "llsavedsettingsglue.h"
62
63#include "llwlparamset.h"
64#include "llwlparammanager.h"
65#include "llwaterparammanager.h"
66#include "llpostprocess.h"
67#include "hippolimits.h"
68#include "wlfloaterwindlightsend.h"
69#include "llviewerregion.h"
70#include "wlsettingsmanager.h"
71#include "lightshare.h"
72
73#include "linden_common.h"
74#include "llviewercontrol.h"
75#include "message.h"
76#include "meta7windlight.h"
77#include "llworld.h"
78
79#undef max
80
81const std::string WLSettingsManager::wlWaterPresetName = "(Region settings)";
82const std::string WLSettingsManager::wlSkyPresetName = "(Region settings)";
83
84LLTimer* WLSettingsManager::wlIgnoreTimer = new LLTimer();
85bool WLSettingsManager::wlIgnoreRegion = false;
86LLWaterParamSet* WLSettingsManager::mWater = NULL;
87LLWLParamSet* WLSettingsManager::mSky = NULL;
88LLUUID* WLSettingsManager::mWaterNormal = NULL;
89
90void WLSettingsManager::Apply( LLWLParamSet* Sky, LLWaterParamSet* Water, LLUUID* WaterNormal )
91{
92 if( gSavedSettings.getU32("LightShareAllowed") <= WindlightMessage::LIGHTSHARE_NEVER )
93 return;
94
95 std::string water = LLWaterParamManager::instance()->mCurParams.mName;
96 std::string sky = LLWLParamManager::instance()->mCurParams.mName;
97
98 // If they are using region settings already, or LightShare is
99 // always allowed, just apply the new settings, don't bother asking.
100 if( gSavedSettings.getU32("LightShareAllowed") == WindlightMessage::LIGHTSHARE_ALWAYS ||
101 (sky == wlSkyPresetName && water == wlWaterPresetName) )
102 {
103 mSky = Sky;
104 mWater = Water;
105 mWaterNormal = WaterNormal;
106 Apply();
107 return;
108 }
109
110 if( !wlignoreTimerHasExpired() )
111 {
112 // The user recently ignored a windlight message, so ignore
113 // this one too, and restart the timer.
114 wlrestartIgnoreTimer();
115 return;
116 }
117
118 if(wlIgnoreRegion)
119 {
120 // We are ignoring new settings until user enters a new region.
121 return;
122 }
123
124 if( gSavedSettings.getU32("LightShareAllowed") == WindlightMessage::LIGHTSHARE_ASK &&
125 mSky == NULL && mWater == NULL)
126 {
127 // No most recent, so store this and create notification
128 // asking the user whether to apply or not.
129 mSky = Sky;
130 mWater = Water;
131 mWaterNormal = WaterNormal;
132 LLNotifications::instance().add("ConfirmLightShare", LLSD(), LLSD(),
133 boost::bind(&wlapplyCallback, _1, _2));
134 }
135 else
136 {
137 // No new notification (to avoid spamming the user, we do keep the saves from above)
138 mSky = Sky;
139 mWater = Water;
140 mWaterNormal = WaterNormal;
141 }
142}
143
144// static
145bool WLSettingsManager::wlapplyCallback(const LLSD& notification,
146 const LLSD& response)
147{
148 S32 option = LLNotification::getSelectedOption(notification, response);
149
150 switch(option)
151 {
152 case 0:{
153 // "Apply"
154 Apply();
155 break;
156 }
157 case 1:{
158 // "Not Now", ignore until the region stops spamming
159 wlrestartIgnoreTimer();
160 break;
161 }
162 case 2:{
163 // "Ignore", ignore all until user leaves the region
164 wlIgnoreRegion = true;
165 break;
166 }
167 }
168 return false;
169}
170
171//static
172void WLSettingsManager::Apply()
173{
174 LLWaterParamManager* water_mgr = LLWaterParamManager::instance();
175 LLWLParamManager* sky_mgr = LLWLParamManager::instance();
176
177 F32 fade = 0; //Instant
178 bool error;
179 fade = mSky->getFloat("fade", error);
180
181 mWater->mName = wlWaterPresetName;
182 if(fade != 0 && water_mgr->mCurParams.mName == wlWaterPresetName)//Load the settings forcefully the first time
183 {
184 LLWaterParamSet oldWset = water_mgr->mCurParams;
185 //This still needs done so that we update right, but load it to the old
186 water_mgr->removeParamSet( wlWaterPresetName, false );
187 water_mgr->addParamSet( wlWaterPresetName, oldWset );
188 water_mgr->savePreset( wlWaterPresetName );
189 water_mgr->loadPreset( wlWaterPresetName, true );
190 water_mgr->setNormalMapID( *mWaterNormal );
191 //Then mix with the new
192 water_mgr->SetMixTime(mWater, fade);
193 }
194 else
195 {
196 //Instant if fade is 0
197 water_mgr->removeParamSet( wlWaterPresetName, false );
198 water_mgr->addParamSet( wlWaterPresetName, *mWater );
199 water_mgr->savePreset( wlWaterPresetName );
200 water_mgr->loadPreset( wlWaterPresetName, true );
201 water_mgr->setNormalMapID( *mWaterNormal );
202 }
203
204 mSky->mName = wlSkyPresetName;
205 if(fade != 0 && sky_mgr->mCurParams.mName == wlSkyPresetName)//Load the settings forcefully the first time
206 {
207 LLWLParamSet oldset = sky_mgr->mCurParams;
208 //This still needs done so that we update right, but load it to the old
209 sky_mgr->removeParamSet( wlSkyPresetName, true );
210 sky_mgr->addParamSet( wlSkyPresetName, oldset );
211 sky_mgr->savePreset( wlSkyPresetName );
212 sky_mgr->loadPreset( wlSkyPresetName, true );
213 //Then mix with the new
214 sky_mgr->SetMixTime(mSky, fade);
215 }
216 else
217 {
218 //Instant if fade is 0
219 sky_mgr->mAnimator.mIsRunning = false;
220 sky_mgr->mAnimator.mUseLindenTime = false;
221 sky_mgr->removeParamSet( wlSkyPresetName, false );
222 sky_mgr->addParamSet( wlSkyPresetName, *mSky );
223 sky_mgr->savePreset( wlSkyPresetName );
224 sky_mgr->loadPreset( wlSkyPresetName, true );
225 }
226
227 LLWorld::getInstance()->rebuildClouds(gAgent.getRegion());
228
229 mSky = NULL;
230 mWater = NULL;
231 mWaterNormal = NULL;
232}
233
234// static
235void WLSettingsManager::wlresetRegion()
236{
237 wlIgnoreRegion = false;
238 LLWorld::getInstance()->rebuildClouds(gAgent.getRegion());
239}
240
241// static
242void WLSettingsManager::wlrestartIgnoreTimer()
243{
244 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer");
245 wlIgnoreTimer->start();
246 wlIgnoreTimer->setTimerExpirySec( (time < 0) ? 0 : time );
247}
248
249// static
250bool WLSettingsManager::wlignoreTimerHasExpired()
251{
252 return wlIgnoreTimer->hasExpired();
253} \ No newline at end of file
diff --git a/linden/indra/newview/wlsettingsmanager.h b/linden/indra/newview/wlsettingsmanager.h
deleted file mode 100644
index 5a0e9e7..0000000
--- a/linden/indra/newview/wlsettingsmanager.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/**
2 * @file wlfloaterwindlightsend.h
3 * @brief WLFloaterWindLightSend class definition
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
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
12 * ("GPL"), unless you have obtained a separate licensing agreement
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
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
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
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33/*
34 * Menu for adjusting the atmospheric settings of the world
35 */
36
37#ifndef WINDLIGHTSETTINGSMANAGER_H
38#define WINDLIGHTSETTINGSMANAGER_H
39
40#include <string>
41#include "llwlparamset.h"
42#include "llwaterparamset.h"
43#include "lluuid.h"
44
45class LLSD;
46class LLTimer;
47class LLUUID;
48class LLWaterParamSet;
49class LLWLParamSet;
50
51
52/// Menuing system for all of windlight's functionality
53class WLSettingsManager
54{
55public:
56
57 static LLTimer* wlIgnoreTimer;
58 static bool wlIgnoreRegion;
59
60 // Called after the user has entered a new region, to reset the
61 // "ignore while in this region" state.
62 static void wlresetRegion();
63
64 static void Apply( LLWLParamSet* Sky, LLWaterParamSet* Water, LLUUID* WaterNormal );
65
66 // Callback when the user interacts with the notification.
67 static bool wlapplyCallback(const LLSD& notification,
68 const LLSD& response);
69
70 static LLWaterParamSet* mWater;
71 static LLWLParamSet* mSky;
72 static LLUUID* mWaterNormal;
73
74private:
75 static void Apply();
76
77 // The name of the water preset where the region settings are stored.
78 static const std::string wlWaterPresetName;
79
80 // The name of the sky preset where the region settings are stored.
81 static const std::string wlSkyPresetName;
82
83 // Restart the timer for temporarily ignoring settings.
84 static void wlrestartIgnoreTimer();
85
86 // Returns true if the ignore timer has expired (i.e. new settings
87 // should not be ignored anymore).
88 static bool wlignoreTimerHasExpired();
89};
90#endif \ No newline at end of file