SL-17551 Followup -- remove some dead pick-render related code.

meow-7.2.2
Dave Parks 2022-06-09 14:26:23 -05:00
parent acf35c9b07
commit bc85cc300d
7 changed files with 6 additions and 242 deletions

View File

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

View File

@ -64,7 +64,6 @@ LLHUDIcon::icon_instance_t LLHUDIcon::sIconInstances;
LLHUDIcon::LLHUDIcon(const U8 type) :
LLHUDObject(type),
mImagep(NULL),
mPickID(0),
mScale(0.1f),
mHidden(FALSE)
{
@ -76,15 +75,11 @@ LLHUDIcon::~LLHUDIcon()
mImagep = NULL;
}
void LLHUDIcon::renderIcon(BOOL for_select)
void LLHUDIcon::render()
{
LLGLSUIDefault texture_state;
LLGLDepthTest gls_depth(GL_TRUE);
LLGLDisable gls_stencil(GL_STENCIL_TEST);
if (for_select)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
if (mHidden)
return;
@ -116,7 +111,7 @@ void LLHUDIcon::renderIcon(BOOL for_select)
mDistance = dist_vec(icon_position, camera->getOrigin());
F32 alpha_factor = for_select ? 1.f : clamp_rescale(mDistance, DIST_START_FADE, DIST_END_FADE, 1.f, 0.f);
F32 alpha_factor = clamp_rescale(mDistance, DIST_START_FADE, DIST_END_FADE, 1.f, 0.f);
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
@ -150,13 +145,6 @@ void LLHUDIcon::renderIcon(BOOL for_select)
LLVector3 upper_left = icon_position - (x_scale * 0.5f) + y_scale;
LLVector3 upper_right = icon_position + (x_scale * 0.5f) + y_scale;
if (for_select)
{
// set color to unique color id for picking
LLColor4U coloru((U8)(mPickID >> 16), (U8)(mPickID >> 8), (U8)mPickID);
gGL.color4ubv(coloru.mV);
}
else
{
LLColor4 icon_color = LLColor4::white;
icon_color.mV[VALPHA] = alpha_factor;
@ -198,11 +186,6 @@ void LLHUDIcon::markDead()
LLHUDObject::markDead();
}
void LLHUDIcon::render()
{
renderIcon(FALSE);
}
BOOL LLHUDIcon::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection)
{
if (mHidden)
@ -295,37 +278,6 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
return FALSE;
}
//static
S32 LLHUDIcon::generatePickIDs(S32 start_id, S32 step_size)
{
S32 cur_id = start_id;
icon_instance_t::iterator icon_it;
for(icon_it = sIconInstances.begin(); icon_it != sIconInstances.end(); ++icon_it)
{
(*icon_it)->mPickID = cur_id;
cur_id += step_size;
}
return cur_id;
}
//static
LLHUDIcon* LLHUDIcon::handlePick(S32 pick_id)
{
icon_instance_t::iterator icon_it;
for(icon_it = sIconInstances.begin(); icon_it != sIconInstances.end(); ++icon_it)
{
if (pick_id == (*icon_it)->mPickID)
{
return *icon_it;
}
}
return NULL;
}
//static
LLHUDIcon* LLHUDIcon::lineSegmentIntersectAll(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection)
{

View File

@ -56,8 +56,6 @@ public:
void restartLifeTimer() { mLifeTimer.reset(); }
static S32 generatePickIDs(S32 start_id, S32 step_size);
static LLHUDIcon* handlePick(S32 pick_id);
static LLHUDIcon* lineSegmentIntersectAll(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection);
static void updateAll();
@ -75,14 +73,11 @@ protected:
LLHUDIcon(const U8 type);
~LLHUDIcon();
void renderIcon(BOOL for_select); // common render code
private:
LLPointer<LLViewerTexture> mImagep;
LLFrameTimer mAnimTimer;
LLFrameTimer mLifeTimer;
F32 mDistance;
S32 mPickID;
F32 mScale;
BOOL mHidden;

View File

@ -259,7 +259,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mTEImages(NULL),
mTENormalMaps(NULL),
mTESpecularMaps(NULL),
mGLName(0),
mbCanSelect(TRUE),
mFlags(0),
mPhysicsShapeType(0),

View File

@ -676,9 +676,9 @@ public:
LLPointer<LLViewerTexture> *mTENormalMaps;
LLPointer<LLViewerTexture> *mTESpecularMaps;
// Selection, picking and rendering variables
U32 mGLName; // GL "name" used by selection code
BOOL mbCanSelect; // true if user can select this object by clicking under any circumstances (even if pick_unselectable is true)
// true if user can select this object by clicking under any circumstances (even if pick_unselectable is true)
// can likely be factored out
BOOL mbCanSelect;
private:
// Grabbed from UPDATE_FLAGS

View File

@ -1339,38 +1339,13 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
}
// Don't clean up mObject references, these will be cleaned up more efficiently later!
// Also, not cleaned up
removeDrawable(objectp->mDrawable);
if(new_dead_object)
{
mNumDeadObjects++;
}
}
void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
if (!drawablep)
{
return;
}
for (S32 i = 0; i < drawablep->getNumFaces(); i++)
{
LLFace* facep = drawablep->getFace(i) ;
if(facep)
{
LLViewerObject* objectp = facep->getViewerObject();
if(objectp)
{
mSelectPickList.erase(objectp);
}
}
}
}
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
// Don't ever kill gAgentAvatarp, just force it to the agent's region
@ -1836,152 +1811,6 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 &center)
{
}
void LLViewerObjectList::generatePickList(LLCamera &camera)
{
llassert(false);
#if 0 //deprecated
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
LLViewerObject *objectp;
S32 i;
// Reset all of the GL names to zero.
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
(*iter)->mGLName = 0;
}
mSelectPickList.clear();
std::vector<LLDrawable*> pick_drawables;
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
{
part->cull(camera, &pick_drawables, TRUE);
}
}
}
for (std::vector<LLDrawable*>::iterator iter = pick_drawables.begin();
iter != pick_drawables.end(); iter++)
{
LLDrawable* drawablep = *iter;
if( !drawablep )
continue;
LLViewerObject* last_objectp = NULL;
for (S32 face_num = 0; face_num < drawablep->getNumFaces(); face_num++)
{
LLFace * facep = drawablep->getFace(face_num);
if (!facep) continue;
LLViewerObject* objectp = facep->getViewerObject();
if (objectp && objectp != last_objectp)
{
mSelectPickList.insert(objectp);
last_objectp = objectp;
}
}
}
LLHUDNameTag::addPickable(mSelectPickList);
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
objectp = (LLVOAvatar*) *iter;
if (!objectp->isDead())
{
if (objectp->mDrawable.notNull() && objectp->mDrawable->isVisible())
{
mSelectPickList.insert(objectp);
}
}
}
// add all hud objects to pick list
if (isAgentAvatarValid())
{
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
if (attachment->getIsHUDAttachment())
{
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
if (LLViewerObject* attached_object = attachment_iter->get())
{
mSelectPickList.insert(attached_object);
LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); iter++)
{
LLViewerObject* childp = *iter;
if (childp)
{
mSelectPickList.insert(childp);
}
}
}
}
}
}
}
S32 num_pickables = (S32)mSelectPickList.size() + LLHUDIcon::getNumInstances();
if (num_pickables != 0)
{
S32 step = (0x000fffff - GL_NAME_INDEX_OFFSET) / num_pickables;
std::set<LLViewerObject*>::iterator pick_it;
i = 0;
for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end();)
{
LLViewerObject* objp = (*pick_it);
if (!objp || objp->isDead() || !objp->mbCanSelect)
{
mSelectPickList.erase(pick_it++);
continue;
}
objp->mGLName = (i * step) + GL_NAME_INDEX_OFFSET;
i++;
++pick_it;
}
LLHUDIcon::generatePickIDs(i * step, step);
}
#endif
}
LLViewerObject *LLViewerObjectList::getSelectedObject(const U32 object_id)
{
llassert(false);
#if 0
std::set<LLViewerObject*>::iterator pick_it;
for (pick_it = mSelectPickList.begin(); pick_it != mSelectPickList.end(); ++pick_it)
{
if ((*pick_it)->mGLName == object_id)
{
return (*pick_it);
}
}
#endif
return NULL;
}
void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent,
const std::string &string,
const LLColor4 &color,

View File

@ -77,7 +77,6 @@ public:
BOOL killObject(LLViewerObject *objectp);
void killObjects(LLViewerRegion *regionp); // Kill all objects owned by a particular region.
void killAllObjects();
void removeDrawable(LLDrawable* drawablep);
void cleanDeadObjects(const BOOL use_timer = TRUE); // Clean up the dead object list.
@ -129,11 +128,6 @@ public:
void updateAvatarVisibility();
// Selection related stuff
void generatePickList(LLCamera &camera);
LLViewerObject *getSelectedObject(const U32 object_id);
inline S32 getNumObjects() { return (S32) mObjects.size(); }
inline S32 getNumActiveObjects() { return (S32) mActiveObjects.size(); }
@ -226,8 +220,6 @@ protected:
static std::map<U64, LLUUID> sIndexAndLocalIDToUUID;
std::set<LLViewerObject *> mSelectPickList;
friend class LLViewerObject;
private: