diff options
Diffstat (limited to 'linden/indra/newview/llviewerobjectlist.cpp')
-rw-r--r-- | linden/indra/newview/llviewerobjectlist.cpp | 77 |
1 files changed, 50 insertions, 27 deletions
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 49f2aae..8c15906 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp | |||
@@ -230,7 +230,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, | |||
230 | && update_type != OUT_TERSE_IMPROVED | 230 | && update_type != OUT_TERSE_IMPROVED |
231 | && objectp->mCreateSelected) | 231 | && objectp->mCreateSelected) |
232 | { | 232 | { |
233 | if ( gToolMgr->getCurrentTool( gKeyboard->currentMask(TRUE) ) != gToolPie ) | 233 | if ( gToolMgr->getCurrentTool() != gToolPie ) |
234 | { | 234 | { |
235 | //llinfos << "DEBUG selecting " << objectp->mID << " " | 235 | //llinfos << "DEBUG selecting " << objectp->mID << " " |
236 | // << objectp->mLocalID << llendl; | 236 | // << objectp->mLocalID << llendl; |
@@ -584,7 +584,8 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) | |||
584 | } | 584 | } |
585 | 585 | ||
586 | // Selected | 586 | // Selected |
587 | for (objectp = gSelectMgr->getFirstRootObject(); objectp; objectp = gSelectMgr->getNextRootObject()) | 587 | LLObjectSelectionHandle selection = gSelectMgr->getSelection(); |
588 | for (objectp = selection->getFirstRootObject(); objectp; objectp = selection->getNextRootObject()) | ||
588 | { | 589 | { |
589 | objectp->boostTexturePriority(); | 590 | objectp->boostTexturePriority(); |
590 | } | 591 | } |
@@ -749,6 +750,15 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) | |||
749 | mNumVisCulledStat.addValue(mNumVisCulled); | 750 | mNumVisCulledStat.addValue(mNumVisCulled); |
750 | } | 751 | } |
751 | 752 | ||
753 | void LLViewerObjectList::clearDebugText() | ||
754 | { | ||
755 | for (S32 i = 0; i < mObjects.count(); i++) | ||
756 | { | ||
757 | mObjects[i]->setDebugText(""); | ||
758 | } | ||
759 | } | ||
760 | |||
761 | |||
752 | void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) | 762 | void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) |
753 | { | 763 | { |
754 | LLMemType mt(LLMemType::MTYPE_OBJECT); | 764 | LLMemType mt(LLMemType::MTYPE_OBJECT); |
@@ -1070,7 +1080,15 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce | |||
1070 | mSelectPickList.clear(); | 1080 | mSelectPickList.clear(); |
1071 | 1081 | ||
1072 | std::vector<LLDrawable*> pick_drawables; | 1082 | std::vector<LLDrawable*> pick_drawables; |
1073 | gPipeline.mObjectPartition->cull(camera, &pick_drawables, TRUE); | 1083 | |
1084 | for (i = 0; i < LLPipeline::NUM_PARTITIONS-1; i++) | ||
1085 | { | ||
1086 | LLSpatialPartition* part = gPipeline.getSpatialPartition(i); | ||
1087 | if (part) | ||
1088 | { | ||
1089 | part->cull(camera, &pick_drawables, TRUE); | ||
1090 | } | ||
1091 | } | ||
1074 | 1092 | ||
1075 | for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin(); | 1093 | for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin(); |
1076 | iter != pick_drawables.end(); iter++) | 1094 | iter != pick_drawables.end(); iter++) |
@@ -1092,10 +1110,10 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce | |||
1092 | 1110 | ||
1093 | LLHUDText::addPickable(mSelectPickList); | 1111 | LLHUDText::addPickable(mSelectPickList); |
1094 | 1112 | ||
1095 | for (objectp = (LLVOAvatar*)LLCharacter::sInstances.getFirstData(); | 1113 | for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); |
1096 | objectp; | 1114 | iter != LLCharacter::sInstances.end(); ++iter) |
1097 | objectp = (LLVOAvatar*)LLCharacter::sInstances.getNextData()) | ||
1098 | { | 1115 | { |
1116 | objectp = (LLVOAvatar*) *iter; | ||
1099 | if (!objectp->isDead()) | 1117 | if (!objectp->isDead()) |
1100 | { | 1118 | { |
1101 | if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible()) | 1119 | if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible()) |
@@ -1116,7 +1134,7 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce | |||
1116 | { | 1134 | { |
1117 | if (attachmentp->getIsHUDAttachment()) | 1135 | if (attachmentp->getIsHUDAttachment()) |
1118 | { | 1136 | { |
1119 | LLViewerObject* objectp = attachmentp->getObject(0); | 1137 | LLViewerObject* objectp = attachmentp->getObject(); |
1120 | if (objectp) | 1138 | if (objectp) |
1121 | { | 1139 | { |
1122 | mSelectPickList.insert(objectp); | 1140 | mSelectPickList.insert(objectp); |
@@ -1132,32 +1150,36 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce | |||
1132 | } | 1150 | } |
1133 | } | 1151 | } |
1134 | } | 1152 | } |
1135 | 1153 | ||
1136 | S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances(); | 1154 | S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances(); |
1137 | 1155 | ||
1138 | S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables; | 1156 | if (num_pickables != 0) |
1139 | |||
1140 | std::set<LLViewerObject*>::iterator pick_it; | ||
1141 | i = 0; | ||
1142 | for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();) | ||
1143 | { | 1157 | { |
1144 | LLViewerObject* objp = (*pick_it); | 1158 | S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables; |
1145 | if (!objp || objp->isDead() || !objp->mbCanSelect) | 1159 | |
1160 | std::set<LLViewerObject*>::iterator pick_it; | ||
1161 | i = 0; | ||
1162 | for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();) | ||
1146 | { | 1163 | { |
1147 | mSelectPickList.erase(pick_it++); | 1164 | LLViewerObject* objp = (*pick_it); |
1148 | continue; | 1165 | if (!objp || objp->isDead() || !objp->mbCanSelect) |
1166 | { | ||
1167 | mSelectPickList.erase(pick_it++); | ||
1168 | continue; | ||
1169 | } | ||
1170 | |||
1171 | objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET; | ||
1172 | i++; | ||
1173 | ++pick_it; | ||
1149 | } | 1174 | } |
1150 | 1175 | ||
1151 | objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET; | 1176 | LLHUDIcon::generatePickIDs(i * step, step); |
1152 | i++; | 1177 | |
1153 | ++pick_it; | 1178 | // At this point, we should only have live drawables/viewer objects |
1179 | gPipeline.renderForSelect(mSelectPickList); | ||
1154 | } | 1180 | } |
1155 | |||
1156 | LLHUDIcon::generatePickIDs(i * step, step); | ||
1157 | } | 1181 | } |
1158 | 1182 | ||
1159 | // At this point, we should only have live drawables/viewer objects | ||
1160 | gPipeline.renderForSelect(); | ||
1161 | // | 1183 | // |
1162 | // Render pass for selected objects | 1184 | // Render pass for selected objects |
1163 | // | 1185 | // |
@@ -1214,7 +1236,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi | |||
1214 | LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); | 1236 | LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); |
1215 | if (!objectp) | 1237 | if (!objectp) |
1216 | { | 1238 | { |
1217 | llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl; | 1239 | // llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl; |
1218 | return NULL; | 1240 | return NULL; |
1219 | } | 1241 | } |
1220 | 1242 | ||
@@ -1248,7 +1270,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe | |||
1248 | LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); | 1270 | LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp); |
1249 | if (!objectp) | 1271 | if (!objectp) |
1250 | { | 1272 | { |
1251 | llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl; | 1273 | // llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl; |
1252 | return NULL; | 1274 | return NULL; |
1253 | } | 1275 | } |
1254 | 1276 | ||
@@ -1440,7 +1462,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) | |||
1440 | 1462 | ||
1441 | if (orphans_found && objectp->isSelected()) | 1463 | if (orphans_found && objectp->isSelected()) |
1442 | { | 1464 | { |
1443 | LLSelectNode* nodep = gSelectMgr->findSelectNode(objectp); | 1465 | LLSelectNode* nodep = gSelectMgr->getSelection()->findNode(objectp); |
1444 | if (nodep && !nodep->mIndividualSelection) | 1466 | if (nodep && !nodep->mIndividualSelection) |
1445 | { | 1467 | { |
1446 | // rebuild selection with orphans | 1468 | // rebuild selection with orphans |
@@ -1450,6 +1472,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) | |||
1450 | } | 1472 | } |
1451 | } | 1473 | } |
1452 | 1474 | ||
1475 | //////////////////////////////////////////////////////////////////////////// | ||
1453 | 1476 | ||
1454 | LLViewerObjectList::OrphanInfo::OrphanInfo() | 1477 | LLViewerObjectList::OrphanInfo::OrphanInfo() |
1455 | { | 1478 | { |