Skip to content

Commit 256c849

Browse files
authored
refactor: Add override keyword to virtual function overrides in Libraries (#2390)
1 parent 08b8420 commit 256c849

File tree

156 files changed

+1772
-1772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1772
-1772
lines changed

Core/Libraries/Source/WWVegas/WW3D2/aabtree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class AABTreeClass : public W3DMPO, public RefCountClass
8787
AABTreeClass();
8888
AABTreeClass(AABTreeBuilderClass * builder);
8989
AABTreeClass(const AABTreeClass & that);
90-
~AABTreeClass();
90+
virtual ~AABTreeClass() override;
9191

9292
void Load_W3D(ChunkLoadClass & cload);
9393

Core/Libraries/Source/WWVegas/WW3D2/agg_def.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ class AggregatePrototypeClass : public W3DMPO, public PrototypeClass
209209
//
210210
// Public methods
211211
//
212-
virtual const char * Get_Name() const { return m_pDefinition->Get_Name (); }
213-
virtual int Get_Class_ID() const { return m_pDefinition->Class_ID (); }
214-
virtual RenderObjClass * Create () { return m_pDefinition->Create (); }
215-
virtual void DeleteSelf() { delete this; }
212+
virtual const char * Get_Name() const override { return m_pDefinition->Get_Name (); }
213+
virtual int Get_Class_ID() const override { return m_pDefinition->Class_ID (); }
214+
virtual RenderObjClass * Create () override { return m_pDefinition->Create (); }
215+
virtual void DeleteSelf() override { delete this; }
216216
virtual AggregateDefClass * Get_Definition () const { return m_pDefinition; }
217217
virtual void Set_Definition (AggregateDefClass *pdef) { m_pDefinition = pdef; }
218218

219219
protected:
220-
virtual ~AggregatePrototypeClass () { delete m_pDefinition; }
220+
virtual ~AggregatePrototypeClass () override { delete m_pDefinition; }
221221

222222
private:
223223

@@ -237,8 +237,8 @@ class AggregateLoaderClass : public PrototypeLoaderClass
237237
{
238238
public:
239239

240-
virtual int Chunk_Type () { return W3D_CHUNK_AGGREGATE; }
241-
virtual PrototypeClass * Load_W3D (ChunkLoadClass &chunk_load);
240+
virtual int Chunk_Type () override { return W3D_CHUNK_AGGREGATE; }
241+
virtual PrototypeClass * Load_W3D (ChunkLoadClass &chunk_load) override;
242242
};
243243

244244

Core/Libraries/Source/WWVegas/WW3D2/bmp2d.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ class Bitmap2DObjClass : public DynamicScreenMeshClass
4747
bool center, bool additive, bool colorizable = false, bool ignore_alpha = false);
4848
Bitmap2DObjClass( const Bitmap2DObjClass & src) : DynamicScreenMeshClass(src) {}
4949

50-
virtual RenderObjClass * Clone() const;
51-
virtual int Class_ID() const { return CLASSID_BITMAP2D; }
50+
virtual RenderObjClass * Clone() const override;
51+
virtual int Class_ID() const override { return CLASSID_BITMAP2D; }
5252
};

Core/Libraries/Source/WWVegas/WW3D2/collect.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ class CollectionPrototypeClass : public W3DMPO, public PrototypeClass
123123
public:
124124
CollectionPrototypeClass(CollectionDefClass * def) { ColDef = def; WWASSERT(ColDef); }
125125

126-
virtual const char * Get_Name() const { return ColDef->Get_Name(); }
127-
virtual int Get_Class_ID() const { return RenderObjClass::CLASSID_COLLECTION; }
128-
virtual RenderObjClass * Create() { return NEW_REF( CollectionClass, (*ColDef)); }
129-
virtual void DeleteSelf() { delete this; }
126+
virtual const char * Get_Name() const override { return ColDef->Get_Name(); }
127+
virtual int Get_Class_ID() const override { return RenderObjClass::CLASSID_COLLECTION; }
128+
virtual RenderObjClass * Create() override { return NEW_REF( CollectionClass, (*ColDef)); }
129+
virtual void DeleteSelf() override { delete this; }
130130

131131
CollectionDefClass * ColDef;
132132

133133
protected:
134-
virtual ~CollectionPrototypeClass() { delete ColDef; }
134+
virtual ~CollectionPrototypeClass() override { delete ColDef; }
135135
};
136136

137137

Core/Libraries/Source/WWVegas/WW3D2/collect.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ class CollectionClass : public CompositeRenderObjClass
6060
CollectionClass(const CollectionDefClass & def);
6161
CollectionClass(const CollectionClass & src);
6262
CollectionClass & operator = (const CollectionClass &);
63-
virtual ~CollectionClass();
64-
virtual RenderObjClass * Clone() const;
63+
virtual ~CollectionClass() override;
64+
virtual RenderObjClass * Clone() const override;
6565

