Fixed some 'RenderDelayCreation' related crashes
This commit is contained in:
@@ -405,7 +405,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj,
|
||||
}
|
||||
|
||||
// Collect all of the objects
|
||||
LLDynamicArray<LLViewerObject*> objects;
|
||||
std::vector<LLViewerObject*> objects;
|
||||
|
||||
root->addThisAndNonJointChildren(objects);
|
||||
addAsFamily(objects, add_to_end);
|
||||
@@ -451,7 +451,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLV
|
||||
BOOL send_to_sim)
|
||||
{
|
||||
// Collect all of the objects, children included
|
||||
LLDynamicArray<LLViewerObject*> objects;
|
||||
std::vector<LLViewerObject*> objects;
|
||||
|
||||
//clear primary object (no primary object)
|
||||
mSelectedObjects->mPrimaryObject = NULL;
|
||||
@@ -575,7 +575,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s
|
||||
if(!object->isSelected()) return;
|
||||
|
||||
// Collect all of the objects, and remove them
|
||||
LLDynamicArray<LLViewerObject*> objects;
|
||||
std::vector<LLViewerObject*> objects;
|
||||
|
||||
if (include_entire_object)
|
||||
{
|
||||
@@ -821,7 +821,7 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32
|
||||
{
|
||||
|
||||
// Collect all of the objects
|
||||
LLDynamicArray<LLViewerObject*> objects;
|
||||
std::vector<LLViewerObject*> objects;
|
||||
objectp = objectp->getRootEdit();
|
||||
objectp->addThisAndNonJointChildren(objects);
|
||||
|
||||
@@ -1310,7 +1310,7 @@ void LLSelectMgr::promoteSelectionToRoot()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLSelectMgr::demoteSelectionToIndividuals()
|
||||
{
|
||||
LLDynamicArray<LLViewerObject*> objects;
|
||||
std::vector<LLViewerObject*> objects;
|
||||
|
||||
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
|
||||
iter != getSelection()->root_end(); iter++)
|
||||
@@ -1319,7 +1319,7 @@ void LLSelectMgr::demoteSelectionToIndividuals()
|
||||
object->addThisAndNonJointChildren(objects);
|
||||
}
|
||||
|
||||
if (objects.getLength())
|
||||
if (!objects.empty())
|
||||
{
|
||||
deselectAll();
|
||||
for (std::vector<LLViewerObject*>::iterator iter = objects.begin();
|
||||
@@ -3602,7 +3602,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point)
|
||||
{
|
||||
LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject();
|
||||
|
||||
if (!attach_object || !gAgent.getAvatarObject() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD)
|
||||
if (!attach_object || !isAgentAvatarValid() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4886,7 +4886,7 @@ void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handl
|
||||
generateSilhouette(node, LLViewerCamera::getInstance()->getOrigin());
|
||||
changed_objects.push_back(objectp);
|
||||
}
|
||||
else if (objectp->isAttachment())
|
||||
else if (objectp->isAttachment() && objectp->getRootEdit() && objectp->getRootEdit()->mDrawable.notNull())
|
||||
{
|
||||
//RN: hack for orthogonal projection of HUD attachments
|
||||
LLViewerJointAttachment* attachment_pt = (LLViewerJointAttachment*)objectp->getRootEdit()->mDrawable->getParent();
|
||||
@@ -4914,9 +4914,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
|
||||
LLGLEnable blend(GL_BLEND);
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
LLVOAvatar* avatar = gAgent.getAvatarObject();
|
||||
if (for_hud && avatar)
|
||||
if (isAgentAvatarValid() && for_hud)
|
||||
{
|
||||
LLVOAvatar* avatar = gAgent.getAvatarObject();
|
||||
LLBBox hud_bbox = avatar->getHUDBBox();
|
||||
|
||||
F32 cur_zoom = gAgent.mHUDCurZoom;
|
||||
@@ -5010,7 +5010,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
|
||||
}
|
||||
}
|
||||
|
||||
if (for_hud && avatar)
|
||||
if (isAgentAvatarValid() && for_hud)
|
||||
{
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
@@ -5372,7 +5372,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
|
||||
if (volume)
|
||||
{
|
||||
F32 silhouette_thickness;
|
||||
if (is_hud_object && gAgent.getAvatarObject())
|
||||
if (isAgentAvatarValid() && is_hud_object)
|
||||
{
|
||||
silhouette_thickness = LLSelectMgr::sHighlightThickness / gAgent.mHUDCurZoom;
|
||||
}
|
||||
@@ -5567,7 +5567,7 @@ void LLSelectMgr::updateSelectionCenter()
|
||||
{
|
||||
mSelectedObjects->mSelectType = getSelectTypeForObject(object);
|
||||
|
||||
if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && gAgent.getAvatarObject())
|
||||
if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && isAgentAvatarValid())
|
||||
{
|
||||
mPauseRequest = gAgent.getAvatarObject()->requestPause();
|
||||
}
|
||||
@@ -5576,7 +5576,7 @@ void LLSelectMgr::updateSelectionCenter()
|
||||
mPauseRequest = NULL;
|
||||
}
|
||||
|
||||
if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && gAgent.getAvatarObject())
|
||||
if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && isAgentAvatarValid())
|
||||
{
|
||||
// reset hud ZOOM
|
||||
gAgent.mHUDTargetZoom = 1.f;
|
||||
|
||||
@@ -578,11 +578,11 @@ void LLViewerObject::removeChild(LLViewerObject *childp)
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerObject::addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects)
|
||||
void LLViewerObject::addThisAndAllChildren(std::vector<LLViewerObject*>& objects)
|
||||
{
|
||||
objects.put(this);
|
||||
objects.push_back(this);
|
||||
for (child_list_t::iterator iter = mChildList.begin();
|
||||
iter != mChildList.end(); iter++)
|
||||
iter != mChildList.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* child = *iter;
|
||||
if (!child->isAvatar())
|
||||
@@ -592,16 +592,16 @@ void LLViewerObject::addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& obje
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerObject::addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects)
|
||||
void LLViewerObject::addThisAndNonJointChildren(std::vector<LLViewerObject*>& objects)
|
||||
{
|
||||
objects.put(this);
|
||||
objects.push_back(this);
|
||||
// don't add any attachments when temporarily selecting avatar
|
||||
if (isAvatar())
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (child_list_t::iterator iter = mChildList.begin();
|
||||
iter != mChildList.end(); iter++)
|
||||
iter != mChildList.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* child = *iter;
|
||||
if ( (!child->isAvatar()) && (!child->isJointChild()))
|
||||
@@ -614,7 +614,7 @@ void LLViewerObject::addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>&
|
||||
BOOL LLViewerObject::isChild(LLViewerObject *childp) const
|
||||
{
|
||||
for (child_list_t::const_iterator iter = mChildList.begin();
|
||||
iter != mChildList.end(); iter++)
|
||||
iter != mChildList.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* testchild = *iter;
|
||||
if (testchild == childp)
|
||||
@@ -628,7 +628,7 @@ BOOL LLViewerObject::isChild(LLViewerObject *childp) const
|
||||
BOOL LLViewerObject::isSeat() const
|
||||
{
|
||||
for (child_list_t::const_iterator iter = mChildList.begin();
|
||||
iter != mChildList.end(); iter++)
|
||||
iter != mChildList.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* child = *iter;
|
||||
if (child->isAvatar())
|
||||
@@ -2914,7 +2914,8 @@ void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
|
||||
LLVector3 size = getScale();
|
||||
newMin.setVec(center-size);
|
||||
newMax.setVec(center+size);
|
||||
mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
|
||||
if(mDrawable.notNull())
|
||||
mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
|
||||
}
|
||||
|
||||
F32 LLViewerObject::getBinRadius()
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <map>
|
||||
|
||||
#include "llassetstorage.h"
|
||||
#include "lldarrayptr.h"
|
||||
#include "llhudtext.h"
|
||||
#include "llhudicon.h"
|
||||
#include "llinventory.h"
|
||||
@@ -243,8 +242,8 @@ public:
|
||||
virtual void removeChild(LLViewerObject *childp);
|
||||
const_child_list_t& getChildren() const { return mChildList; }
|
||||
S32 numChildren() const { return mChildList.size(); }
|
||||
void addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects);
|
||||
void addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects);
|
||||
void addThisAndAllChildren(std::vector<LLViewerObject*>& objects);
|
||||
void addThisAndNonJointChildren(std::vector<LLViewerObject*>& objects);
|
||||
BOOL isChild(LLViewerObject *childp) const;
|
||||
BOOL isSeat() const;
|
||||
|
||||
|
||||
@@ -1585,7 +1585,7 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
|
||||
{
|
||||
return getPositionAgent();
|
||||
}
|
||||
else if (isRoot())
|
||||
else if (isRoot() || !mDrawable->getParent())
|
||||
{
|
||||
return mDrawable->getPositionAgent();
|
||||
}
|
||||
@@ -3029,7 +3029,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
|
||||
mDrawable->movePartition();
|
||||
|
||||
//force a move if sitting on an active object
|
||||
if (getParent() && ((LLViewerObject*) getParent())->mDrawable->isActive())
|
||||
if (getParent() && ((LLViewerObject*)getParent())->mDrawable.notNull() && ((LLViewerObject*) getParent())->mDrawable->isActive())
|
||||
{
|
||||
gPipeline.markMoved(mDrawable, TRUE);
|
||||
}
|
||||
@@ -7358,7 +7358,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLVOAvatar::sitOnObject(LLViewerObject *sit_object)
|
||||
{
|
||||
if (!mDrawable || mDrawable.isNull())
|
||||
if (!mDrawable || mDrawable.isNull() || sit_object->mDrawable.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ void LLVOVolume::updateTextureVirtualSize()
|
||||
{
|
||||
// Update the pixel area of all faces
|
||||
|
||||
if(!isVisible())
|
||||
if(!isVisible() || mDrawable.isNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1037,13 +1037,14 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable)
|
||||
|
||||
U32 LLPipeline::addObject(LLViewerObject *vobj)
|
||||
{
|
||||
llassert_always(vobj);
|
||||
if (gNoRender)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const LLCachedControl<bool> render_delay_creation("RenderDelayCreation",false);
|
||||
if (render_delay_creation)
|
||||
if (!vobj->isAvatar() && render_delay_creation)
|
||||
{
|
||||
mCreateQ.push_back(vobj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user