summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp54
1 files changed, 22 insertions, 32 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index bb4174d3b6..ac80f1f73b 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -149,7 +149,7 @@ void LLDrawable::unload()
{
LLVOVolume *pVVol = getVOVolume();
pVVol->setNoLOD();
- pVVol->markForUpdate(TRUE);
+ pVVol->markForUpdate();
}
// static
@@ -249,12 +249,9 @@ void LLDrawable::cleanupReferences()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
-
std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
mFaces.clear();
- gObjectList.removeDrawable(this);
-
gPipeline.unlinkDrawable(this);
removeFromOctree();
@@ -502,7 +499,6 @@ void LLDrawable::makeActive()
pcode == LLViewerObject::LL_VO_SURFACE_PATCH ||
pcode == LLViewerObject::LL_VO_PART_GROUP ||
pcode == LLViewerObject::LL_VO_HUD_PART_GROUP ||
- pcode == LLViewerObject::LL_VO_GROUND ||
pcode == LLViewerObject::LL_VO_SKY)
{
LL_ERRS() << "Static viewer object has active drawable!" << LL_ENDL;
@@ -539,7 +535,7 @@ void LLDrawable::makeActive()
if (mVObjp->getPCode() == LL_PCODE_VOLUME)
{
- gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME);
}
updatePartition();
}
@@ -587,7 +583,7 @@ void LLDrawable::makeStatic(BOOL warning_enabled)
if (mVObjp->getPCode() == LL_PCODE_VOLUME)
{
- gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME);
}
if (mSpatialBridge)
@@ -663,7 +659,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
if (getVOVolume() && !isRoot())
{ //child prim snapping to some position, needs a rebuild
- gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION);
}
}
}
@@ -687,7 +683,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
{ //scale change requires immediate rebuild
- gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION);
}
else if (!isRoot() &&
(!mVObjp->getAngularVelocity().isExactlyZero() ||
@@ -697,7 +693,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
if (!isState(LLDrawable::ANIMATED_CHILD))
{
setState(LLDrawable::ANIMATED_CHILD);
- gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL);
mVObjp->dirtySpatialGroup();
}
}
@@ -705,7 +701,8 @@ F32 LLDrawable::updateXform(BOOL undamped)
((dist_vec_squared(old_pos, target_pos) > 0.f)
|| (1.f - dot(old_rot, target_rot)) > 0.f))
{ //fix for BUG-840, MAINT-2275, MAINT-1742, MAINT-2247
- gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
+ mVObjp->shrinkWrap();
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION);
}
else if (!getVOVolume() && !isAvatar())
{
@@ -829,7 +826,7 @@ void LLDrawable::updatePartition()
else
{
//a child prim moved and needs its verts regenerated
- gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION);
}
}
@@ -898,7 +895,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
LLFace* facep = getFace(i);
if (facep &&
- (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA))
+ (force_update || facep->isInAlphaPool()))
{
LLVector4a box;
box.setSub(facep->mExtents[1], facep->mExtents[0]);
@@ -924,12 +921,6 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
LLVector3 cam_pos_from_agent = LLViewerCamera::getInstance()->getOrigin();
LLVector3 cam_to_box_offset = point_to_box_offset(cam_pos_from_agent, av_box);
mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f));
- LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname()
- << " pos (ignored) " << pos
- << " cam pos " << cam_pos_from_agent
- << " box " << av_box[0] << "," << av_box[1]
- << " -> dist " << mDistanceWRTCamera
- << LL_ENDL;
mVObjp->updateLOD();
return;
}
@@ -960,11 +951,11 @@ void LLDrawable::updateTexture()
if (getVOVolume())
{
- gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_MATERIAL);
}
}
-BOOL LLDrawable::updateGeometry(BOOL priority)
+BOOL LLDrawable::updateGeometry()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE
@@ -999,12 +990,11 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
bool rebuild = (!volume &&
getRenderType() != LLPipeline::RENDER_TYPE_TREE &&
getRenderType() != LLPipeline::RENDER_TYPE_TERRAIN &&
- getRenderType() != LLPipeline::RENDER_TYPE_SKY &&
- getRenderType() != LLPipeline::RENDER_TYPE_GROUND);
+ getRenderType() != LLPipeline::RENDER_TYPE_SKY);
if (rebuild)
{
- gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
+ gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL);
}
for (S32 i = 0; i < getNumFaces(); i++)
@@ -1111,11 +1101,11 @@ void LLDrawable::updateUVMinMax()
bool LLDrawable::isVisible() const
{
if (LLViewerOctreeEntryData::isVisible())
-{
- return true;
-}
+ {
+ return true;
+ }
-{
+ {
LLViewerOctreeGroup* group = mEntry->getGroup();
if (group && group->isVisible())
{
@@ -1269,10 +1259,10 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask, LLViewerRegion* regionp) :
LLDrawable(root->getVObj(), true),
- LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB, regionp)
+ LLSpatialPartition(data_mask, render_by_group, regionp)
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE
-
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
+ mOcclusionEnabled = false;
mBridge = this;
mDrawable = root;
root->setSpatialBridge(this);
@@ -1775,7 +1765,7 @@ LLDrawable* LLDrawable::getRoot()
}
LLBridgePartition::LLBridgePartition(LLViewerRegion* regionp)
-: LLSpatialPartition(0, FALSE, 0, regionp)
+: LLSpatialPartition(0, false, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_VOLUME;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;