AlchSync: Change dynamic_casts to LLVOVolume to asVolume()
This commit is contained in:
@@ -478,7 +478,7 @@ void LLControlAvatar::getAnimatedVolumes(std::vector<LLVOVolume*>& volumes)
|
||||
for (const auto& iter : child_list)
|
||||
{
|
||||
LLViewerObject* childp = iter;
|
||||
LLVOVolume *child_volp = dynamic_cast<LLVOVolume*>(childp);
|
||||
LLVOVolume *child_volp = childp ? childp->asVolume() : nullptr;
|
||||
if (child_volp && child_volp->isAnimatedObject())
|
||||
{
|
||||
volumes.push_back(child_volp);
|
||||
|
||||
@@ -1383,8 +1383,8 @@ void LLFloaterTools::getMediaState()
|
||||
for ( ; iter != end; ++iter)
|
||||
{
|
||||
LLSelectNode* node = *iter;
|
||||
LLVOVolume* object = dynamic_cast<LLVOVolume*>(node->getObject());
|
||||
if (NULL != object)
|
||||
LLVOVolume* object = node ? node->getObject()->asVolume() : nullptr;
|
||||
if (nullptr != object)
|
||||
{
|
||||
if (!object->permModify())
|
||||
{
|
||||
|
||||
@@ -320,7 +320,7 @@ void LLPanelPrimMediaControls::updateShape()
|
||||
{
|
||||
bool mini_controls = false;
|
||||
LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData();
|
||||
LLVOVolume *vol = dynamic_cast<LLVOVolume*>(objectp);
|
||||
LLVOVolume *vol = objectp ? objectp->asVolume() : nullptr;
|
||||
if (media_data && vol)
|
||||
{
|
||||
// Don't show the media controls if we do not have permissions
|
||||
|
||||
@@ -1998,7 +1998,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
|
||||
else {
|
||||
// Add/update media
|
||||
object->setTEMediaFlags(te, mMediaFlags);
|
||||
LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);
|
||||
LLVOVolume *vo = object->asVolume();
|
||||
llassert(NULL != vo);
|
||||
if (NULL != vo)
|
||||
{
|
||||
@@ -2024,7 +2024,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
|
||||
if (object->permModify())
|
||||
{
|
||||
object->sendTEUpdate();
|
||||
LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);
|
||||
LLVOVolume *vo = object->asVolume();
|
||||
llassert(NULL != vo);
|
||||
// It's okay to skip this object if hasMedia() is false...
|
||||
// the sendTEUpdate() above would remove all media data if it were
|
||||
@@ -7434,7 +7434,7 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
|
||||
++child_iter)
|
||||
{
|
||||
LLViewerObject* child_obj = *child_iter;
|
||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
||||
LLVOVolume *child = child_obj ? child_obj->asVolume() : nullptr;
|
||||
if (child)
|
||||
{
|
||||
cost += child->getRenderCost(textures);
|
||||
|
||||
@@ -1787,7 +1787,7 @@ void renderComplexityDisplay(LLDrawable* drawablep)
|
||||
return;
|
||||
}
|
||||
|
||||
LLVOVolume *voVol = dynamic_cast<LLVOVolume*>(vobj);
|
||||
LLVOVolume *voVol = vobj->asVolume();;
|
||||
|
||||
if (!voVol)
|
||||
{
|
||||
|
||||
@@ -5953,7 +5953,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data)
|
||||
return;
|
||||
}
|
||||
|
||||
LLVOVolume *volp = dynamic_cast<LLVOVolume*>(objp);
|
||||
LLVOVolume *volp = objp->asVolume();
|
||||
if (!volp)
|
||||
{
|
||||
LL_DEBUGS("AnimatedObjectsNotify") << "Received animation state for non-volume object " << uuid << LL_ENDL;
|
||||
|
||||
@@ -3091,7 +3091,7 @@ void LLViewerObject::linkControlAvatar()
|
||||
{
|
||||
if (!getControlAvatar() && isRootEdit())
|
||||
{
|
||||
LLVOVolume *volp = dynamic_cast<LLVOVolume*>(this);
|
||||
LLVOVolume *volp = asVolume();
|
||||
if (!volp)
|
||||
{
|
||||
LL_WARNS() << "called with null or non-volume object" << LL_ENDL;
|
||||
@@ -5583,6 +5583,12 @@ LLVOAvatar* LLViewerObject::asAvatar()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// virtual
|
||||
LLVOVolume* LLViewerObject::asVolume()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// If this object is directly or indirectly parented by an avatar,
|
||||
// return it. Normally getAvatar() is the correct function to call;
|
||||
// it will give the avatar used for skinning. The exception is with
|
||||
|
||||
@@ -69,6 +69,7 @@ class LLPrimitive;
|
||||
class LLTextureEntry;
|
||||
class LLVOAvatar;
|
||||
class LLVOInventoryListener;
|
||||
class LLVOVolume;
|
||||
class LLViewerInventoryItem;
|
||||
class LLViewerObject;
|
||||
class LLViewerObjectMedia;
|
||||
@@ -157,6 +158,7 @@ public:
|
||||
BOOL isParticleSource() const;
|
||||
|
||||
virtual LLVOAvatar* asAvatar();
|
||||
virtual LLVOVolume* asVolume();
|
||||
|
||||
LLVOAvatar* getAvatarAncestor();
|
||||
|
||||
|
||||
@@ -1116,7 +1116,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
|
||||
|
||||
LL_DEBUGS() << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << LL_ENDL;
|
||||
|
||||
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
|
||||
LLViewerObject* vobjp = static_cast<LLViewerObject*>(pick_info.getObject());
|
||||
LLVOVolume *obj = vobjp ? vobjp->asVolume() : nullptr;
|
||||
|
||||
if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty())
|
||||
{
|
||||
|
||||
@@ -6923,7 +6923,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, uuid_set_t*
|
||||
}
|
||||
}
|
||||
|
||||
LLVOVolume *vobj = dynamic_cast<LLVOVolume*>(vo);
|
||||
LLVOVolume *vobj = vo->asVolume();
|
||||
if (vobj && vobj->isRiggedMesh() &&
|
||||
vobj->getVolume() && vobj->getVolume()->isMeshAssetLoaded() && gMeshRepo.meshRezEnabled())
|
||||
{
|
||||
@@ -10567,7 +10567,7 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
||||
{{
|
||||
LLViewerObject* attached_object = iter.first;
|
||||
#endif
|
||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(attached_object);
|
||||
LLVOVolume *volume = attached_object->asVolume();
|
||||
if (volume)
|
||||
{
|
||||
volumes.push_back(volume);
|
||||
@@ -10580,11 +10580,12 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
||||
}
|
||||
}
|
||||
LLViewerObject::const_child_list_t& children = attached_object->getChildren();
|
||||
for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
|
||||
it != children.end(); ++it)
|
||||
for (LLViewerObject* childp : children)
|
||||
{
|
||||
LLViewerObject *childp = *it;
|
||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(childp);
|
||||
if (!childp)
|
||||
continue;
|
||||
|
||||
LLVOVolume *volume = childp->asVolume();
|
||||
if (volume)
|
||||
{
|
||||
volumes.push_back(volume);
|
||||
@@ -10601,11 +10602,9 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
|
||||
{
|
||||
volumes.push_back(volp);
|
||||
LLViewerObject::const_child_list_t& children = volp->getChildren();
|
||||
for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
|
||||
it != children.end(); ++it)
|
||||
for (LLViewerObject* childp : children)
|
||||
{
|
||||
LLViewerObject *childp = *it;
|
||||
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(childp);
|
||||
LLVOVolume *volume = childp ? childp->asVolume() : nullptr;
|
||||
if (volume)
|
||||
{
|
||||
volumes.push_back(volume);
|
||||
@@ -10950,7 +10949,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
|
||||
++child_iter)
|
||||
{
|
||||
LLViewerObject* child_obj = *child_iter;
|
||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>(child_obj);
|
||||
LLVOVolume *child = child_obj ? child_obj->asVolume() : nullptr;
|
||||
if (child)
|
||||
{
|
||||
attachment_children_cost += child->getRenderCost(textures);
|
||||
@@ -11007,7 +11006,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
|
||||
iter != child_list.end(); ++iter)
|
||||
{
|
||||
LLViewerObject* childp = *iter;
|
||||
const LLVOVolume* chld_volume = dynamic_cast<LLVOVolume*>(childp);
|
||||
const LLVOVolume* chld_volume = childp ? childp->asVolume() : nullptr;
|
||||
if (chld_volume)
|
||||
{
|
||||
// get cost and individual textures
|
||||
|
||||
@@ -265,6 +265,11 @@ LLVOVolume::~LLVOVolume()
|
||||
}
|
||||
}
|
||||
|
||||
LLVOVolume* LLVOVolume::asVolume()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void LLVOVolume::markDead()
|
||||
{
|
||||
if (!mDead)
|
||||
@@ -3496,8 +3501,6 @@ bool LLVOVolume::isAnimatedObject() const
|
||||
// virtual
|
||||
void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_parent)
|
||||
{
|
||||
LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent);
|
||||
|
||||
if (new_parent && !new_parent->isAvatar())
|
||||
{
|
||||
if (mControlAvatar.notNull())
|
||||
@@ -3509,6 +3512,7 @@ void LLVOVolume::onReparent(LLViewerObject *old_parent, LLViewerObject *new_pare
|
||||
av->markForDeath();
|
||||
}
|
||||
}
|
||||
LLVOVolume *old_volp = old_parent ? old_parent->asVolume() : nullptr;
|
||||
if (old_volp && old_volp->isAnimatedObject())
|
||||
{
|
||||
if (old_volp->getControlAvatar())
|
||||
@@ -5247,7 +5251,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
||||
if (bridge)
|
||||
{
|
||||
vobj = bridge->mDrawable->getVObj();
|
||||
vol_obj = dynamic_cast<LLVOVolume*>(vobj);
|
||||
vol_obj = vobj ? vobj->asVolume() : nullptr;
|
||||
}
|
||||
if (vol_obj)
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
};
|
||||
|
||||
// Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME)
|
||||
class LLVOVolume : public LLViewerObject
|
||||
class LLVOVolume final : public LLViewerObject
|
||||
{
|
||||
LOG_CLASS(LLVOVolume);
|
||||
protected:
|
||||
@@ -126,7 +126,9 @@ public:
|
||||
|
||||
public:
|
||||
LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
|
||||
/*virtual*/ void markDead(); // Override (and call through to parent) to clean up media references
|
||||
|
||||
LLVOVolume* asVolume() final;
|
||||
/*virtual*/ void markDead() override; // Override (and call through to parent) to clean up media references
|
||||
|
||||
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user