From 8795229f5e1b393385c0e78acedf47bf99c5b2bf Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 14 Sep 2019 03:57:37 -0400 Subject: [PATCH] Love me some code cleanup and finality. --- indra/newview/llcontrolavatar.cpp | 15 ++------------- indra/newview/llcontrolavatar.h | 22 ++++++++++++---------- indra/newview/lluiavatar.cpp | 6 ------ indra/newview/lluiavatar.h | 8 +++++--- indra/newview/llviewerobject.h | 2 +- indra/newview/llvoavatar.cpp | 2 -- indra/newview/llvoavatar.h | 8 +++----- indra/newview/llvoavatarself.h | 2 +- indra/newview/llvograss.h | 2 +- indra/newview/llvoground.h | 2 +- indra/newview/llvopartgroup.h | 26 +++++++++++++------------- indra/newview/llvosky.h | 2 +- indra/newview/llvosurfacepatch.h | 2 +- indra/newview/llvotree.h | 2 +- indra/newview/llvovolume.h | 8 ++------ indra/newview/llvowater.h | 18 +++++++++--------- indra/newview/llvowlsky.h | 2 +- 17 files changed, 54 insertions(+), 75 deletions(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index fc4599dc62..2c180f7949 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -53,7 +53,6 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer mRegionChanged(false) { mIsDummy = TRUE; - mIsControlAvatar = true; mEnableDefaultMotions = false; } @@ -172,7 +171,7 @@ void LLControlAvatar::matchVolumeTransform() LLVector3 joint_pos = attach->getWorldPosition(); LLQuaternion joint_rot = attach->getWorldRotation(); LLVector3 obj_pos = mRootVolp->mDrawable->getPosition(); - LLQuaternion obj_rot = mRootVolp->mDrawable->getRotation(); + const LLQuaternion& obj_rot = mRootVolp->mDrawable->getRotation(); obj_pos.rotVec(joint_rot); mRoot->setWorldPosition(obj_pos + joint_pos); mRoot->setWorldRotation(obj_rot * joint_rot); @@ -197,18 +196,8 @@ void LLControlAvatar::matchVolumeTransform() // complexity info and such line up better. Should defer // this until avatars also get fixed. - LLQuaternion obj_rot; - if (mRootVolp->mDrawable) - { - obj_rot = mRootVolp->mDrawable->getRotation(); - } - else - { - obj_rot = mRootVolp->getRotation(); - } + const LLQuaternion& obj_rot = mRootVolp->mDrawable ? mRootVolp->mDrawable->getRotation() : mRootVolp->getRotation(); - LLMatrix3 bind_mat; - LLQuaternion bind_rot; #define MATCH_BIND_SHAPE #ifdef MATCH_BIND_SHAPE diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index 288d07cd48..f6c599bcae 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -30,14 +30,14 @@ #include "llvoavatar.h" #include "llvovolume.h" -class LLControlAvatar: +class LLControlAvatar final: public LLVOAvatar { LOG_CLASS(LLControlAvatar); public: LLControlAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - virtual void initInstance(); // Called after construction to initialize the class. + void initInstance() override; // Called after construction to initialize the class. virtual ~LLControlAvatar(); void getNewConstraintFixups(LLVector3& new_pos_constraint, F32& new_scale_constraint) const; @@ -52,13 +52,13 @@ public: // markDead() inside other graphics pipeline operations. void markForDeath(); - virtual void idleUpdate(LLAgent &agent, const F64 &time); - virtual BOOL updateCharacter(LLAgent &agent); + void idleUpdate(LLAgent &agent, const F64 &time) override; + BOOL updateCharacter(LLAgent &agent) override; void getAnimatedVolumes(std::vector<LLVOVolume*>& volumes); void updateAnimations(); - virtual LLViewerObject* lineSegmentIntersectRiggedAttachments( + LLViewerObject* lineSegmentIntersectRiggedAttachments( const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES BOOL pick_transparent = FALSE, @@ -67,15 +67,17 @@ public: LLVector4a* intersection = NULL, // return the intersection point LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point LLVector4a* normal = NULL, // return the surface normal at the intersection point - LLVector4a* tangent = NULL); // return the surface tangent at the intersection point + LLVector4a* tangent = NULL) override; // return the surface tangent at the intersection point - virtual void updateDebugText(); + void updateDebugText() override; - virtual std::string getFullname() const; + std::string getFullname() const override; - virtual bool shouldRenderRigged() const; + bool shouldRenderRigged() const override; - virtual BOOL isImpostor(); + bool isControlAvatar() const override { return true; } // True if this avatar is a control av (no associated user) + + BOOL isImpostor() override; bool mPlaying; diff --git a/indra/newview/lluiavatar.cpp b/indra/newview/lluiavatar.cpp index e4e266c92a..068a206d9e 100644 --- a/indra/newview/lluiavatar.cpp +++ b/indra/newview/lluiavatar.cpp @@ -38,12 +38,6 @@ LLUIAvatar::LLUIAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* re LLVOAvatar(id, pcode, regionp) { mIsDummy = TRUE; - mIsUIAvatar = true; -} - -// virtual -LLUIAvatar::~LLUIAvatar() -{ } // virtual diff --git a/indra/newview/lluiavatar.h b/indra/newview/lluiavatar.h index bcdffedef2..28ee819987 100644 --- a/indra/newview/lluiavatar.h +++ b/indra/newview/lluiavatar.h @@ -30,15 +30,17 @@ #include "llvoavatar.h" #include "llvovolume.h" -class LLUIAvatar: +class LLUIAvatar final: public LLVOAvatar { LOG_CLASS(LLUIAvatar); public: LLUIAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - virtual void initInstance(); // Called after construction to initialize the class. - virtual ~LLUIAvatar(); + void initInstance() override; // Called after construction to initialize the class. + virtual ~LLUIAvatar() = default; + + bool isUIAvatar() const override { return true; } // True if this avatar is a supplemental av used in some UI views (no associated user) }; #endif //LL_CONTROLAVATAR_H diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 4c79fcbe36..f71610fc0f 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -958,7 +958,7 @@ public: : LLViewerObject(id,pcode,regionp, is_global) { } - void updateDrawable(BOOL force_damped) override; + void updateDrawable(BOOL force_damped) final override; }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b360f509d9..5ff25f1ff2 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -662,8 +662,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCachedInMuteList(false), mCachedMuteListUpdateTime(0), mVisuallyMuteSetting(AV_RENDER_NORMALLY), - mIsControlAvatar(false), - mIsUIAvatar(false), mEnableDefaultMotions(true), mVisibilityRank(0), mVisible(FALSE), diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c4e417833e..d9a1b353f6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -225,7 +225,7 @@ public: size_t mLastRiggingInfoKeyHash = 0; std::set<LLUUID> mActiveOverrideMeshes; - virtual void onActiveOverrideMeshesChanged(); + void onActiveOverrideMeshesChanged(); /*virtual*/ const LLUUID& getID() const override; /*virtual*/ void addDebugText(const std::string& text) override; @@ -248,8 +248,8 @@ public: public: bool isSelf() const override { return false; } // True if this avatar is for this viewer's agent - virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user) - virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user) + virtual bool isControlAvatar() const { return false; } // True if this avatar is a control av (no associated user) + virtual bool isUIAvatar() const { return false; } // True if this avatar is a supplemental av used in some UI views (no associated user) private: //aligned members LL_ALIGN_16(LLVector4a mImpostorExtents[2]); @@ -476,8 +476,6 @@ public: // animated object status //-------------------------------------------------------------------- public: - bool mIsControlAvatar; - bool mIsUIAvatar; bool mEnableDefaultMotions; //-------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 06764376e5..008c90c6a7 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -42,7 +42,7 @@ class LLInventoryCallback; // LLVOAvatarSelf // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLVOAvatarSelf : +class LLVOAvatarSelf final: public LLVOAvatar { LOG_CLASS(LLVOAvatarSelf); diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index 10c314ace9..d8f16eafc9 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -33,7 +33,7 @@ class LLSurfacePatch; class LLViewerTexture; -class LLVOGrass : public LLAlphaObject +class LLVOGrass final : public LLAlphaObject { public: LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); diff --git a/indra/newview/llvoground.h b/indra/newview/llvoground.h index 1dd133dcd8..846e9afe47 100644 --- a/indra/newview/llvoground.h +++ b/indra/newview/llvoground.h @@ -33,7 +33,7 @@ #include "llviewertexture.h" #include "llviewerobject.h" -class LLVOGround : public LLStaticViewerObject +class LLVOGround final : public LLStaticViewerObject { protected: ~LLVOGround() = default; diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index a42efa8d68..d356721248 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -63,11 +63,11 @@ public: LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. - void idleUpdate(LLAgent &agent, const F64 &time) override; + /*virtual*/ BOOL isActive() const final override; // Whether this object needs to do an idleUpdate. + void idleUpdate(LLAgent &agent, const F64 &time) final override; - F32 getBinRadius() override; - void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) override; + F32 getBinRadius() final override; + void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) final override; U32 getPartitionType() const override; /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, @@ -78,13 +78,13 @@ public: LLVector4a* intersection, LLVector2* tex_coord, LLVector4a* normal, - LLVector4a* tangent) override; + LLVector4a* tangent) final override; - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; - /*virtual*/ void updateTextures() override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) final override; + /*virtual*/ void updateTextures() final override; /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) final override; void getGeometry(const LLViewerPart& part, LLStrider<LLVector4a>& verticesp); @@ -94,11 +94,11 @@ public: LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, LLStrider<LLColor4U>& emissivep, - LLStrider<U16>& indicesp) override; + LLStrider<U16>& indicesp) final override; - void updateFaceSize(S32 idx) override { } - F32 getPartSize(S32 idx) override; - void getBlendFunc(S32 idx, U32& src, U32& dst) override; + void updateFaceSize(S32 idx) final override { } + F32 getPartSize(S32 idx) final override; + void getBlendFunc(S32 idx, U32& src, U32& dst) final override; LLUUID getPartOwner(S32 idx); LLUUID getPartSource(S32 idx); @@ -115,7 +115,7 @@ protected: }; -class LLVOHUDPartGroup : public LLVOPartGroup +class LLVOHUDPartGroup final : public LLVOPartGroup { public: LLVOHUDPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 3d9de9e1ee..7795598e7a 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -387,7 +387,7 @@ protected: class LLCubeMap; -class LLVOSky : public LLStaticViewerObject +class LLVOSky final : public LLStaticViewerObject { public: /// WL PARAMS diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index 8c30879f87..89c731a8ea 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -36,7 +36,7 @@ class LLVector2; class LLFacePool; class LLFace; -class LLVOSurfacePatch : public LLStaticViewerObject +class LLVOSurfacePatch final : public LLStaticViewerObject { public: static F32 sLODFactor; diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 267abfac3e..781717e298 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -34,7 +34,7 @@ class LLFace; class LLDrawPool; class LLViewerFetchedTexture; -class LLVOTree : public LLViewerObject +class LLVOTree final : public LLViewerObject { protected: ~LLVOTree(); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index a4a1d87f84..55ec6f4324 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -57,7 +57,7 @@ enum LLVolumeInterfaceType const F32 MAX_LOD_FACTOR = 4.0f; -class LLRiggedVolume : public LLVolume +class LLRiggedVolume final : public LLVolume { public: LLRiggedVolume(const LLVolumeParams& params) @@ -93,7 +93,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: @@ -221,10 +221,6 @@ public: void updateSculptTexture(); void setIndexInTex(U32 ch, S32 index) { mIndexInTex[ch] = index ;} void sculpt(); - static void rebuildMeshAssetCallback(LLVFS *vfs, - const LLUUID& asset_uuid, - LLAssetType::EType type, - void* user_data, S32 status, LLExtStat ext_status); void updateRelativeXform(bool force_identity = false); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; diff --git a/indra/newview/llvowater.h b/indra/newview/llvowater.h index 239109801d..1a01c64aa0 100644 --- a/indra/newview/llvowater.h +++ b/indra/newview/llvowater.h @@ -52,23 +52,23 @@ public: LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void markDead() override; + /*virtual*/ void markDead() final override; // Initialize data that's only inited once per class. static void initClass(); static void cleanupClass(); - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) override; - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) override; - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) override; - /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) override; + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time) final override; + /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline) final override; + /*virtual*/ BOOL updateGeometry(LLDrawable *drawable) final override; + /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) final override; - /*virtual*/ void updateTextures() override; - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) override; // generate accurate apparent angle and area + /*virtual*/ void updateTextures() final override; + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent) final override; // generate accurate apparent angle and area U32 getPartitionType() const override; - /*virtual*/ BOOL isActive() const override; // Whether this object needs to do an idleUpdate. + /*virtual*/ BOOL isActive() const final override; // Whether this object needs to do an idleUpdate. void setUseTexture(const BOOL use_texture); void setIsEdgePatch(const BOOL edge_patch); @@ -81,7 +81,7 @@ protected: S32 mRenderType; }; -class LLVOVoidWater : public LLVOWater +class LLVOVoidWater final : public LLVOWater { public: LLVOVoidWater(LLUUID const& id, LLPCode pcode, LLViewerRegion* regionp) : LLVOWater(id, pcode, regionp) diff --git a/indra/newview/llvowlsky.h b/indra/newview/llvowlsky.h index 90a24fb49a..21aff1b3c9 100644 --- a/indra/newview/llvowlsky.h +++ b/indra/newview/llvowlsky.h @@ -29,7 +29,7 @@ #include "llviewerobject.h" -class LLVOWLSky : public LLStaticViewerObject { +class LLVOWLSky final : public LLStaticViewerObject { private: static const F32 DISTANCE_TO_STARS; -- GitLab