reapply c77cea5c6e41: MAINT-646 Cleanup some warnings from previous changes.

meow-7.2.2
Dave Parks 2012-09-20 10:00:56 -04:00
parent 683c43c2e0
commit b5e71964e5
5 changed files with 53 additions and 17 deletions

View File

@ -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);
}
}
}
}

View File

@ -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

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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))
{