summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-09-20 10:00:56 -0400
committerDave Parks <davep@lindenlab.com>2012-09-20 10:00:56 -0400
commitb5e71964e5f2b6cfa792cc30f7f694ee7096c828 (patch)
treeb37a27f81f45d8e19556c4c39246bcd19f5aea72 /indra/newview
parent683c43c2e0f6e4d34592528c219f34f638059223 (diff)
reapply c77cea5c6e41: MAINT-646 Cleanup some warnings from previous changes.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawable.cpp23
-rw-r--r--indra/newview/lldrawable.h2
-rwxr-xr-xindra/newview/llface.cpp22
-rw-r--r--indra/newview/llspatialpartition.cpp6
-rw-r--r--indra/newview/llvovolume.cpp17
5 files changed, 53 insertions, 17 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 25603ccdcf..89a2e9f407 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -957,6 +957,12 @@ void LLDrawable::updateUVMinMax()
{
}
+LLSpatialGroup* LLDrawable::getSpatialGroup() const
+{
+ llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
+ return mSpatialGroupp;
+}
+
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
{
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
@@ -979,6 +985,8 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
}
mSpatialGroupp = groupp;
+
+ llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
}
LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1489,7 +1497,13 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
- mDrawable->setSpatialGroup(NULL);
+ LLSpatialGroup* group = mDrawable->getSpatialGroup();
+ if (group)
+ {
+ group->mOctreeNode->remove(mDrawable);
+ mDrawable->setSpatialGroup(NULL);
+ }
+
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1500,7 +1514,12 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
- drawable->setSpatialGroup(NULL);
+ LLSpatialGroup* group = drawable->getSpatialGroup();
+ if (group)
+ {
+ group->mOctreeNode->remove(drawable);
+ drawable->setSpatialGroup(NULL);
+ }
}
}
}
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index 08511bb9fc..960c64fa9e 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -208,7 +208,7 @@ public:
S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators...
void setSpatialGroup(LLSpatialGroup *groupp);
- LLSpatialGroup *getSpatialGroup() const { return mSpatialGroupp; }
+ LLSpatialGroup *getSpatialGroup() const;
LLSpatialPartition* getSpatialPartition();
// Statics
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index eea5161538..2074cb6514 100755
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -1202,19 +1202,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
{
- llwarns << "Index buffer overflow!" << llendl;
- llwarns << "Indices Count: " << mIndicesCount
- << " VF Num Indices: " << num_indices
- << " Indices Index: " << mIndicesIndex
- << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
- llwarns << " Face Index: " << f
- << " Pool Type: " << mPoolType << llendl;
+ if (gDebugGL)
+ {
+ llwarns << "Index buffer overflow!" << llendl;
+ llwarns << "Indices Count: " << mIndicesCount
+ << " VF Num Indices: " << num_indices
+ << " Indices Index: " << mIndicesIndex
+ << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
+ llwarns << " Face Index: " << f
+ << " Pool Type: " << mPoolType << llendl;
+ }
return FALSE;
}
if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
{
- llwarns << "Vertex buffer overflow!" << llendl;
+ if (gDebugGL)
+ {
+ llwarns << "Vertex buffer overflow!" << llendl;
+ }
return FALSE;
}
}
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index d4a3e9d8f5..78c905f6ff 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1850,12 +1850,14 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
{
LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION);
- drawablep->setSpatialGroup(NULL);
-
if (!curp->removeObject(drawablep))
{
OCT_ERRS << "Failed to remove drawable from octree!" << llendl;
}
+ else
+ {
+ drawablep->setSpatialGroup(NULL);
+ }
assert_octree_valid(mOctree);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f4cde65cdf..0a5c8b5139 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4721,8 +4721,14 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
if (buff)
{
llassert(!face->isState(LLFace::RIGGED));
- face->getGeometryVolume(*volume, face->getTEOffset(),
- vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
+
+ if (!face->getGeometryVolume(*volume, face->getTEOffset(),
+ vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()))
+ { //something's gone wrong with the vertex buffer accounting, rebuild this group
+ group->dirtyGeom();
+ gPipeline.markRebuild(group, TRUE);
+ }
+
if (buff->isLocked())
{
@@ -5056,8 +5062,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
llassert(!facep->isState(LLFace::RIGGED));
- facep->getGeometryVolume(*volume, te_idx,
- vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset,true);
+ if (!facep->getGeometryVolume(*volume, te_idx,
+ vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset,true))
+ {
+ llwarns << "Failed to get geometry for face!" << llendl;
+ }
if (drawablep->isState(LLDrawable::ANIMATED_CHILD))
{