diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-01-04 16:33:50 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-01-04 16:33:50 +0200 |
commit | 9962df9fb7303dc52f52bf448bef407342286008 (patch) | |
tree | e7ffefc2c5dea7e2eacf967149b064fd6ce2f86d /indra | |
parent | 6e76e20faaa71caa10fdea8148735bd11141ebe1 (diff) |
SL-14529 Replace dynamic_cast to LLAvatarJoint with static casts
Replaced couple (LLAvatarJoint*) for consistency
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llappearance/llavatarjoint.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewerjoint.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index 80b3e42b52..a1d4fe6423 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -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(); } } diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index a448a95904..9653e80b53 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -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 ); |