summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-10-10 21:40:10 -0400
committerOz Linden <oz@lindenlab.com>2012-10-10 21:40:10 -0400
commit1709952adbb3ad3ba4eb7d5be39c0c67c389c7c5 (patch)
treead71b6021639d4d9d89c9992aff13f000dd0248f /indra/newview/lldrawable.cpp
parentcb5a0a5686799ec834f16a0bc273d24f62140753 (diff)
parent3f45fa719e4c72e528801d4d8330a114e5458f30 (diff)
pull back 3.4.1-beta6 fixes
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 4eda2b92b3..954fd429a5 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -951,6 +951,12 @@ LLSpatialGroup* LLDrawable::getSpatialGroup() const
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
{
+ //precondition: mSpatialGroupp MUST be null or DEAD or mSpatialGroupp MUST NOT contain this
+ llassert(!mSpatialGroupp || mSpatialGroupp->isDead() || !mSpatialGroupp->hasElement(this));
+
+ //precondition: groupp MUST be null or groupp MUST contain this
+ llassert(!groupp || groupp->hasElement(this));
+
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
{
mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
@@ -970,9 +976,12 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
}
}
- mSpatialGroupp = groupp;
+ //postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1
+ //postcondition: if next group is NOT NULL, binIndex must not be -1
+ llassert(groupp == NULL ? (mSpatialGroupp == NULL || mSpatialGroupp->isDead()) || getBinIndex() == -1 :
+ getBinIndex() != -1);
- llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
+ mSpatialGroupp = groupp;
}
LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1400,7 +1409,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
markDead();
return;
}
-
+
if (gShiftFrame)
{
return;
@@ -1483,13 +1492,11 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
- LLSpatialGroup* group = mDrawable->getSpatialGroup();
- if (group)
- {
- group->mOctreeNode->remove(mDrawable);
- mDrawable->setSpatialGroup(NULL);
- }
+ /*
+ DON'T DO THIS -- this should happen through octree destruction
+
+ mDrawable->setSpatialGroup(NULL);
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1500,15 +1507,10 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
- LLSpatialGroup* group = drawable->getSpatialGroup();
- if (group)
- {
- group->mOctreeNode->remove(drawable);
- drawable->setSpatialGroup(NULL);
- }
+ drawable->setSpatialGroup(NULL);
}
}
- }
+ }*/
LLDrawable* drawablep = mDrawable;
mDrawable = NULL;