66-
virtual int Class_ID() const;
67-
virtual int Get_Num_Polys() const;
66+
virtual int Class_ID() const override;
67+
virtual int Get_Num_Polys() const override;
6868

6969
/////////////////////////////////////////////////////////////////////////////
7070
// Proxy interface
@@ -75,48 +75,48 @@ class CollectionClass : public CompositeRenderObjClass
7575
/////////////////////////////////////////////////////////////////////////////
7676
// Render Object Interface - Rendering
7777
/////////////////////////////////////////////////////////////////////////////
78-
virtual void Render(RenderInfoClass & rinfo);
79-
virtual void Special_Render(SpecialRenderInfoClass & rinfo);
78+
virtual void Render(RenderInfoClass & rinfo) override;
79+
virtual void Special_Render(SpecialRenderInfoClass & rinfo) override;
8080

8181
/////////////////////////////////////////////////////////////////////////////
8282
// Render Object Interface - "Scene Graph"
8383
/////////////////////////////////////////////////////////////////////////////
84-
virtual void Set_Transform(const Matrix3D &m);
85-
virtual void Set_Position(const Vector3 &v);
86-
virtual int Get_Num_Sub_Objects() const;
87-
virtual RenderObjClass * Get_Sub_Object(int index) const;
88-
virtual int Add_Sub_Object(RenderObjClass * subobj);
89-
virtual int Remove_Sub_Object(RenderObjClass * robj);
84+
virtual void Set_Transform(const Matrix3D &m) override;
85+
virtual void Set_Position(const Vector3 &v) override;
86+
virtual int Get_Num_Sub_Objects() const override;
87+
virtual RenderObjClass * Get_Sub_Object(int index) const override;
88+
virtual int Add_Sub_Object(RenderObjClass * subobj) override;
89+
virtual int Remove_Sub_Object(RenderObjClass * robj) override;
9090

9191
/////////////////////////////////////////////////////////////////////////////
9292
// Render Object Interface - Collision Detection, Ray Tracing
9393
/////////////////////////////////////////////////////////////////////////////
94-
virtual bool Cast_Ray(RayCollisionTestClass & raytest);
95-
virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest);
96-
virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
97-
virtual bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
98-
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
94+
virtual bool Cast_Ray(RayCollisionTestClass & raytest) override;
95+
virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest) override;
96+
virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest) override;
97+
virtual bool Intersect_AABox(AABoxIntersectionTestClass & boxtest) override;
98+
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest) override;
9999

100100
/////////////////////////////////////////////////////////////////////////////
101101
// Render Object Interface - Bounding Volumes
102102
/////////////////////////////////////////////////////////////////////////////
103-
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
104-
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
103+
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const override;
104+
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const override;
105105

106106

107107
/////////////////////////////////////////////////////////////////////////////
108108
// Render Object Interface - Attributes, Options, Properties, etc
109109
/////////////////////////////////////////////////////////////////////////////
110110
virtual int Snap_Point_Count();
111-
virtual void Get_Snap_Point(int index,Vector3 * set);
112-
virtual void Scale(float scale);
113-
virtual void Scale(float scalex, float scaley, float scalez);
114-
virtual void Update_Obj_Space_Bounding_Volumes();
111+
virtual void Get_Snap_Point(int index,Vector3 * set) override;
112+
virtual void Scale(float scale) override;
113+
virtual void Scale(float scalex, float scaley, float scalez) override;
114+
virtual void Update_Obj_Space_Bounding_Volumes() override;
115115

116116
protected:
117117

118118
void Free();
119-
void Update_Sub_Object_Transforms();
119+
virtual void Update_Sub_Object_Transforms() override;
120120

121121
DynamicVectorClass <ProxyClass> ProxyList;
122122
DynamicVectorClass <RenderObjClass *> SubObjects;
@@ -135,8 +135,8 @@ class CollectionLoaderClass : public PrototypeLoaderClass
135135
{
136136
public:
137137

138-
virtual int Chunk_Type() { return W3D_CHUNK_COLLECTION; }
139-
virtual PrototypeClass * Load_W3D(ChunkLoadClass & cload);
138+
virtual int Chunk_Type() override { return W3D_CHUNK_COLLECTION; }
139+
virtual PrototypeClass * Load_W3D(ChunkLoadClass & cload) override;
140140
};
141141

142142
extern CollectionLoaderClass _CollectionLoader;

Core/Libraries/Source/WWVegas/WW3D2/composite.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,33 @@ class CompositeRenderObjClass : public RenderObjClass
5252

5353
CompositeRenderObjClass();
5454
CompositeRenderObjClass(const CompositeRenderObjClass & that);
55-
virtual ~CompositeRenderObjClass();
55+
virtual ~CompositeRenderObjClass() override;
5656
CompositeRenderObjClass & operator = (const CompositeRenderObjClass & that);
5757

58-
virtual void Restart();
58+
virtual void Restart() override;
5959

