aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llviewerobjectlist.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llviewerobjectlist.cpp')
-rw-r--r--linden/indra/newview/llviewerobjectlist.cpp61
1 files changed, 37 insertions, 24 deletions
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp
index bd8ed97..163b039 100644
--- a/linden/indra/newview/llviewerobjectlist.cpp
+++ b/linden/indra/newview/llviewerobjectlist.cpp
@@ -716,17 +716,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
716 /* 716 /*
717 // Debugging code for viewing orphans, and orphaned parents 717 // Debugging code for viewing orphans, and orphaned parents
718 LLUUID id; 718 LLUUID id;
719 char id_str[UUID_STR_LENGTH + 20];
720 for (i = 0; i < mOrphanParents.count(); i++) 719 for (i = 0; i < mOrphanParents.count(); i++)
721 { 720 {
722 id = sIndexAndLocalIDToUUID[mOrphanParents[i]]; 721 id = sIndexAndLocalIDToUUID[mOrphanParents[i]];
723 LLViewerObject *objectp = findObject(id); 722 LLViewerObject *objectp = findObject(id);
724 if (objectp) 723 if (objectp)
725 { 724 {
726 sprintf(id_str, "Par: "); 725 std::string id_str;
727 objectp->mID.toString(id_str + 5); 726 objectp->mID.toString(id_str);
727 std::string tmpstr = std::string("Par: ") + id_str;
728 addDebugBeacon(objectp->getPositionAgent(), 728 addDebugBeacon(objectp->getPositionAgent(),
729 id_str, 729 tmpstr,
730 LLColor4(1.f,0.f,0.f,1.f), 730 LLColor4(1.f,0.f,0.f,1.f),
731 LLColor4(1.f,1.f,1.f,1.f)); 731 LLColor4(1.f,1.f,1.f,1.f));
732 } 732 }
@@ -739,20 +739,22 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
739 LLViewerObject *objectp = findObject(oi.mChildInfo); 739 LLViewerObject *objectp = findObject(oi.mChildInfo);
740 if (objectp) 740 if (objectp)
741 { 741 {
742 std::string id_str;
743 objectp->mID.toString(id_str);
744 std::string tmpstr;
742 if (objectp->getParent()) 745 if (objectp->getParent())
743 { 746 {
744 sprintf(id_str, "ChP: "); 747 tmpstr = std::string("ChP: ") + id_str;
745 text_color = LLColor4(0.f, 1.f, 0.f, 1.f); 748 text_color = LLColor4(0.f, 1.f, 0.f, 1.f);
746 } 749 }
747 else 750 else
748 { 751 {
749 sprintf(id_str, "ChNoP: "); 752 tmpstr = std::string("ChNoP: ") + id_str;
750 text_color = LLColor4(1.f, 0.f, 0.f, 1.f); 753 text_color = LLColor4(1.f, 0.f, 0.f, 1.f);
751 } 754 }
752 id = sIndexAndLocalIDToUUID[oi.mParentInfo]; 755 id = sIndexAndLocalIDToUUID[oi.mParentInfo];
753 objectp->mID.toString(id_str + 8);
754 addDebugBeacon(objectp->getPositionAgent() + LLVector3(0.f, 0.f, -0.25f), 756 addDebugBeacon(objectp->getPositionAgent() + LLVector3(0.f, 0.f, -0.25f),
755 id_str, 757 tmpstr,
756 LLColor4(0.25f,0.25f,0.25f,1.f), 758 LLColor4(0.25f,0.25f,0.25f,1.f),
757 text_color); 759 text_color);
758 } 760 }
@@ -1076,14 +1078,14 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 &center)
1076{ 1078{
1077} 1079}
1078 1080
1079 1081void LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent)
1080U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parcel_wall, BOOL keep_pick_list)
1081{ 1082{
1082 gRenderForSelect = TRUE; 1083 generatePickList(camera);
1084 renderPickList(screen_rect, pick_parcel_wall, render_transparent);
1085}
1083 1086
1084 // LLTimer pick_timer; 1087void LLViewerObjectList::generatePickList(LLCamera &camera)
1085 if (!keep_pick_list) 1088{
1086 {
1087 LLViewerObject *objectp; 1089 LLViewerObject *objectp;
1088 S32 i; 1090 S32 i;
1089 // Reset all of the GL names to zero. 1091 // Reset all of the GL names to zero.
@@ -1161,9 +1163,11 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1161 if (objectp) 1163 if (objectp)
1162 { 1164 {
1163 mSelectPickList.insert(objectp); 1165 mSelectPickList.insert(objectp);
1164 for (U32 i = 0; i < objectp->mChildList.size(); i++) 1166 LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
1167 for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
1168 iter != child_list.end(); iter++)
1165 { 1169 {
1166 LLViewerObject* childp = objectp->mChildList[i]; 1170 LLViewerObject* childp = *iter;
1167 if (childp) 1171 if (childp)
1168 { 1172 {
1169 mSelectPickList.insert(childp); 1173 mSelectPickList.insert(childp);
@@ -1197,11 +1201,14 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1197 } 1201 }
1198 1202
1199 LLHUDIcon::generatePickIDs(i * step, step); 1203 LLHUDIcon::generatePickIDs(i * step, step);
1200
1201 // At this point, we should only have live drawables/viewer objects
1202 gPipeline.renderForSelect(mSelectPickList);
1203 }
1204 } 1204 }
1205}
1206
1207void LLViewerObjectList::renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent)
1208{
1209 gRenderForSelect = TRUE;
1210
1211 gPipeline.renderForSelect(mSelectPickList, render_transparent, screen_rect);
1205 1212
1206 // 1213 //
1207 // Render pass for selected objects 1214 // Render pass for selected objects
@@ -1209,8 +1216,13 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1209 gGL.color4f(1,1,1,1); 1216 gGL.color4f(1,1,1,1);
1210 gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE ); 1217 gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE );
1211 1218
1212 // render pickable ui elements, like names, etc. 1219 //fix for DEV-19335. Don't pick hud objects when customizing avatar (camera mode doesn't play nice with nametags).
1213 LLHUDObject::renderAllForSelect(); 1220 if (!gAgent.cameraCustomizeAvatar())
1221 {
1222 // render pickable ui elements, like names, etc.
1223 LLHUDObject::renderAllForSelect();
1224 }
1225
1214 gGL.flush(); 1226 gGL.flush();
1215 LLVertexBuffer::unbind(); 1227 LLVertexBuffer::unbind();
1216 1228
@@ -1218,7 +1230,6 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce
1218 1230
1219 //llinfos << "Rendered " << count << " for select" << llendl; 1231 //llinfos << "Rendered " << count << " for select" << llendl;
1220 //llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl; 1232 //llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl;
1221 return 0;
1222} 1233}
1223 1234
1224LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id) 1235LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id)
@@ -1235,7 +1246,7 @@ LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id)
1235} 1246}
1236 1247
1237void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent, 1248void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent,
1238 const LLString &string, 1249 const std::string &string,
1239 const LLColor4 &color, 1250 const LLColor4 &color,
1240 const LLColor4 &text_color, 1251 const LLColor4 &text_color,
1241 S32 line_width) 1252 S32 line_width)
@@ -1505,6 +1516,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
1505//////////////////////////////////////////////////////////////////////////// 1516////////////////////////////////////////////////////////////////////////////
1506 1517
1507LLViewerObjectList::OrphanInfo::OrphanInfo() 1518LLViewerObjectList::OrphanInfo::OrphanInfo()
1519 : mParentInfo(0)
1508{ 1520{
1509} 1521}
1510 1522
@@ -1523,3 +1535,4 @@ bool LLViewerObjectList::OrphanInfo::operator!=(const OrphanInfo &rhs) const
1523 return !operator==(rhs); 1535 return !operator==(rhs);
1524} 1536}
1525 1537
1538