refactor: Add override keyword to virtual function overrides in Libraries#2390
refactor: Add override keyword to virtual function overrides in Libraries#2390bobtista wants to merge 5 commits intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WW3D2/collect.h | Adds override to all virtual function overrides in CollectionClass and CollectionLoaderClass; also correctly adds virtual + override to Update_Sub_Object_Transforms, which was implicitly virtual in the base class RenderObjClass. |
| Core/Libraries/Source/WWVegas/WW3D2/rendobj.h | Adds override to ~RenderObjClass destructor and three PersistClass-derived virtual methods; changes are minimal and correct. |
| Core/Libraries/Source/WWVegas/WWSaveLoad/simpleparameter.h | Adds virtual and override to operator==, Get_Type, and Copy_Value — all confirmed virtual in the ParameterClass base class. |
| Core/Libraries/Source/WWVegas/WWSaveLoad/parameter.h | Adds override to many virtual method overrides across StringParameterClass, FilenameParameterClass and other parameter types; all correctly reference base class virtuals. |
| Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp | Adds override to the ~ActiveCategoryStackClass destructor in an anonymous class; valid if the base has a virtual destructor. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/mapper.h | Adds override to all mapper subclasses (ScaleTextureMapper, LinearOffsetTextureMapper, GridTextureMapper, RotateTextureMapper, etc.); consistently applied throughout the file. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/mesh.h | Mechanical override additions to all MeshClass virtual overrides; no issues found. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.h | Adds override to SceneClass and SimpleSceneClass virtual overrides; ~SceneClass inherits from RefCountClass which has a virtual destructor, so override on ~SceneClass is correct. |
| Core/Libraries/Source/profile/internal_result.h | Adds override to WriteResults and Delete in ProfileResultFileCSV and ProfileResultFileDOT; straightforward and correct. |
| Core/Libraries/Source/WWVegas/WWLib/Vector.h | Adds override to Resize, Clear, and ID in DynamicVectorClass; all are virtual in the VectorClass base. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class RenderObjClass {
+virtual Clone() const
+virtual Class_ID() const
+virtual Render()
+virtual Cast_Ray()
+virtual Scale()
+virtual Update_Sub_Object_Transforms()
}
class CollectionClass {
+virtual Clone() const override
+virtual Class_ID() const override
+virtual Render() override
+virtual Cast_Ray() override
+virtual Scale() override
+virtual Update_Sub_Object_Transforms() override
}
class MeshClass {
+virtual Clone() const override
+virtual Class_ID() const override
+virtual Render() override
+virtual Cast_Ray() override
+virtual Scale() override
}
class DistLODClass {
+virtual Clone() const override
+virtual Class_ID() const override
+virtual Render() override
+virtual Cast_Ray() override
+virtual Scale() override
}
class ParameterClass {
+virtual operator==()
+virtual Get_Type() const
+virtual Copy_Value()
}
class SimpleParmClass {
+virtual operator==() override
+virtual Get_Type() const override
+virtual Copy_Value() override
}
class VectorClass {
+virtual Resize()
+virtual Clear()
+virtual ID()
}
class DynamicVectorClass {
+virtual Resize() override
+virtual Clear() override
+virtual ID() override
}
RenderObjClass <|-- CollectionClass
RenderObjClass <|-- MeshClass
RenderObjClass <|-- DistLODClass
ParameterClass <|-- SimpleParmClass
VectorClass <|-- DynamicVectorClass
Last reviewed commit: 5919d77
|
This also needs rebase |
do you have the latest pulled locally? Github doesn't show a merge conflict for me |
|
But it still 4 commits present that are already in main branch. Something is not right. |
a0fc760 to
06c9db7
Compare
|
You're right - rebased, looks better now |
| virtual int Get_Sort_Level() const { return SortLevel; } | ||
| virtual void Set_Sort_Level(int level) { SortLevel = level; if(level != SORT_LEVEL_NONE) Disable_Sort();} | ||
| virtual int Get_Sort_Level() const override { return SortLevel; } | ||
| virtual void Set_Sort_Level(int level) override { SortLevel = level; if(level != SORT_LEVEL_NONE) Disable_Sort();} |
|
|
||
| virtual bool Load_Compressed_Mipmap (); | ||
| virtual bool Load_Compressed_Mipmap () override; | ||
| // virtual bool Load_Uncompressed_Mipmap(); |
There was a problem hiding this comment.
Its commented out, but maybe play it safe and add override here is well.
|
|
||
| virtual bool Load_Compressed_Mipmap (); | ||
| virtual bool Load_Compressed_Mipmap () override; | ||
| // virtual bool Load_Uncompressed_Mipmap(); |
There was a problem hiding this comment.
Its commented out, but maybe play it safe and add override here is well.
Summary
overridekeyword to virtual function overrides in Libraries (WWVegas: WW3D2, WWAudio, WWLib, WWMath, WWSaveLoad, etc.)Context
Part 2/6 of splitting #2101. Depends on #2389 merging first.
Notes
overridekeyword additionsvirtualkeyword