60-
virtual const char * Get_Name() const;
61-
virtual void Set_Name(const char * name);
62-
virtual const char * Get_Base_Model_Name () const;
63-
virtual void Set_Base_Model_Name (const char *name);
64-
virtual int Get_Num_Polys() const;
65-
virtual void Notify_Added(SceneClass * scene);
66-
virtual void Notify_Removed(SceneClass * scene);
60+
virtual const char * Get_Name() const override;
61+
virtual void Set_Name(const char * name) override;
62+
virtual const char * Get_Base_Model_Name () const override;
63+
virtual void Set_Base_Model_Name (const char *name) override;
64+
virtual int Get_Num_Polys() const override;
65+
virtual void Notify_Added(SceneClass * scene) override;
66+
virtual void Notify_Removed(SceneClass * scene) override;
6767

68-
virtual bool Cast_Ray(RayCollisionTestClass & raytest);
69-
virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest);
70-
virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
71-
virtual bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
72-
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
68+
virtual bool Cast_Ray(RayCollisionTestClass & raytest) override;
69+
virtual bool Cast_AABox(AABoxCollisionTestClass & boxtest) override;
70+
virtual bool Cast_OBBox(OBBoxCollisionTestClass & boxtest) override;
71+
virtual bool Intersect_AABox(AABoxIntersectionTestClass & boxtest) override;
72+
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest) override;
7373

74-
virtual void Create_Decal(DecalGeneratorClass * generator);
75-
virtual void Delete_Decal(uint32 decal_id);
74+
virtual void Create_Decal(DecalGeneratorClass * generator) override;
75+
virtual void Delete_Decal(uint32 decal_id) override;
7676

77-
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const { sphere = ObjSphere; }
78-
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const { box = ObjBox; }
79-
virtual void Update_Obj_Space_Bounding_Volumes();
77+
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const override { sphere = ObjSphere; }
78+
virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const override { box = ObjBox; }
79+
virtual void Update_Obj_Space_Bounding_Volumes() override;
8080

81-
virtual void Set_User_Data(void *value, bool recursive = false);
81+
virtual void Set_User_Data(void *value, bool recursive = false) override;
8282

8383
protected:
8484

Core/Libraries/Source/WWVegas/WW3D2/decalsys.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class DecalGeneratorClass : public ProjectorClass
173173
protected:
174174

175175
DecalGeneratorClass(uint32 id,DecalSystemClass * system);
176-
~DecalGeneratorClass();
176+
virtual ~DecalGeneratorClass() override;
177177

178178
/*
179179
** Logical Decal ID, DecalSystem that this generator is tied to
@@ -215,19 +215,19 @@ class MultiFixedPoolDecalSystemClass : public DecalSystemClass
215215

216216
MultiFixedPoolDecalSystemClass(uint32 num_pools, const uint32 *pool_sizes);
217217
MultiFixedPoolDecalSystemClass(const MultiFixedPoolDecalSystemClass & that);
218-
virtual ~MultiFixedPoolDecalSystemClass();
218+
virtual ~MultiFixedPoolDecalSystemClass() override;
219219

220220
// This clears the slot in addition to locking the generator, thus preventing any decal id
221221
// collisions (since any decal previously in that slot will have the same id as the new one).
222-
virtual DecalGeneratorClass * Lock_Decal_Generator();
222+
virtual DecalGeneratorClass * Lock_Decal_Generator() override;
223223

224224
// This will register the decal in the system in the appropriate pool and slot (determined by
225225
// the generator's pool and slot ids), removing any decal which may have been there before.
226-
virtual void Unlock_Decal_Generator(DecalGeneratorClass * generator);
226+
virtual void Unlock_Decal_Generator(DecalGeneratorClass * generator) override;
227227

228228
// This notifies the system that a mesh which has decals on it was destroyed - therefore we
229229
// need to remove the mesh from our list to avoid dangling pointers.
230-
virtual void Decal_Mesh_Destroyed(uint32 id,DecalMeshClass * mesh);
230+
virtual void Decal_Mesh_Destroyed(uint32 id,DecalMeshClass * mesh) override;
231231

232232
// Not part of the DecalSystemClass interface - this function removes any decal currently in
233233
// the given slot in the given pool.
@@ -247,7 +247,7 @@ class MultiFixedPoolDecalSystemClass : public DecalSystemClass
247247
** can set them before calling Lock_Decal_Generator() (which is where this function is called).
248248
** We do it this way to avoid needing to override Lock_Decal_Generator().
249249
*/
250-
virtual uint32 Generate_Decal_Id() { return encode_decal_id(Generator_PoolID, Generator_SlotID); }
250+
virtual uint32 Generate_Decal_Id() override { return encode_decal_id(Generator_PoolID, Generator_SlotID); }
251251
uint32 Generator_PoolID; // These should be set before calling Lock_Decal_Generator()
252252
uint32 Generator_SlotID; // These should be set before calling Lock_Decal_Generator()
253253

0 commit comments

Comments
 (0)