diff options
author | Jacek Antonelli | 2010-02-09 21:16:01 -0600 |
---|---|---|
committer | Jacek Antonelli | 2010-02-16 18:50:22 -0600 |
commit | 8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920 (patch) | |
tree | 2bfd446fe29250cbd31cb912f952fe2c2ab05c68 /linden/indra/newview/llviewerobjectlist.cpp | |
parent | Ported some stats and texture console changes from Snowglobe. (diff) | |
download | meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.zip meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.gz meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.bz2 meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.xz |
Ported some minor rendering engine changes from Snowglobe.
Diffstat (limited to 'linden/indra/newview/llviewerobjectlist.cpp')
-rw-r--r-- | linden/indra/newview/llviewerobjectlist.cpp | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 3ac8fc4..21a9252 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp | |||
@@ -166,7 +166,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id, | |||
166 | 166 | ||
167 | BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) | 167 | BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) |
168 | { | 168 | { |
169 | if (object.mRegionp) | 169 | if(object.getRegion()) |
170 | { | 170 | { |
171 | U32 local_id = object.mLocalID; | 171 | U32 local_id = object.mLocalID; |
172 | LLHost region_host = object.getRegion()->getHost(); | 172 | LLHost region_host = object.getRegion()->getHost(); |
@@ -176,7 +176,22 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) | |||
176 | U32 index = sIPAndPortToIndex[ipport]; | 176 | U32 index = sIPAndPortToIndex[ipport]; |
177 | 177 | ||
178 | U64 indexid = (((U64)index) << 32) | (U64)local_id; | 178 | U64 indexid = (((U64)index) << 32) | (U64)local_id; |
179 | return sIndexAndLocalIDToUUID.erase(indexid) > 0 ? TRUE : FALSE; | 179 | |
180 | std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid); | ||
181 | if (iter == sIndexAndLocalIDToUUID.end()) | ||
182 | { | ||
183 | return FALSE; | ||
184 | } | ||
185 | |||
186 | // Found existing entry | ||
187 | if (iter->second == object.getID()) | ||
188 | { // Full UUIDs match, so remove the entry | ||
189 | sIndexAndLocalIDToUUID.erase(iter); | ||
190 | return TRUE; | ||
191 | } | ||
192 | // UUIDs did not match - this would zap a valid entry, so don't erase it | ||
193 | //llinfos << "Tried to erase entry where id in table (" | ||
194 | // << iter->second << ") did not match object " << object.getID() << llendl; | ||
180 | } | 195 | } |
181 | return FALSE; | 196 | return FALSE; |
182 | } | 197 | } |
@@ -429,13 +444,27 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, | |||
429 | 444 | ||
430 | // This looks like it will break if the local_id of the object doesn't change | 445 | // This looks like it will break if the local_id of the object doesn't change |
431 | // upon boundary crossing, but we check for region id matching later... | 446 | // upon boundary crossing, but we check for region id matching later... |
432 | if (objectp && (objectp->mLocalID != local_id)) | 447 | // Reset object local id and region pointer if things have changed |
448 | if (objectp && | ||
449 | ((objectp->mLocalID != local_id) || | ||
450 | (objectp->getRegion() != regionp))) | ||
433 | { | 451 | { |
434 | removeFromLocalIDTable(*objectp); | 452 | removeFromLocalIDTable(*objectp); |
435 | setUUIDAndLocal(fullid, | 453 | setUUIDAndLocal(fullid, |
436 | local_id, | 454 | local_id, |
437 | gMessageSystem->getSenderIP(), | 455 | gMessageSystem->getSenderIP(), |
438 | gMessageSystem->getSenderPort()); | 456 | gMessageSystem->getSenderPort()); |
457 | |||
458 | if (objectp->mLocalID != local_id) | ||
459 | { // Update local ID in object with the one sent from the region | ||
460 | objectp->mLocalID = local_id; | ||
461 | } | ||
462 | |||
463 | if (objectp->getRegion() != regionp) | ||
464 | { // Object changed region, so update it | ||
465 | objectp->setRegion(regionp); | ||
466 | objectp->updateRegion(regionp); // for LLVOAvatar | ||
467 | } | ||
439 | } | 468 | } |
440 | 469 | ||
441 | if (!objectp) | 470 | if (!objectp) |
@@ -478,20 +507,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, | |||
478 | justCreated = TRUE; | 507 | justCreated = TRUE; |
479 | mNumNewObjects++; | 508 | mNumNewObjects++; |
480 | } | 509 | } |
481 | else | ||
482 | { | ||
483 | if (objectp->getRegion() != regionp) | ||
484 | { | ||
485 | // Object has changed region! Update lookup tables, set region pointer. | ||
486 | removeFromLocalIDTable(*objectp); | ||
487 | setUUIDAndLocal(fullid, | ||
488 | local_id, | ||
489 | gMessageSystem->getSenderIP(), | ||
490 | gMessageSystem->getSenderPort()); | ||
491 | objectp->setRegion(regionp); | ||
492 | } | ||
493 | objectp->updateRegion(regionp); // for LLVOAvatar | ||
494 | } | ||
495 | 510 | ||
496 | 511 | ||
497 | if (objectp->isDead()) | 512 | if (objectp->isDead()) |
@@ -837,10 +852,17 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep) | |||
837 | 852 | ||
838 | for (S32 i = 0; i < drawablep->getNumFaces(); i++) | 853 | for (S32 i = 0; i < drawablep->getNumFaces(); i++) |
839 | { | 854 | { |
840 | LLViewerObject* objectp = drawablep->getFace(i)->getViewerObject(); | 855 | LLFace* facep = drawablep->getFace(i) ; |
856 | if(facep) | ||
857 | { | ||
858 | LLViewerObject* objectp = facep->getViewerObject(); | ||
859 | if(objectp) | ||
860 | { | ||
841 | mSelectPickList.erase(objectp); | 861 | mSelectPickList.erase(objectp); |
842 | } | 862 | } |
843 | } | 863 | } |
864 | } | ||
865 | } | ||
844 | 866 | ||
845 | BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) | 867 | BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) |
846 | { | 868 | { |
@@ -876,10 +898,6 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp) | |||
876 | if (objectp->mRegionp == regionp) | 898 | if (objectp->mRegionp == regionp) |
877 | { | 899 | { |
878 | killObject(objectp); | 900 | killObject(objectp); |
879 | |||
880 | // invalidate region pointer. region will become invalid, but | ||
881 | // refcounted objects may survive the cleanDeadObjects() call below | ||
882 | objectp->mRegionp = NULL; | ||
883 | } | 901 | } |
884 | } | 902 | } |
885 | 903 | ||
@@ -917,7 +935,7 @@ void LLViewerObjectList::killAllObjects() | |||
917 | if (!mMapObjects.empty()) | 935 | if (!mMapObjects.empty()) |
918 | { | 936 | { |
919 | llwarns << "Some objects still on map object list!" << llendl; | 937 | llwarns << "Some objects still on map object list!" << llendl; |
920 | mActiveObjects.clear(); | 938 | mMapObjects.clear(); |
921 | } | 939 | } |
922 | } | 940 | } |
923 | 941 | ||