SL-14529 Replace dynamic_cast to LLAvatarJoint with static casts

Replaced couple (LLAvatarJoint*) for consistency
meow-7.2.2
Andrey Kleshchev 2021-01-04 16:33:50 +02:00
parent 6e76e20faa
commit 9962df9fb7
2 changed files with 7 additions and 5 deletions

View File

@ -103,7 +103,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive )
for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->setValid(valid, TRUE);
}
}
@ -136,7 +136,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive)
for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = (LLAvatarJoint*)(*iter);
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->setVisible(visible, recursive);
}
}
@ -167,7 +167,7 @@ void LLAvatarJoint::updateJointGeometry()
for (joints_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(*iter);
joint->updateJointGeometry();
}
}

View File

@ -143,8 +143,10 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
//----------------------------------------------------------------
for (LLJoint* j : mChildren)
{
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(j);
F32 jointLOD = joint ? joint->getLOD() : 0;
// LLViewerJoint is derived from LLAvatarJoint,
// all children of LLAvatarJoint are assumed to be LLAvatarJoint
LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(j);
F32 jointLOD = joint->getLOD();
if (pixelArea >= jointLOD || sDisableLOD)
{
triangle_count += joint->render( pixelArea, TRUE, is_dummy );