Index: ps/trunk/source/graphics/Decal.h =================================================================== --- ps/trunk/source/graphics/Decal.h +++ ps/trunk/source/graphics/Decal.h @@ -56,19 +56,19 @@ } /// Dynamic cast - virtual CModelDecal* ToCModelDecal() + CModelDecal* ToCModelDecal() override { return this; } - virtual std::unique_ptr Clone() const; + std::unique_ptr Clone() const override; - virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1); + void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) override; - virtual void CalcBounds(); - virtual void ValidatePosition(); - virtual void InvalidatePosition(); - virtual void SetTransform(const CMatrix3D& transform); + void CalcBounds() override; + void ValidatePosition() override; + void InvalidatePosition() override; + void SetTransform(const CMatrix3D& transform) override; // remove shadow receiving void RemoveShadows(); Index: ps/trunk/source/graphics/Model.h =================================================================== --- ps/trunk/source/graphics/Model.h +++ ps/trunk/source/graphics/Model.h @@ -73,10 +73,10 @@ public: CModel(const CSimulation2& simulation, const CMaterial& material, const CModelDefPtr& modeldef); - ~CModel(); + ~CModel() override; /// Dynamic cast - virtual CModel* ToCModel() + CModel* ToCModel() override { return this; } @@ -88,9 +88,9 @@ const CModelDefPtr& GetModelDef() { return m_pModelDef; } // set the model's player ID, recursively through props - void SetPlayerID(player_id_t id); + void SetPlayerID(player_id_t id) override; // set the models mod color - virtual void SetShadingColor(const CColor& color); + void SetShadingColor(const CColor& color) override; // get the model's material const CMaterial& GetMaterial() { return m_Material; } @@ -115,13 +115,13 @@ // TODO: replace with more generic shader define + flags setting void RemoveShadowsRec(); - virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) + void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) override { for (size_t i = 0; i < m_Props.size(); ++i) m_Props[i].m_Model->SetTerrainDirty(i0, j0, i1, j1); } - virtual void SetEntityVariable(const std::string& name, float value) + void SetEntityVariable(const std::string& name, float value) override { for (size_t i = 0; i < m_Props.size(); ++i) m_Props[i].m_Model->SetEntityVariable(name, value); @@ -131,7 +131,7 @@ /// Overridden to calculate both the world-space and object-space bounds of this model, and stores the result in /// m_Bounds and m_ObjectBounds, respectively. - virtual void CalcBounds(); + void CalcBounds() override; /// Returns the object-space bounds for this model, excluding its children. const CBoundingBoxAligned& GetObjectBounds() @@ -140,7 +140,7 @@ return m_ObjectBounds; } - virtual const CBoundingBoxAligned GetWorldBoundsRec(); // reimplemented here + const CBoundingBoxAligned GetWorldBoundsRec() override; // reimplemented here /// Auxiliary method; calculates object space bounds of this model, based solely on vertex positions, and stores /// the result in m_ObjectBounds. Called by CalcBounds (instead of CalcAnimatedObjectBounds) if it has been determined @@ -155,7 +155,7 @@ // --- SELECTION BOX/BOUNDS ---------------------------------------------------------------------- /// Reimplemented here since proper models should participate in selection boxes. - virtual const CBoundingBoxAligned GetObjectSelectionBoundsRec(); + const CBoundingBoxAligned GetObjectSelectionBoundsRec() override; /** * Set transform of this object. @@ -163,7 +163,7 @@ * @note In order to ensure that all child props are updated properly, * you must call ValidatePosition(). */ - virtual void SetTransform(const CMatrix3D& transform); + void SetTransform(const CMatrix3D& transform) override; /** * Return whether this is a skinned/skeletal model. If it is, Get*BoneMatrices() @@ -172,7 +172,8 @@ bool IsSkinned() { return (m_BoneMatrices != NULL); } // return the models bone matrices; 16-byte aligned for SSE reads - const CMatrix3D* GetAnimatedBoneMatrices() { + const CMatrix3D* GetAnimatedBoneMatrices() + { ENSURE(m_PositionValid); return m_BoneMatrices; } @@ -208,19 +209,19 @@ const std::vector& GetProps() const { return m_Props; } // return a clone of this model - virtual std::unique_ptr Clone() const; + std::unique_ptr Clone() const override; /** * Ensure that both the transformation and the bone * matrices are correct for this model and all its props. */ - virtual void ValidatePosition(); + void ValidatePosition() override; /** * Mark this model's position and bone matrices, * and all props' positions as invalid. */ - virtual void InvalidatePosition(); + void InvalidatePosition() override; private: // Needed for terrain aligned props Index: ps/trunk/source/graphics/ModelAbstract.h =================================================================== --- ps/trunk/source/graphics/ModelAbstract.h +++ ps/trunk/source/graphics/ModelAbstract.h @@ -48,7 +48,8 @@ */ struct CustomSelectionShape { - enum EType { + enum EType + { /// The selection shape is determined by an oriented box of custom, user-specified size. BOX, /// The selection shape is determined by a cylinder of custom, user-specified size. @@ -68,7 +69,7 @@ m_SelectionBoxValid(false), m_CustomSelectionShape(NULL) { } - ~CModelAbstract() + virtual ~CModelAbstract() { delete m_CustomSelectionShape; // allocated and set externally by CCmpVisualActor, but our responsibility to clean up } Index: ps/trunk/source/graphics/ModelDummy.h =================================================================== --- ps/trunk/source/graphics/ModelDummy.h +++ ps/trunk/source/graphics/ModelDummy.h @@ -30,15 +30,15 @@ public: CModelDummy() = default; - virtual ~CModelDummy() = default; + ~CModelDummy() override = default; - virtual std::unique_ptr Clone() const { return std::make_unique(); } - virtual CModelDummy* ToCModelDummy() { return this; } + std::unique_ptr Clone() const override { return std::make_unique(); } + CModelDummy* ToCModelDummy() override { return this; } - virtual void CalcBounds() {} - virtual void SetTerrainDirty(ssize_t, ssize_t, ssize_t, ssize_t) {} - virtual void ValidatePosition() {} - virtual void InvalidatePosition() {} + void CalcBounds() override {} + void SetTerrainDirty(ssize_t, ssize_t, ssize_t, ssize_t) override {} + void ValidatePosition() override {} + void InvalidatePosition() override {} }; #endif // INCLUDED_MODELDUMMY Index: ps/trunk/source/graphics/ParticleEmitter.h =================================================================== --- ps/trunk/source/graphics/ParticleEmitter.h +++ ps/trunk/source/graphics/ParticleEmitter.h @@ -189,26 +189,26 @@ { public: CModelParticleEmitter(const CParticleEmitterTypePtr& type); - ~CModelParticleEmitter(); + ~CModelParticleEmitter() override; /// Dynamic cast - virtual CModelParticleEmitter* ToCModelParticleEmitter() + CModelParticleEmitter* ToCModelParticleEmitter() override { return this; } - virtual std::unique_ptr Clone() const; + std::unique_ptr Clone() const override; - virtual void SetTerrainDirty(ssize_t UNUSED(i0), ssize_t UNUSED(j0), ssize_t UNUSED(i1), ssize_t UNUSED(j1)) + void SetTerrainDirty(ssize_t UNUSED(i0), ssize_t UNUSED(j0), ssize_t UNUSED(i1), ssize_t UNUSED(j1)) override { } - virtual void SetEntityVariable(const std::string& name, float value); + void SetEntityVariable(const std::string& name, float value) override; - virtual void CalcBounds(); - virtual void ValidatePosition(); - virtual void InvalidatePosition(); - virtual void SetTransform(const CMatrix3D& transform); + void CalcBounds() override; + void ValidatePosition() override; + void InvalidatePosition() override; + void SetTransform(const CMatrix3D& transform) override; CParticleEmitterTypePtr m_Type; CParticleEmitterPtr m_Emitter;