aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorRobin Cornelius2011-10-01 22:16:53 +0100
committerDavid Walter Seikel2013-04-05 23:10:32 +1000
commit0528bbd5ef37b7d60c639db2c450cca415b6590e (patch)
treef88830cb3867a2009872f6cf3ff718e5d6271305 /linden
parentFor Armin and his teapot. (diff)
downloadmeta-impy-0528bbd5ef37b7d60c639db2c450cca415b6590e.zip
meta-impy-0528bbd5ef37b7d60c639db2c450cca415b6590e.tar.gz
meta-impy-0528bbd5ef37b7d60c639db2c450cca415b6590e.tar.bz2
meta-impy-0528bbd5ef37b7d60c639db2c450cca415b6590e.tar.xz
MOAP Radar patch set
Diffstat (limited to 'linden')
-rw-r--r--linden/etc/message.xml6
-rw-r--r--linden/indra/llmath/llsdutil_math.cpp14
-rw-r--r--linden/indra/newview/CMakeLists.txt4
-rw-r--r--linden/indra/newview/app_settings/settings.xml128
-rw-r--r--linden/indra/newview/llfloaterbeacons.cpp3
-rw-r--r--linden/indra/newview/llstartup.cpp12
-rw-r--r--linden/indra/newview/llviewermenu.cpp32
-rw-r--r--linden/indra/newview/llviewerobject.h8
-rw-r--r--linden/indra/newview/llviewerregion.cpp2
-rw-r--r--linden/indra/newview/llvovolume.cpp398
-rw-r--r--linden/indra/newview/llvovolume.h53
-rw-r--r--linden/indra/newview/pipeline.cpp61
-rw-r--r--linden/indra/newview/pipeline.h5
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml5
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
15 files changed, 720 insertions, 15 deletions
diff --git a/linden/etc/message.xml b/linden/etc/message.xml
index 8d34dd8..f86ca8b 100644
--- a/linden/etc/message.xml
+++ b/linden/etc/message.xml
@@ -702,6 +702,12 @@
702 702
703 <key>FetchLib</key> 703 <key>FetchLib</key>
704 <boolean>true</boolean> 704 <boolean>true</boolean>
705
706 <key>ObjectMedia</key>
707 <boolean>false</boolean>
708
709 <key>ObjectMediaNavigate</key>
710 <boolean>false</boolean>
705 </map> 711 </map>
706 712
707 <key>messageBans</key> 713 <key>messageBans</key>
diff --git a/linden/indra/llmath/llsdutil_math.cpp b/linden/indra/llmath/llsdutil_math.cpp
index 073cb2e..8ec8661 100644
--- a/linden/indra/llmath/llsdutil_math.cpp
+++ b/linden/indra/llmath/llsdutil_math.cpp
@@ -6,7 +6,7 @@
6 * 6 *
7 * $LicenseInfo:firstyear=2006&license=viewergpl$ 7 * $LicenseInfo:firstyear=2006&license=viewergpl$
8 * 8 *
9 * Copyright (c) 2006-2009, Linden Research, Inc. 9 * Copyright (c) 2006-2010, Linden Research, Inc.
10 * 10 *
11 * Second Life Viewer Source Code 11 * Second Life Viewer Source Code
12 * The source code in this file ("Source Code") is provided by Linden Lab 12 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -14,13 +14,13 @@
14 * ("GPL"), unless you have obtained a separate licensing agreement 14 * ("GPL"), unless you have obtained a separate licensing agreement
15 * ("Other License"), formally executed by you and Linden Lab. Terms of 15 * ("Other License"), formally executed by you and Linden Lab. Terms of
16 * the GPL can be found in doc/GPL-license.txt in this distribution, or 16 * the GPL can be found in doc/GPL-license.txt in this distribution, or
17 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 17 * online at http://secondlife.com/developers/opensource/gplv2
18 * 18 *
19 * There are special exceptions to the terms and conditions of the GPL as 19 * There are special exceptions to the terms and conditions of the GPL as
20 * it is applied to this Source Code. View the full text of the exception 20 * it is applied to this Source Code. View the full text of the exception
21 * in the file doc/FLOSS-exception.txt in this software distribution, or 21 * in the file doc/FLOSS-exception.txt in this software distribution, or
22 * online at 22 * online at
23 * http://secondlifegrid.net/programs/open_source/licensing/flossexception 23 * http://secondlife.com/developers/opensource/flossexception
24 * 24 *
25 * By copying, modifying or distributing this software, you acknowledge 25 * By copying, modifying or distributing this software, you acknowledge
26 * that you have read and understood your obligations described above, 26 * that you have read and understood your obligations described above,
@@ -30,11 +30,12 @@
30 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 30 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
31 * COMPLETENESS OR PERFORMANCE. 31 * COMPLETENESS OR PERFORMANCE.
32 * $/LicenseInfo$ 32 * $/LicenseInfo$
33 *
33 */ 34 */
34 35
35#include "linden_common.h" 36#include "linden_common.h"
36 37
37#include "llsdutil.h" 38#include "llsdutil_math.h"
38 39
39#include "v3math.h" 40#include "v3math.h"
40#include "v4math.h" 41#include "v4math.h"
@@ -165,9 +166,6 @@ LLSD ll_sd_from_color4(const LLColor4& c)
165LLColor4 ll_color4_from_sd(const LLSD& sd) 166LLColor4 ll_color4_from_sd(const LLSD& sd)
166{ 167{
167 LLColor4 c; 168 LLColor4 c;
168 c.mV[0] = (F32)sd[0].asReal(); 169 c.setValue(sd);
169 c.mV[1] = (F32)sd[1].asReal();
170 c.mV[2] = (F32)sd[2].asReal();
171 c.mV[3] = (F32)sd[3].asReal();
172 return c; 170 return c;
173} 171}
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 2a976ff..b9c41fc 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -274,6 +274,7 @@ set(viewer_SOURCE_FILES
274 llmaniprotate.cpp 274 llmaniprotate.cpp
275 llmanipscale.cpp 275 llmanipscale.cpp
276 llmaniptranslate.cpp 276 llmaniptranslate.cpp
277 llmediadataclient.cpp
277 llmapresponders.cpp 278 llmapresponders.cpp
278 llmediaremotectrl.cpp 279 llmediaremotectrl.cpp
279 llmemoryview.cpp 280 llmemoryview.cpp
@@ -508,6 +509,7 @@ set(viewer_SOURCE_FILES
508 wlfloaterwindlightsend.cpp 509 wlfloaterwindlightsend.cpp
509 wlretrievesettings.cpp 510 wlretrievesettings.cpp
510 wlsettingsmanager.cpp 511 wlsettingsmanager.cpp
512 rcmoapradar.cpp
511 ) 513 )
512 514
513set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING 515set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING
@@ -737,6 +739,7 @@ set(viewer_HEADER_FILES
737 llmaniprotate.h 739 llmaniprotate.h
738 llmanipscale.h 740 llmanipscale.h
739 llmaniptranslate.h 741 llmaniptranslate.h
742 llmediadataclient.h
740 llmapresponders.h 743 llmapresponders.h
741 llmediaremotectrl.h 744 llmediaremotectrl.h
742 llmemoryview.h 745 llmemoryview.h
@@ -981,6 +984,7 @@ set(viewer_HEADER_FILES
981 wlfloaterwindlightsend.h 984 wlfloaterwindlightsend.h
982 wlretrievesettings.h 985 wlretrievesettings.h
983 wlsettingsmanager.h 986 wlsettingsmanager.h
987 rcmoapradar.h
984 ) 988 )
985 989
986source_group("CMake Rules" FILES ViewerInstall.cmake) 990source_group("CMake Rules" FILES ViewerInstall.cmake)
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 2ec4832..1451aef 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -2,6 +2,123 @@
2<llsd> 2<llsd>
3<map> 3<map>
4 4
5 <!-- begin RC hacking -->
6 <key>PrimMediaMasterEnabled</key>
7 <map>
8 <key>Comment</key>
9 <string>Whether or not Media on a Prim is enabled.</string>
10 <key>Persist</key>
11 <integer>1</integer>
12 <key>Type</key>
13 <string>Boolean</string>
14 <key>Value</key>
15 <integer>1</integer>
16 </map>
17 <key>PrimMediaMaxRetries</key>
18 <map>
19 <key>Comment</key>
20 <string>Maximum number of retries for media queries.</string>
21 <key>Persist</key>
22 <integer>1</integer>
23 <key>Type</key>
24 <string>U32</string>
25 <key>Value</key>
26 <integer>4</integer>
27 </map>
28 <key>PrimMediaRequestQueueDelay</key>
29 <map>
30 <key>Comment</key>
31 <string>Timer delay for fetching media from the queue (in seconds).</string>
32 <key>Persist</key>
33 <integer>1</integer>
34 <key>Type</key>
35 <string>F32</string>
36 <key>Value</key>
37 <real>1.0</real>
38 </map>
39 <key>PrimMediaRetryTimerDelay</key>
40 <map>
41 <key>Comment</key>
42 <string>Timer delay for retrying on media queries (in seconds).</string>
43 <key>Persist</key>
44 <integer>1</integer>
45 <key>Type</key>
46 <string>F32</string>
47 <key>Value</key>
48 <real>5.0</real>
49 </map>
50 <key>PrimMediaMaxSortedQueueSize</key>
51 <map>
52 <key>Comment</key>
53 <string>Maximum number of objects the viewer will load media for initially</string>
54 <key>Persist</key>
55 <integer>1</integer>
56 <key>Type</key>
57 <string>U32</string>
58 <key>Value</key>
59 <integer>100000</integer>
60 </map>
61 <key>PrimMediaMaxRoundRobinQueueSize</key>
62 <map>
63 <key>Comment</key>
64 <string>Maximum number of objects the viewer will continuously update media for</string>
65 <key>Persist</key>
66 <integer>1</integer>
67 <key>Type</key>
68 <string>U32</string>
69 <key>Value</key>
70 <integer>100000</integer>
71 </map>
72 <key>ShowMOAPRadar</key>
73 <map>
74 <key>Comment</key>
75 <string>Show the MOAP radar</string>
76 <key>Persist</key>
77 <integer>1</integer>
78 <key>Type</key>
79 <string>Boolean</string>
80 <key>Value</key>
81 <integer>0</integer>
82 </map>
83 <key>FloaterMOAPRadarRect</key>
84 <map>
85 <key>Comment</key>
86 <string>Rectangle for MOAP Radar</string>
87 <key>Persist</key>
88 <integer>1</integer>
89 <key>Type</key>
90 <string>Rect</string>
91 <key>Value</key>
92 <array>
93 <integer>0</integer>
94 <integer>400</integer>
95 <integer>200</integer>
96 <integer>0</integer>
97 </array>
98 </map>
99 <key>MOAPRadarKeepOpen</key>
100 <map>
101 <key>Comment</key>
102 <string>Keeps MOAP radar updates running in background</string>
103 <key>Persist</key>
104 <integer>1</integer>
105 <key>Type</key>
106 <string>Boolean</string>
107 <key>Value</key>
108 <integer>0</integer>
109 </map>
110 <key>MOAPRadarUpdateRate</key>
111 <map>
112 <key>Comment</key>
113 <string>MOAP Radar update rate (0 = high, 1 = medium, 2 = low)</string>
114 <key>Persist</key>
115 <integer>1</integer>
116 <key>Type</key>
117 <string>U32</string>
118 <key>Value</key>
119 <integer>1</integer>
120 </map>
121
5 <!-- BEGIN IMPRUDENCE-SPECIFIC SETTINGS --> 122 <!-- BEGIN IMPRUDENCE-SPECIFIC SETTINGS -->
6 123
7 <!-- begin Aurora-specific settings --> 124 <!-- begin Aurora-specific settings -->
@@ -14645,6 +14762,17 @@
14645 <real>1.0</real> 14762 <real>1.0</real>
14646 </array> 14763 </array>
14647 </map> 14764 </map>
14765 <key>moapbeacon</key>
14766 <map>
14767 <key>Comment</key>
14768 <string>Beacon / Highlight MOAP sources</string>
14769 <key>Persist</key>
14770 <integer>1</integer>
14771 <key>Type</key>
14772 <string>Boolean</string>
14773 <key>Value</key>
14774 <integer>0</integer>
14775 </map>
14648 <key>particlesbeacon</key> 14776 <key>particlesbeacon</key>
14649 <map> 14777 <map>
14650 <key>Comment</key> 14778 <key>Comment</key>
diff --git a/linden/indra/newview/llfloaterbeacons.cpp b/linden/indra/newview/llfloaterbeacons.cpp
index aa89780..7c40931 100644
--- a/linden/indra/newview/llfloaterbeacons.cpp
+++ b/linden/indra/newview/llfloaterbeacons.cpp
@@ -54,6 +54,7 @@ LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed)
54 LLPipeline::setRenderScriptedTouchBeacons(gSavedSettings.getBOOL("scripttouchbeacon")); 54 LLPipeline::setRenderScriptedTouchBeacons(gSavedSettings.getBOOL("scripttouchbeacon"));
55 LLPipeline::setRenderScriptedBeacons( gSavedSettings.getBOOL("scriptsbeacon")); 55 LLPipeline::setRenderScriptedBeacons( gSavedSettings.getBOOL("scriptsbeacon"));
56 LLPipeline::setRenderPhysicalBeacons( gSavedSettings.getBOOL("physicalbeacon")); 56 LLPipeline::setRenderPhysicalBeacons( gSavedSettings.getBOOL("physicalbeacon"));
57 LLPipeline::setRenderMOAPBeacons( gSavedSettings.getBOOL("moapbeacon"));
57 LLPipeline::setRenderSoundBeacons( gSavedSettings.getBOOL("soundsbeacon")); 58 LLPipeline::setRenderSoundBeacons( gSavedSettings.getBOOL("soundsbeacon"));
58 LLPipeline::setRenderParticleBeacons( gSavedSettings.getBOOL("particlesbeacon")); 59 LLPipeline::setRenderParticleBeacons( gSavedSettings.getBOOL("particlesbeacon"));
59 LLPipeline::setRenderHighlights( gSavedSettings.getBOOL("renderhighlights")); 60 LLPipeline::setRenderHighlights( gSavedSettings.getBOOL("renderhighlights"));
@@ -67,6 +68,7 @@ BOOL LLFloaterBeacons::postBuild()
67 childSetCommitCallback("physical", onClickUICheck, this); 68 childSetCommitCallback("physical", onClickUICheck, this);
68 childSetCommitCallback("sounds", onClickUICheck, this); 69 childSetCommitCallback("sounds", onClickUICheck, this);
69 childSetCommitCallback("particles", onClickUICheck, this); 70 childSetCommitCallback("particles", onClickUICheck, this);
71 childSetCommitCallback("moap", onClickUICheck, this);
70 childSetCommitCallback("highlights", onClickUICheck, this); 72 childSetCommitCallback("highlights", onClickUICheck, this);
71 childSetCommitCallback("beacons", onClickUICheck, this); 73 childSetCommitCallback("beacons", onClickUICheck, this);
72 return TRUE; 74 return TRUE;
@@ -132,6 +134,7 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl, void* data)
132 else if(name == "physical") LLPipeline::setRenderPhysicalBeacons(check->get()); 134 else if(name == "physical") LLPipeline::setRenderPhysicalBeacons(check->get());
133 else if(name == "sounds") LLPipeline::setRenderSoundBeacons(check->get()); 135 else if(name == "sounds") LLPipeline::setRenderSoundBeacons(check->get());
134 else if(name == "particles") LLPipeline::setRenderParticleBeacons(check->get()); 136 else if(name == "particles") LLPipeline::setRenderParticleBeacons(check->get());
137 else if(name == "moap") LLPipeline::setRenderMOAPBeacons(check->get());
135 else if(name == "highlights") 138 else if(name == "highlights")
136 { 139 {
137 LLPipeline::toggleRenderHighlights(NULL); 140 LLPipeline::toggleRenderHighlights(NULL);
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 922de18..d853dc0 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -206,6 +206,8 @@
206#include "rlvhandler.h" 206#include "rlvhandler.h"
207// [/RLVa:KB] 207// [/RLVa:KB]
208 208
209#include "rcmoapradar.h"
210
209#if LL_WINDOWS 211#if LL_WINDOWS
210#include "llwindebug.h" 212#include "llwindebug.h"
211#include "lldxhardware.h" 213#include "lldxhardware.h"
@@ -2079,6 +2081,16 @@ bool idle_startup()
2079 LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0); 2081 LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0);
2080 gViewerWindow->adjustControlRectanglesForFirstUse(window); 2082 gViewerWindow->adjustControlRectanglesForFirstUse(window);
2081 2083
2084 if (gSavedSettings.getBOOL("ShowRadar"))
2085 {
2086 LLFloaterAvatarList::showInstance();
2087 }
2088
2089 if (gSavedSettings.getBOOL("ShowMOAPRadar"))
2090 {
2091 LLFloaterMOAPRadar::showInstance();
2092 }
2093
2082 if(gSavedSettings.getBOOL("ShowMiniMap")) 2094 if(gSavedSettings.getBOOL("ShowMiniMap"))
2083 { 2095 {
2084 LLFloaterMap::showInstance(); 2096 LLFloaterMap::showInstance();
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index a83c11b..538adc7 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -238,6 +238,8 @@
238#include "llfloaterteleporthistory.h" 238#include "llfloaterteleporthistory.h"
239#include "slfloatermediafilter.h" 239#include "slfloatermediafilter.h"
240 240
241#include "rcmoapradar.h"
242
241using namespace LLVOAvatarDefines; 243using namespace LLVOAvatarDefines;
242void init_client_menu(LLMenuGL* menu); 244void init_client_menu(LLMenuGL* menu);
243void init_server_menu(LLMenuGL* menu); 245void init_server_menu(LLMenuGL* menu);
@@ -5216,6 +5218,34 @@ class LLViewEnableLastChatter : public view_listener_t
5216 } 5218 }
5217}; 5219};
5218 5220
5221class LLViewToggleRadar: public view_listener_t
5222{
5223 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5224 {
5225 LLFloaterAvatarList::toggle(0);
5226 bool vis = false;
5227 if(LLFloaterAvatarList::getInstance())
5228 {
5229 vis = (bool)LLFloaterAvatarList::getInstance()->getVisible();
5230 }
5231 return true;
5232 }
5233};
5234
5235class LLViewToggleMOAPRadar: public view_listener_t
5236{
5237 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5238 {
5239 LLFloaterMOAPRadar::toggle(0);
5240 bool vis = false;
5241 if(LLFloaterMOAPRadar::getInstance())
5242 {
5243 vis = (bool)LLFloaterMOAPRadar::getInstance()->getVisible();
5244 }
5245 return true;
5246 }
5247};
5248
5219class LLEditEnableDeselect : public view_listener_t 5249class LLEditEnableDeselect : public view_listener_t
5220{ 5250{
5221 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5251 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -11215,6 +11245,8 @@ void initialize_menus()
11215 addMenu(new LLViewEnableMouselook(), "View.EnableMouselook"); 11245 addMenu(new LLViewEnableMouselook(), "View.EnableMouselook");
11216 addMenu(new LLViewEnableJoystickFlycam(), "View.EnableJoystickFlycam"); 11246 addMenu(new LLViewEnableJoystickFlycam(), "View.EnableJoystickFlycam");
11217 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter"); 11247 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter");
11248 addMenu(new LLViewToggleRadar(), "View.ToggleAvatarList");
11249 addMenu(new LLViewToggleMOAPRadar(), "View.ToggleMOAPList");
11218 11250
11219 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode"); 11251 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode");
11220 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam"); 11252 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 9b05470..98b7115 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -157,7 +157,13 @@ public:
157 enum { MEDIA_TYPE_NONE = 0, MEDIA_TYPE_WEB_PAGE = 1 }; 157 enum { MEDIA_TYPE_NONE = 0, MEDIA_TYPE_WEB_PAGE = 1 };
158 158
159 // Return codes for processUpdateMessage 159 // Return codes for processUpdateMessage
160 enum { MEDIA_URL_REMOVED = 0x1, MEDIA_URL_ADDED = 0x2, MEDIA_URL_UPDATED = 0x4, INVALID_UPDATE = 0x80000000 }; 160 enum {
161 MEDIA_URL_REMOVED = 0x1,
162 MEDIA_URL_ADDED = 0x2,
163 MEDIA_URL_UPDATED = 0x4,
164 MEDIA_FLAGS_CHANGED = 0x8,
165 INVALID_UPDATE = 0x80000000
166 };
161 167
162 virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, 168 virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
163 void **user_data, 169 void **user_data,
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 2fafe30..42eb112 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -1436,6 +1436,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1436 capabilityNames.append("EstateChangeInfo"); 1436 capabilityNames.append("EstateChangeInfo");
1437 capabilityNames.append("EventQueueGet"); 1437 capabilityNames.append("EventQueueGet");
1438 capabilityNames.append("FetchInventory"); 1438 capabilityNames.append("FetchInventory");
1439 capabilityNames.append("ObjectMedia");
1440 capabilityNames.append("ObjectMediaNavigate");
1439 capabilityNames.append("FetchLib"); 1441 capabilityNames.append("FetchLib");
1440 capabilityNames.append("FetchLibDescendents"); 1442 capabilityNames.append("FetchLibDescendents");
1441 capabilityNames.append("GetDisplayNames"); 1443 capabilityNames.append("GetDisplayNames");
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index d580d61..cb38c86 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -68,6 +68,9 @@
68#include "rlvhandler.h" 68#include "rlvhandler.h"
69// [/RLVa:KB] 69// [/RLVa:KB]
70 70
71#include "llmediaentry.h"
72#include "llmediadataclient.h"
73
71const S32 MIN_QUIET_FRAMES_COALESCE = 30; 74const S32 MIN_QUIET_FRAMES_COALESCE = 30;
72const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; 75const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
73const F32 FORCE_CULL_AREA = 8.f; 76const F32 FORCE_CULL_AREA = 8.f;
@@ -79,6 +82,93 @@ F32 LLVOVolume::sLODFactor = 1.f;
79F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop 82F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop
80F32 LLVOVolume::sDistanceFactor = 1.0f; 83F32 LLVOVolume::sDistanceFactor = 1.0f;
81S32 LLVOVolume::sNumLODChanges = 0; 84S32 LLVOVolume::sNumLODChanges = 0;
85LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL;
86LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL;
87
88// Implementation class of LLMediaDataClientObject. See llmediadataclient.h
89class LLMediaDataClientObjectImpl : public LLMediaDataClientObject
90{
91public:
92 LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {}
93 LLMediaDataClientObjectImpl() { mObject = NULL; }
94
95 virtual U8 getMediaDataCount() const
96 { return mObject->getNumTEs(); }
97
98 virtual LLSD getMediaDataLLSD(U8 index) const
99 {
100 LLSD result;
101 LLTextureEntry *te = mObject->getTE(index);
102 if (NULL != te)
103 {
104 llassert((te->getMediaData() != NULL) == te->hasMedia());
105 if (te->getMediaData() != NULL)
106 {
107 result = te->getMediaData()->asLLSD();
108 // XXX HACK: workaround bug in asLLSD() where whitelist is not set properly
109 // See DEV-41949
110 if (!result.has(LLMediaEntry::WHITELIST_KEY))
111 {
112 result[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
113 }
114 }
115 }
116 return result;
117 }
118
119 virtual LLUUID getID() const
120 { return mObject->getID(); }
121
122 virtual void mediaNavigateBounceBack(U8 index)
123 { mObject->mediaNavigateBounceBack(index); }
124
125 virtual bool hasMedia() const
126 { return mObject->hasMedia();}
127
128 virtual void updateObjectMediaData(LLSD const &data, const std::string &version_string)
129 { mObject->updateObjectMediaData(data, version_string); }
130
131 virtual F64 getMediaInterest() const
132 {
133 //F64 interest = mObject->getTotalMediaInterest();
134 //FIXME
135 F64 interest = 1024;
136 if (interest < (F64)0.0)
137 {
138 // media interest not valid yet, try pixel area
139 interest = mObject->getPixelArea();
140 // HACK: force recalculation of pixel area if interest is the "magic default" of 1024.
141 if (interest == 1024.f)
142 {
143 const_cast<LLVOVolume*>(static_cast<LLVOVolume*>(mObject))->setPixelAreaAndAngle(gAgent);
144 interest = mObject->getPixelArea();
145 }
146 }
147 return interest;
148 }
149
150 virtual bool isInterestingEnough() const
151 {
152 return true; //FUCKEDUP --> LLViewerMedia::isInterestingEnough(mObject, getMediaInterest());
153 }
154
155 virtual std::string getCapabilityUrl(const std::string &name) const
156 { return mObject->getRegion()->getCapability(name); }
157
158 virtual bool isDead() const
159 { return mObject->isDead(); }
160
161 virtual U32 getMediaVersion() const
162 { return LLTextureEntry::getVersionFromMediaVersionString(mObject->getMediaURL()); }
163
164 virtual bool isNew() const
165 { return mNew; }
166
167private:
168 LLPointer<LLVOVolume> mObject;
169 bool mNew;
170};
171
82 172
83LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 173LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
84 : LLViewerObject(id, pcode, regionp), 174 : LLViewerObject(id, pcode, regionp),
@@ -123,6 +213,18 @@ void LLVOVolume::markDead()
123// static 213// static
124void LLVOVolume::initClass() 214void LLVOVolume::initClass()
125{ 215{
216 // gSavedSettings better be around
217 if (gSavedSettings.getBOOL("PrimMediaMasterEnabled"))
218 {
219 const F32 queue_timer_delay = gSavedSettings.getF32("PrimMediaRequestQueueDelay");
220 const F32 retry_timer_delay = gSavedSettings.getF32("PrimMediaRetryTimerDelay");
221 const U32 max_retries = gSavedSettings.getU32("PrimMediaMaxRetries");
222 const U32 max_sorted_queue_size = gSavedSettings.getU32("PrimMediaMaxSortedQueueSize");
223 const U32 max_round_robin_queue_size = gSavedSettings.getU32("PrimMediaMaxRoundRobinQueueSize");
224
225 sObjectMediaClient = new LLObjectMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries,
226 max_sorted_queue_size, max_round_robin_queue_size);
227 }
126} 228}
127 229
128 230
@@ -132,6 +234,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
132 LLDataPacker *dp) 234 LLDataPacker *dp)
133{ 235{
134 LLColor4U color; 236 LLColor4U color;
237 const S32 teDirtyBits = (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR|TEM_CHANGE_MEDIA);
135 238
136 // Do base class updates... 239 // Do base class updates...
137 U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp); 240 U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
@@ -199,10 +302,15 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
199 // 302 //
200 // Unpack texture entry data 303 // Unpack texture entry data
201 // 304 //
202 if (unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num) & (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR)) 305 S32 result =unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num);
306 if (result & teDirtyBits)
203 { 307 {
204 updateTEData(); 308 updateTEData();
205 } 309 }
310 if (result & TEM_CHANGE_MEDIA)
311 {
312 retval |= MEDIA_FLAGS_CHANGED;
313 }
206 } 314 }
207 else 315 else
208 { 316 {
@@ -235,9 +343,16 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
235// llerrs << "Bogus TE data in " << getID() << ", crashing!" << llendl; 343// llerrs << "Bogus TE data in " << getID() << ", crashing!" << llendl;
236 llwarns << "Bogus TE data in " << getID() << llendl; 344 llwarns << "Bogus TE data in " << getID() << llendl;
237 } 345 }
238 else if (res2 & (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR)) 346 else
239 { 347 {
240 updateTEData(); 348 if (res2 & teDirtyBits)
349 {
350 updateTEData();
351 }
352 if (res2 & TEM_CHANGE_MEDIA)
353 {
354 retval |= MEDIA_FLAGS_CHANGED;
355 }
241 } 356 }
242 357
243 U32 value = dp->getPassFlags(); 358 U32 value = dp->getPassFlags();
@@ -275,13 +390,39 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
275 U8 tdpbuffer[1024]; 390 U8 tdpbuffer[1024];
276 LLDataPackerBinaryBuffer tdp(tdpbuffer, 1024); 391 LLDataPackerBinaryBuffer tdp(tdpbuffer, 1024);
277 mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureEntry, tdpbuffer, 0, block_num); 392 mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureEntry, tdpbuffer, 0, block_num);
278 if ( unpackTEMessage(tdp) & (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR)) 393 S32 result = unpackTEMessage(tdp);
394 if (result & teDirtyBits)
279 { 395 {
280 updateTEData(); 396 updateTEData();
281 } 397 }
398 if (result & TEM_CHANGE_MEDIA)
399 {
400 retval |= MEDIA_FLAGS_CHANGED;
401 }
282 } 402 }
283 } 403 }
284 } 404 }
405
406 if (retval & (MEDIA_URL_REMOVED | MEDIA_URL_ADDED | MEDIA_URL_UPDATED | MEDIA_FLAGS_CHANGED))
407 {
408 // If only the media URL changed, and it isn't a media version URL,
409 // ignore it
410 if ( ! ( retval & (MEDIA_URL_ADDED | MEDIA_URL_UPDATED) &&
411 mMedia && ! mMedia->mMediaURL.empty() &&
412 ! LLTextureEntry::isMediaVersionString(mMedia->mMediaURL) ) )
413 {
414 // If the media changed at all, request new media data
415 LL_DEBUGS("MediaOnAPrim") << "Media update: " << getID() << ": retval=" << retval << " Media URL: " <<
416 ((mMedia) ? mMedia->mMediaURL : std::string("")) << LL_ENDL;
417 requestMediaDataUpdate(retval & MEDIA_FLAGS_CHANGED);
418 }
419 else {
420 LL_INFOS("MediaOnAPrim") << "Ignoring media update for: " << getID() << " Media URL: " <<
421 ((mMedia) ? mMedia->mMediaURL : std::string("")) << LL_ENDL;
422 }
423 }
424 // ...and clean up any media impls
425 cleanUpMediaImpls();
285 426
286 return retval; 427 return retval;
287} 428}
@@ -2894,4 +3035,253 @@ void LLHUDPartition::shift(const LLVector3 &offset)
2894 //HUD objects don't shift with region crossing. That would be silly. 3035 //HUD objects don't shift with region crossing. That would be silly.
2895} 3036}
2896 3037
3038void LLVOVolume::requestMediaDataUpdate(bool isNew)
3039{
3040 if (sObjectMediaClient)
3041 sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this, isNew));
3042}
3043
3044void LLVOVolume::cleanUpMediaImpls()
3045{
3046 // Iterate through our TEs and remove any Impls that are no longer used
3047 const U8 numTEs = getNumTEs();
3048 for (U8 i = 0; i < numTEs; i++)
3049 {
3050 const LLTextureEntry* te = getTE(i);
3051 if( ! te->hasMedia())
3052 {
3053 // Delete the media IMPL!
3054 removeMediaImpl(i) ;
3055 }
3056 }
3057}
3058
3059void LLVOVolume::removeMediaImpl(S32 texture_index)
3060{
3061 if(mMediaImplList.size() <= (U32)texture_index || mMediaImplList[texture_index].isNull())
3062 {
3063 return ;
3064 }
3065
3066 //make the face referencing to mMediaImplList[texture_index] to point back to the old texture.
3067 if(mDrawable)
3068 {
3069 LLFace* facep = mDrawable->getFace(texture_index) ;
3070 if(facep)
3071 {
3072 //LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
3073 //if(media_tex)
3074 //{
3075 // media_tex->removeMediaFromFace(facep) ;
3076 //}
3077 }
3078 }
3079
3080 //check if some other face(s) of this object reference(s)to this media impl.
3081 S32 i ;
3082 S32 end = (S32)mMediaImplList.size() ;
3083 for(i = 0; i < end ; i++)
3084 {
3085 if( i != texture_index && mMediaImplList[i] == mMediaImplList[texture_index])
3086 {
3087 break ;
3088 }
3089 }
3090
3091 if(i == end) //this object does not need this media impl.
3092 {
3093 //mMediaImplList[texture_index]->removeObject(this) ;
3094 }
3095
3096 mMediaImplList[texture_index] = NULL ;
3097 return ;
3098}
3099
3100void LLVOVolume::addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index)
3101{
3102 if((S32)mMediaImplList.size() < texture_index + 1)
3103 {
3104 mMediaImplList.resize(texture_index + 1) ;
3105 }
3106
3107 if(mMediaImplList[texture_index].notNull())
3108 {
3109 if(mMediaImplList[texture_index] == media_impl)
3110 {
3111 return ;
3112 }
3113
3114 removeMediaImpl(texture_index) ;
3115 }
3116
3117 mMediaImplList[texture_index] = media_impl;
3118 //media_impl->addObject(this) ;
3119
3120 //add the face to show the media if it is in playing
3121 if(mDrawable)
3122 {
3123 LLFace* facep = mDrawable->getFace(texture_index) ;
3124 if(facep)
3125 {
3126 //LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[texture_index]->getMediaTextureID()) ;
3127 //if(media_tex)
3128 //{
3129 // media_tex->addMediaToFace(facep) ;
3130 //}
3131 }
3132 else //the face is not available now, start media on this face later.
3133 {
3134 //media_impl->setUpdated(TRUE) ;
3135 }
3136 }
3137 return ;
3138}
3139
3140void LLVOVolume::sendMediaDataUpdate()
3141{
3142 if (sObjectMediaClient)
3143 sObjectMediaClient->updateMedia(new LLMediaDataClientObjectImpl(this, false));
3144}
3145
3146void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::string &media_version)
3147{
3148 // media_data_array is an array of media entry maps
3149 // media_version is the version string in the response.
3150 U32 fetched_version = LLTextureEntry::getVersionFromMediaVersionString(media_version);
3151
3152 // Only update it if it is newer!
3153 if ( (S32)fetched_version > mLastFetchedMediaVersion)
3154 {
3155 mLastFetchedMediaVersion = fetched_version;
3156 //llinfos << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << llendl;
3157
3158 LLSD::array_const_iterator iter = media_data_array.beginArray();
3159 LLSD::array_const_iterator end = media_data_array.endArray();
3160 U8 texture_index = 0;
3161 for (; iter != end; ++iter, ++texture_index)
3162 {
3163 syncMediaData(texture_index, *iter, false/*merge*/, false/*ignore_agent*/);
3164 }
3165 }
3166}
3167
3168bool LLVOVolume::hasMedia() const
3169{
3170 bool result = false;
3171 const U8 numTEs = getNumTEs();
3172 for (U8 i = 0; i < numTEs; i++)
3173 {
3174 const LLTextureEntry* te = getTE(i);
3175 if(te->hasMedia())
3176 {
3177 result = true;
3178 break;
3179 }
3180 }
3181 return result;
3182}
3183
3184void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool merge, bool ignore_agent)
3185{
3186 if(mDead)
3187 {
3188 // If the object has been marked dead, don't process media updates.
3189 return;
3190 }
3191
3192 LLTextureEntry *te = getTE(texture_index);
3193// LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index
3194// << " hasMedia = " << te->hasMedia() << " : "
3195// << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
2897 3196
3197 std::string previous_url;
3198 LLMediaEntry* mep = te->getMediaData();
3199 if(mep)
3200 {
3201 // Save the "current url" from before the update so we can tell if
3202 // it changes.
3203 previous_url = mep->getCurrentURL();
3204 }
3205
3206 if (merge)
3207 {
3208 te->mergeIntoMediaData(media_data);
3209 }
3210 else {
3211 // XXX Question: what if the media data is undefined LLSD, but the
3212 // update we got above said that we have media flags?? Here we clobber
3213 // that, assuming the data from the service is more up-to-date.
3214 te->updateMediaData(media_data);
3215 }
3216
3217 mep = te->getMediaData();
3218 if(mep)
3219 {
3220 bool update_from_self = false;
3221 if (!ignore_agent)
3222 {
3223 LLUUID updating_agent = LLTextureEntry::getAgentIDFromMediaVersionString(getMediaURL());
3224 update_from_self = (updating_agent == gAgent.getID());
3225 }
3226 //viewer_media_t media_impl = LLViewerMedia::updateMediaImpl(mep, previous_url, update_from_self);
3227
3228 //addMediaImpl(media_impl, texture_index) ;
3229 }
3230 else
3231 {
3232 //removeMediaImpl(texture_index);
3233 }
3234
3235// LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index
3236// << " hasMedia = " << te->hasMedia() << " : "
3237// << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
3238}
3239
3240
3241void LLVOVolume::mediaNavigateBounceBack(U8 texture_index)
3242{
3243 /*
3244 // Find the media entry for this navigate
3245 const LLMediaEntry* mep = NULL;
3246 viewer_media_t impl = getMediaImpl(texture_index);
3247 LLTextureEntry *te = getTE(texture_index);
3248 if(te)
3249 {
3250 mep = te->getMediaData();
3251 }
3252
3253 if (mep && impl)
3254 {
3255 std::string url = mep->getCurrentURL();
3256 // Look for a ":", if not there, assume "http://"
3257 if (!url.empty() && std::string::npos == url.find(':'))
3258 {
3259 url = "http://" + url;
3260 }
3261 // If the url we're trying to "bounce back" to is either empty or not
3262 // allowed by the whitelist, try the home url. If *that* doesn't work,
3263 // set the media as failed and unload it
3264 if (url.empty() || !mep->checkCandidateUrl(url))
3265 {
3266 url = mep->getHomeURL();
3267 // Look for a ":", if not there, assume "http://"
3268 if (!url.empty() && std::string::npos == url.find(':'))
3269 {
3270 url = "http://" + url;
3271 }
3272 }
3273 if (url.empty() || !mep->checkCandidateUrl(url))
3274 {
3275 // The url to navigate back to is not good, and we have nowhere else
3276 // to go.
3277 LL_WARNS("MediaOnAPrim") << "FAILED to bounce back URL \"" << url << "\" -- unloading impl" << LL_ENDL;
3278 impl->setMediaFailed(true);
3279 }
3280 else {
3281 // Okay, navigate now
3282 LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL;
3283 impl->navigateTo(url, "", false, true);
3284 }
3285 }
3286 */
3287}
diff --git a/linden/indra/newview/llvovolume.h b/linden/indra/newview/llvovolume.h
index d09a198..39d9227 100644
--- a/linden/indra/newview/llvovolume.h
+++ b/linden/indra/newview/llvovolume.h
@@ -36,6 +36,8 @@
36#include "llviewerobject.h" 36#include "llviewerobject.h"
37#include "llviewerimage.h" 37#include "llviewerimage.h"
38#include "llframetimer.h" 38#include "llframetimer.h"
39#include "llmediadataclient.h"
40#include "llviewermedia.h"
39#include "llapr.h" 41#include "llapr.h"
40#include <map> 42#include <map>
41 43
@@ -43,6 +45,8 @@ class LLViewerTextureAnim;
43class LLDrawPool; 45class LLDrawPool;
44class LLSelectNode; 46class LLSelectNode;
45 47
48typedef std::vector<viewer_media_t> media_list_t;
49
46enum LLVolumeInterfaceType 50enum LLVolumeInterfaceType
47{ 51{
48 INTERFACE_FLEXIBLE = 1, 52 INTERFACE_FLEXIBLE = 1,
@@ -217,6 +221,46 @@ public:
217 221
218 // tag: vaa emerald local_asset_browser 222 // tag: vaa emerald local_asset_browser
219 void setSculptChanged(BOOL has_changed) { mSculptChanged = has_changed; } 223 void setSculptChanged(BOOL has_changed) { mSculptChanged = has_changed; }
224
225
226 // Functions that deal with media, or media navigation
227
228 // Update this object's media data with the given media data array
229 // (typically this is only called upon a response from a server request)
230 void updateObjectMediaData(const LLSD &media_data_array, const std::string &media_version);
231
232 // Bounce back media at the given index to its current URL (or home URL, if current URL is empty)
233 void mediaNavigateBounceBack(U8 texture_index);
234
235 // Returns whether or not this object has permission to navigate or control
236 // the given media entry
237 enum MediaPermType {
238 MEDIA_PERM_INTERACT, MEDIA_PERM_CONTROL
239 };
240 bool hasMediaPermission(const LLMediaEntry* media_entry, MediaPermType perm_type);
241
242 void mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, std::string new_location);
243 void mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, LLViewerMediaObserver::EMediaEvent event);
244
245 // Sync the given media data with the impl and the given te
246 void syncMediaData(S32 te, const LLSD &media_data, bool merge, bool ignore_agent);
247
248 // Send media data update to the simulator.
249 void sendMediaDataUpdate();
250
251 viewer_media_t getMediaImpl(U8 face_id) const;
252 S32 getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S32 start_face_id);
253 F64 getTotalMediaInterest() const;
254
255 bool hasMedia() const;
256
257 LLVector3 getApproximateFaceNormal(U8 face_id);
258
259 // Returns 'true' iff the media data for this object is in flight
260 bool isMediaDataBeingFetched() const;
261
262 // Returns the "last fetched" media version, or -1 if not fetched yet
263 S32 getLastFetchedMediaVersion() const { return mLastFetchedMediaVersion; }
220 264
221protected: 265protected:
222 S32 computeLODDetail(F32 distance, F32 radius); 266 S32 computeLODDetail(F32 distance, F32 radius);
@@ -224,6 +268,11 @@ protected:
224 LLFace* addFace(S32 face_index); 268 LLFace* addFace(S32 face_index);
225 void updateTEData(); 269 void updateTEData();
226 270
271 void requestMediaDataUpdate(bool isNew);
272 void cleanUpMediaImpls();
273 void addMediaImpl(LLViewerMediaImpl* media_impl, S32 texture_index) ;
274 void removeMediaImpl(S32 texture_index) ;
275
227public: 276public:
228 LLViewerTextureAnim *mTextureAnimp; 277 LLViewerTextureAnim *mTextureAnimp;
229 U8 mTexAnimMode; 278 U8 mTexAnimMode;
@@ -242,12 +291,16 @@ private:
242 LLVolumeInterface *mVolumeImpl; 291 LLVolumeInterface *mVolumeImpl;
243 LLPointer<LLViewerImage> mSculptTexture; 292 LLPointer<LLViewerImage> mSculptTexture;
244 S32 mIndexInTex; // index of this volume in the texture's volume list 293 S32 mIndexInTex; // index of this volume in the texture's volume list
294 media_list_t mMediaImplList;
295 S32 mLastFetchedMediaVersion; // as fetched from the server, starts as -1
245 296
246 // statics 297 // statics
247public: 298public:
248 static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop 299 static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop
249 static F32 sLODFactor; // LOD scale factor 300 static F32 sLODFactor; // LOD scale factor
250 static F32 sDistanceFactor; // LOD distance factor 301 static F32 sDistanceFactor; // LOD distance factor
302 static LLPointer<LLObjectMediaDataClient> sObjectMediaClient;
303 static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient;
251 304
252protected: 305protected:
253 static S32 sNumLODChanges; 306 static S32 sNumLODChanges;
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index cd9b3be..61ad8b7 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -232,6 +232,7 @@ BOOL LLPipeline::sPickAvatar = TRUE;
232BOOL LLPipeline::sDynamicLOD = TRUE; 232BOOL LLPipeline::sDynamicLOD = TRUE;
233BOOL LLPipeline::sShowHUDAttachments = TRUE; 233BOOL LLPipeline::sShowHUDAttachments = TRUE;
234BOOL LLPipeline::sRenderPhysicalBeacons = TRUE; 234BOOL LLPipeline::sRenderPhysicalBeacons = TRUE;
235BOOL LLPipeline::sRenderMOAPBeacons = FALSE;
235BOOL LLPipeline::sRenderScriptedBeacons = FALSE; 236BOOL LLPipeline::sRenderScriptedBeacons = FALSE;
236BOOL LLPipeline::sRenderScriptedTouchBeacons = TRUE; 237BOOL LLPipeline::sRenderScriptedTouchBeacons = TRUE;
237BOOL LLPipeline::sRenderParticleBeacons = FALSE; 238BOOL LLPipeline::sRenderParticleBeacons = FALSE;
@@ -2149,6 +2150,43 @@ void renderPhysicalBeacons(LLDrawable* drawablep)
2149 } 2150 }
2150} 2151}
2151 2152
2153void renderMOAPBeacons(LLDrawable* drawablep)
2154{
2155 LLViewerObject *vobj = drawablep->getVObj();
2156
2157 if(!vobj || vobj->isAvatar())
2158 return;
2159
2160 BOOL beacon=FALSE;
2161 U8 tecount=vobj->getNumTEs();
2162 for(int x=0;x<tecount;x++)
2163 {
2164 if(vobj->getTE(x)->hasMedia())
2165 {
2166 beacon=TRUE;
2167 break;
2168 }
2169 }
2170 if(beacon==TRUE)
2171 {
2172 if (gPipeline.sRenderBeacons)
2173 {
2174 gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth"));
2175 }
2176
2177 if (gPipeline.sRenderHighlight)
2178 {
2179 S32 face_id;
2180 S32 count = drawablep->getNumFaces();
2181 for (face_id = 0; face_id < count; face_id++)
2182 {
2183 gPipeline.mHighlightFaces.push_back(drawablep->getFace(face_id) );
2184 }
2185 }
2186 }
2187}
2188
2189
2152void renderParticleBeacons(LLDrawable* drawablep) 2190void renderParticleBeacons(LLDrawable* drawablep)
2153{ 2191{
2154 // Look for attachments, objects, etc. 2192 // Look for attachments, objects, etc.
@@ -2329,6 +2367,11 @@ void LLPipeline::postSort(LLCamera& camera)
2329 forAllVisibleDrawables(renderPhysicalBeacons); 2367 forAllVisibleDrawables(renderPhysicalBeacons);
2330 } 2368 }
2331 2369
2370 if(sRenderMOAPBeacons)
2371 {
2372 forAllVisibleDrawables(renderMOAPBeacons);
2373 }
2374
2332 if (sRenderParticleBeacons) 2375 if (sRenderParticleBeacons)
2333 { 2376 {
2334 forAllVisibleDrawables(renderParticleBeacons); 2377 forAllVisibleDrawables(renderParticleBeacons);
@@ -4563,6 +4606,24 @@ BOOL LLPipeline::getRenderScriptedTouchBeacons(void*)
4563} 4606}
4564 4607
4565// static 4608// static
4609void LLPipeline::setRenderMOAPBeacons(BOOL val)
4610{
4611 sRenderMOAPBeacons = val;
4612}
4613
4614// static
4615void LLPipeline::toggleRenderMOAPBeacons(void*)
4616{
4617 sRenderMOAPBeacons = !sRenderMOAPBeacons;
4618}
4619
4620// static
4621BOOL LLPipeline::getRenderMOAPBeacons(void*)
4622{
4623 return sRenderMOAPBeacons;
4624}
4625
4626// static
4566void LLPipeline::setRenderPhysicalBeacons(BOOL val) 4627void LLPipeline::setRenderPhysicalBeacons(BOOL val)
4567{ 4628{
4568 sRenderPhysicalBeacons = val; 4629 sRenderPhysicalBeacons = val;
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index c5ab7ab..254b3c1 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -271,6 +271,10 @@ public:
271 static void toggleRenderPhysicalBeacons(void* data); 271 static void toggleRenderPhysicalBeacons(void* data);
272 static BOOL getRenderPhysicalBeacons(void* data); 272 static BOOL getRenderPhysicalBeacons(void* data);
273 273
274 static void setRenderMOAPBeacons(BOOL val);
275 static void toggleRenderMOAPBeacons(void * data);
276 static BOOL getRenderMOAPBeacons(void * data);
277
274 static void setRenderScriptedBeacons(BOOL val); 278 static void setRenderScriptedBeacons(BOOL val);
275 static void toggleRenderScriptedBeacons(void* data); 279 static void toggleRenderScriptedBeacons(void* data);
276 static BOOL getRenderScriptedBeacons(void* data); 280 static BOOL getRenderScriptedBeacons(void* data);
@@ -572,6 +576,7 @@ protected:
572 S32 mLightingDetail; 576 S32 mLightingDetail;
573 577
574 static BOOL sRenderPhysicalBeacons; 578 static BOOL sRenderPhysicalBeacons;
579 static BOOL sRenderMOAPBeacons;
575 static BOOL sRenderScriptedTouchBeacons; 580 static BOOL sRenderScriptedTouchBeacons;
576 static BOOL sRenderScriptedBeacons; 581 static BOOL sRenderScriptedBeacons;
577 static BOOL sRenderParticleBeacons; 582 static BOOL sRenderParticleBeacons;
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml b/linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml
index e698878..2f9fc4d 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_beacons.xml
@@ -1,15 +1,16 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false" 2<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
3 width="250" height="225" 3 width="250" height="255"
4 name="beacons" title="Beacons" 4 name="beacons" title="Beacons"
5 rect_control="FloaterBeaconsRect" control_name="BeaconsEnabled"> 5 rect_control="FloaterBeaconsRect" control_name="BeaconsEnabled">
6 <panel bottom="10" follows="left|top|right|bottom" left="10" width="230" height="200" name="beacons_panel"> 6 <panel bottom="10" follows="left|top|right|bottom" left="10" width="230" height="240" name="beacons_panel">
7 <check_box bottom_delta="-33" follows="left|top" left="0" name="touch_only" label="Scripted Objects with Touch Only" control_name="scripttouchbeacon" /> 7 <check_box bottom_delta="-33" follows="left|top" left="0" name="touch_only" label="Scripted Objects with Touch Only" control_name="scripttouchbeacon" />
8 <check_box bottom_delta="-20" follows="left|top" left="0" name="scripted" label="Scripted Objects" control_name="scriptsbeacon" /> 8 <check_box bottom_delta="-20" follows="left|top" left="0" name="scripted" label="Scripted Objects" control_name="scriptsbeacon" />
9 <check_box bottom_delta="-20" follows="left|top" left="0" name="physical" label="Physical Objects" control_name="physicalbeacon" /> 9 <check_box bottom_delta="-20" follows="left|top" left="0" name="physical" label="Physical Objects" control_name="physicalbeacon" />
10 <check_box bottom_delta="-20" follows="left|top" left="0" name="sounds" label="Sound Sources" control_name="soundsbeacon" /> 10 <check_box bottom_delta="-20" follows="left|top" left="0" name="sounds" label="Sound Sources" control_name="soundsbeacon" />
11 <check_box bottom_delta="-20" follows="left|top" left="0" name="particles" label="Particle Sources" control_name="particlesbeacon" /> 11 <check_box bottom_delta="-20" follows="left|top" left="0" name="particles" label="Particle Sources" control_name="particlesbeacon" />
12 <check_box bottom_delta="-20" follows="left|top" left="0" name="highlights" label="Render Highlights" control_name="renderhighlights" /> 12 <check_box bottom_delta="-20" follows="left|top" left="0" name="highlights" label="Render Highlights" control_name="renderhighlights" />
13 <check_box bottom_delta="-20" follows="left|top" left="0" name="moap" label="MOAP Objects" control_name="moapbeacon" />
13 <check_box bottom_delta="-20" follows="left|top" left="0" name="beacons" label="Render Beacons" control_name="renderbeacons" /> 14 <check_box bottom_delta="-20" follows="left|top" left="0" name="beacons" label="Render Beacons" control_name="renderbeacons" />
14 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 15 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
15 bottom_delta="-30" drop_shadow_visible="true" enabled="true" follows="left|top" 16 bottom_delta="-30" drop_shadow_visible="true" enabled="true" follows="left|top"
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index efde449..c66bce0 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -385,6 +385,10 @@
385 <on_click function="ShowFloater" userdata="mini map" /> 385 <on_click function="ShowFloater" userdata="mini map" />
386 <on_check control="ShowMiniMap" /> 386 <on_check control="ShowMiniMap" />
387 </menu_item_check> 387 </menu_item_check>
388 <menu_item_check enabled="true" label="MOAP Radar" name="MOAPRadar" shortcut="">
389 <on_click function="View.ToggleMOAPList" userdata="moapradar" />
390 <on_check control="ShowMOAPRadar" />
391 </menu_item_check>
388 <menu_item_separator /> 392 <menu_item_separator />
389 <menu_item_check label="Animation Overrider" name="AO" 393 <menu_item_check label="Animation Overrider" name="AO"
390 shortcut="control|shift|O"> 394 shortcut="control|shift|O">