From 5426732f2819a5b7a5887173aaa50ca9c641f55c Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 2 Sep 2025 05:04:33 +0500 Subject: [PATCH] minor tweaks --- contrib/bobtoolz/DEntity.cpp | 8 +- contrib/bobtoolz/DMap.cpp | 2 +- contrib/bobtoolz/DTrainDrawer.h | 6 +- contrib/bobtoolz/bobToolz-GTK.cpp | 10 +- contrib/bobtoolz/funchandlers-GTK.cpp | 4 +- contrib/brushexport/export.cpp | 6 +- contrib/meshtex/GeneralFunctionDialog.h | 4 +- contrib/meshtex/GetInfoDialog.h | 4 +- contrib/meshtex/MainMenu.h | 2 +- contrib/meshtex/MeshVisitor.h | 2 +- contrib/meshtex/SetScaleDialog.h | 4 +- contrib/prtview/portals.h | 10 +- contrib/sunplug/sunplug.cpp | 2 +- contrib/ufoaiplug/ufoai_filters.cpp | 6 +- contrib/ufoaiplug/ufoai_gtk.cpp | 10 +- contrib/ufoaiplug/ufoai_level.cpp | 6 +- include/ientity.h | 2 +- include/iscenegraph.h | 2 +- include/itextstream.h | 2 +- libs/archivelib.h | 14 +- libs/debugging/debugging.h | 8 +- libs/eclasslib.h | 3 +- libs/entitylib.h | 6 +- libs/entityxml.h | 10 +- libs/gtkutil/filechooser.cpp | 2 +- libs/gtkutil/glfont.cpp | 10 +- libs/imagelib.h | 16 +- libs/instancelib.h | 12 +- libs/maplib.h | 38 +-- libs/modulesystem/modulesmap.h | 7 +- libs/pivot.h | 2 +- libs/profile/file.h | 60 ++-- libs/render.h | 12 +- libs/scenelib.h | 40 +-- libs/script/scripttokeniser.h | 14 +- libs/script/scripttokenwriter.h | 14 +- libs/stream/filestream.h | 18 +- libs/stream/memstream.h | 4 +- libs/stream/textfilestream.h | 4 +- libs/stream/textstream.h | 2 +- libs/transformlib.h | 4 +- libs/traverselib.h | 24 +- libs/undolib.h | 10 +- libs/xml/xmlelement.h | 12 +- libs/xml/xmlparser.h | 8 +- libs/xml/xmlwriter.h | 8 +- plugins/archivepak/archive.cpp | 10 +- plugins/archivewad/archive.cpp | 10 +- plugins/archivezip/archive.cpp | 22 +- plugins/archivezip/zlibstream.h | 2 +- plugins/assmodel/model.cpp | 30 +- plugins/assmodel/plugin.cpp | 2 +- plugins/entity/curve.h | 4 +- plugins/entity/doom3group.cpp | 43 ++- plugins/entity/eclassmodel.cpp | 22 +- plugins/entity/entity.cpp | 14 +- plugins/entity/filters.h | 2 +- plugins/entity/generic.cpp | 24 +- plugins/entity/group.cpp | 20 +- plugins/entity/keyobservers.h | 4 +- plugins/entity/light.cpp | 66 ++-- plugins/entity/miscmodel.cpp | 22 +- plugins/entity/model.h | 4 +- plugins/entity/modelskinkey.h | 6 +- plugins/entity/namedentity.h | 6 +- plugins/entity/namekeys.h | 6 +- plugins/entity/origin.h | 6 +- plugins/entity/skincache.cpp | 18 +- plugins/entity/targetable.h | 14 +- plugins/mapq3/plugin.cpp | 40 +-- plugins/mapq3/write.cpp | 6 +- plugins/mapxml/plugin.cpp | 4 +- plugins/mapxml/xmlwrite.cpp | 4 +- plugins/md3model/model.h | 36 +-- plugins/md3model/plugin.cpp | 10 +- plugins/model/model.cpp | 36 +-- plugins/shaders/shaders.cpp | 28 +- plugins/vfspk3/archive.cpp | 10 +- plugins/vfspk3/vfs.cpp | 34 +- radiant/brush.h | 413 ++++++++++++------------ radiant/brush_primit.cpp | 6 - radiant/brushmanip.cpp | 17 +- radiant/brushmodule.cpp | 10 +- radiant/brushnode.h | 12 +- radiant/brushtokens.h | 4 +- radiant/brushxml.h | 8 +- radiant/build.cpp | 62 ++-- radiant/camwindow.cpp | 26 +- radiant/camwindow.h | 2 +- radiant/clippertool.cpp | 1 + radiant/colors.cpp | 1 - radiant/console.cpp | 8 +- radiant/csg.cpp | 26 +- radiant/dialog.cpp | 7 +- radiant/eclass.cpp | 8 +- radiant/eclass_def.cpp | 2 - radiant/eclass_doom3.cpp | 5 +- radiant/eclass_fgd.cpp | 3 +- radiant/eclass_xml.cpp | 2 +- radiant/entity.cpp | 10 +- radiant/entityinspector.cpp | 15 +- radiant/entitylist.cpp | 3 - radiant/feedback.cpp | 1 - radiant/feedback.h | 56 ++-- radiant/filetypes.cpp | 6 +- radiant/filterbar.cpp | 3 +- radiant/filters.cpp | 10 +- radiant/findtexturedialog.cpp | 2 - radiant/glwidget.cpp | 1 - radiant/grid.cpp | 1 - radiant/groupdialog.cpp | 7 - radiant/gtkdlgs.cpp | 6 +- radiant/gtkmisc.cpp | 4 +- radiant/help.cpp | 1 - radiant/image.cpp | 4 +- radiant/layerswindow.cpp | 4 +- radiant/main.cpp | 8 +- radiant/mainframe.cpp | 24 +- radiant/mainframe.h | 1 - radiant/map.cpp | 118 ++++--- radiant/modelwindow.cpp | 83 +++-- radiant/nullmodel.cpp | 22 +- radiant/patch.cpp | 2 +- radiant/patch.h | 98 +++--- radiant/patchmanip.cpp | 9 +- radiant/patchmodule.cpp | 18 +- radiant/plugin.cpp | 4 - radiant/pluginapi.cpp | 9 +- radiant/pluginmanager.cpp | 15 +- radiant/pluginmenu.cpp | 4 +- radiant/plugintoolbar.cpp | 5 +- radiant/points.cpp | 18 +- radiant/preferencedictionary.h | 22 +- radiant/preferences.cpp | 5 - radiant/qe3.cpp | 3 - radiant/referencecache.cpp | 14 +- radiant/renderer.h | 4 +- radiant/renderstate.cpp | 72 ++--- radiant/scenegraph.cpp | 38 ++- radiant/select.cpp | 40 ++- radiant/select.h | 2 +- radiant/selection.cpp | 1 - radiant/server.cpp | 18 +- radiant/surfacedialog.cpp | 13 +- radiant/textures.cpp | 14 +- radiant/texwindow.cpp | 22 +- radiant/treemodel.cpp | 2 - radiant/undo.cpp | 22 +- radiant/view.h | 26 +- radiant/watchbsp.cpp | 4 +- radiant/xywindow.cpp | 22 +- radiant/xywindow.h | 1 - 152 files changed, 1193 insertions(+), 1366 deletions(-) diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp index c3de08ff..9cf4a192 100644 --- a/contrib/bobtoolz/DEntity.cpp +++ b/contrib/bobtoolz/DEntity.cpp @@ -166,7 +166,7 @@ class BrushSelectedVisitor : public SelectionSystem::Visitor public: BrushSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { if ( Node_isBrush( instance.path().top() ) ) { m_functor( instance ); } @@ -198,7 +198,7 @@ class PatchSelectedVisitor : public SelectionSystem::Visitor public: PatchSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { if ( Node_isPatch( instance.path().top() ) ) { m_functor( instance ); } @@ -310,7 +310,7 @@ bool DEntity::LoadFromEntity( scene::Node& ent, const LoadOptions options ) { load_brushes_t( DEntity* entity, const LoadOptions options ) : m_entity( entity ), m_options( options ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if( !( m_options.loadVisibleOnly && !node.visible() ) ){ scene::Path path( NodeReference( GlobalSceneGraph().root() ) ); path.push( NodeReference( *m_entity->QER_Entity ) ); @@ -447,7 +447,7 @@ void DEntity::LoadEPairList( Entity *epl ){ load_epairs_t( DEntity* entity ) : m_entity( entity ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { if ( strcmp( key, "classname" ) == 0 ) { m_entity->SetClassname( value ); } diff --git a/contrib/bobtoolz/DMap.cpp b/contrib/bobtoolz/DMap.cpp index 06bf8530..25a13fde 100644 --- a/contrib/bobtoolz/DMap.cpp +++ b/contrib/bobtoolz/DMap.cpp @@ -116,7 +116,7 @@ void DMap::LoadAll( const LoadOptions options ){ load_entities_t( DMap* map, const LoadOptions options ) : m_map( map ), m_options( options ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( Node_isEntity( node ) && !( m_options.loadVisibleOnly && !node.visible() ) ) { m_map->AddEntity( "", 0 )->LoadFromEntity( node, m_options ); } diff --git a/contrib/bobtoolz/DTrainDrawer.h b/contrib/bobtoolz/DTrainDrawer.h index 54ad75cf..e530ec93 100644 --- a/contrib/bobtoolz/DTrainDrawer.h +++ b/contrib/bobtoolz/DTrainDrawer.h @@ -64,9 +64,9 @@ public: DTrainDrawer(); virtual ~DTrainDrawer( void ); - void render( RenderStateFlags state ) const; - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const; - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const; + void render( RenderStateFlags state ) const override; + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override; + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override; void constructShaders(); void destroyShaders(); diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index 0b3db222..77307568 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -190,7 +190,7 @@ std::size_t ToolbarButtonCount( void ) { class CBobtoolzToolbarButton : public IToolbarButton { public: - virtual const char* getImage() const { + virtual const char* getImage() const override { switch ( mIndex ) { case 0: return "bobtoolz_cleanup.png"; case 1: return "bobtoolz_poly.png"; @@ -209,7 +209,7 @@ public: } return NULL; } - virtual EType getType() const { + virtual EType getType() const override { switch ( mIndex ) { case 2: return eSpace; case 3: return eToggleButton; @@ -218,7 +218,7 @@ public: default: return eButton; } } - virtual const char* getText() const { + virtual const char* getText() const override { switch ( mIndex ) { case 0: return "Cleanup"; case 1: return "Polygons"; @@ -234,7 +234,7 @@ public: } return NULL; } - virtual const char* getTooltip() const { + virtual const char* getTooltip() const override { switch ( mIndex ) { case 0: return "Brush Cleanup"; case 1: return "Polygons"; @@ -251,7 +251,7 @@ public: return NULL; } - virtual void activate() const { + virtual void activate() const override { LoadLists(); switch ( mIndex ) { diff --git a/contrib/bobtoolz/funchandlers-GTK.cpp b/contrib/bobtoolz/funchandlers-GTK.cpp index 2c133085..159003b9 100644 --- a/contrib/bobtoolz/funchandlers-GTK.cpp +++ b/contrib/bobtoolz/funchandlers-GTK.cpp @@ -881,10 +881,10 @@ public: ExplodeWalker( scene::Node* entitynode, scene::Cloneable* entitycloneable, scene::Traversable* traversableroot ) : m_entitynode( entitynode ), m_entitycloneable( entitycloneable ), m_traversableroot( traversableroot ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { NodeSmartReference clone( m_entitycloneable->clone() ); // duplicate entity m_traversableroot->insert( clone ); diff --git a/contrib/brushexport/export.cpp b/contrib/brushexport/export.cpp index 9678f25f..4e8ab830 100644 --- a/contrib/brushexport/export.cpp +++ b/contrib/brushexport/export.cpp @@ -166,7 +166,7 @@ public: weld( _weld ){ } - bool WriteToFile( const std::string& path, collapsemode mode ) const; + bool WriteToFile( const std::string& path, collapsemode mode ) const override; }; bool ExportDataAsWavefront::WriteToFile( const std::string& path, collapsemode mode ) const { @@ -338,7 +338,7 @@ public: : exporter( _exporter ) {} - void visit( Face& face ) const { + void visit( Face& face ) const override { if( face.contributes() ) exporter.AddBrushFace( face ); } @@ -354,7 +354,7 @@ public: : exporter( _exporter ) {} - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { BrushInstance* bptr = InstanceTypeCast::cast( instance ); if ( bptr ) { Brush& brush( bptr->getBrush() ); diff --git a/contrib/meshtex/GeneralFunctionDialog.h b/contrib/meshtex/GeneralFunctionDialog.h index 82627492..4afd7697 100644 --- a/contrib/meshtex/GeneralFunctionDialog.h +++ b/contrib/meshtex/GeneralFunctionDialog.h @@ -55,7 +55,7 @@ private: // private types const MeshEntity::RefSliceDescriptor *refCol, bool surfaceValues); private: - bool Execute(MeshEntity& meshEntity) const; + bool Execute(MeshEntity& meshEntity) const override; private: const MeshEntity::GeneralFunctionFactors *_sFactors; const MeshEntity::GeneralFunctionFactors *_tFactors; @@ -70,7 +70,7 @@ public: // public methods GeneralFunctionDialog(const std::string& key); ~GeneralFunctionDialog(); - bool Apply(); + bool Apply() override; private: // private member vars diff --git a/contrib/meshtex/GetInfoDialog.h b/contrib/meshtex/GetInfoDialog.h index 1a5d180e..c04b4d81 100644 --- a/contrib/meshtex/GetInfoDialog.h +++ b/contrib/meshtex/GetInfoDialog.h @@ -56,7 +56,7 @@ private: // private types const MeshEntity::TexInfoCallback *rowTexInfoCallback, const MeshEntity::TexInfoCallback *colTexInfoCallback); private: - bool Execute(MeshEntity& meshEntity) const; + bool Execute(MeshEntity& meshEntity) const override; private: const int *_refRow; const int *_refCol; @@ -69,7 +69,7 @@ public: // public methods GetInfoDialog(const std::string& key, SmartPointer& setScaleDialog); ~GetInfoDialog(); - bool Apply(); + bool Apply() override; private: // private member vars diff --git a/contrib/meshtex/MainMenu.h b/contrib/meshtex/MainMenu.h index 1fa9ad69..7b38b1fd 100644 --- a/contrib/meshtex/MainMenu.h +++ b/contrib/meshtex/MainMenu.h @@ -54,7 +54,7 @@ private: // private types PresetFuncVisitor(const VisitorFunctor& visitorFunctor, MeshEntity::TextureAxisSelection axes); private: - bool Execute(MeshEntity& meshEntity) const; + bool Execute(MeshEntity& meshEntity) const override; private: const VisitorFunctor _visitorFunctor; diff --git a/contrib/meshtex/MeshVisitor.h b/contrib/meshtex/MeshVisitor.h index 8dc674f7..917ba837 100644 --- a/contrib/meshtex/MeshVisitor.h +++ b/contrib/meshtex/MeshVisitor.h @@ -45,7 +45,7 @@ public: // public methods virtual ~MeshVisitor(); void ResetVisitedCount(); unsigned GetVisitedCount(); - void visit(scene::Instance& instance) const; + void visit(scene::Instance& instance) const override; protected: // protected methods diff --git a/contrib/meshtex/SetScaleDialog.h b/contrib/meshtex/SetScaleDialog.h index 5f97d83a..53f219fc 100644 --- a/contrib/meshtex/SetScaleDialog.h +++ b/contrib/meshtex/SetScaleDialog.h @@ -76,7 +76,7 @@ private: // private types SetScaleVisitor(const SliceArgs *rowArgs, const SliceArgs *colArgs); private: - bool Execute(MeshEntity& meshEntity) const; + bool Execute(MeshEntity& meshEntity) const override; private: const SliceArgs *_rowArgs; const SliceArgs *_colArgs; @@ -86,7 +86,7 @@ public: // public methods SetScaleDialog(const std::string& key); ~SetScaleDialog(); - bool Apply(); + bool Apply() override; void PopulateSWidgets(float scale, float tiles); void PopulateTWidgets(float scale, diff --git a/contrib/prtview/portals.h b/contrib/prtview/portals.h index 43293a7b..3061ec49 100644 --- a/contrib/prtview/portals.h +++ b/contrib/prtview/portals.h @@ -110,20 +110,20 @@ class CPortalsDrawSolid : public OpenGLRenderable { public: mutable CubicClipVolume clip; - void render( RenderStateFlags state ) const; + void render( RenderStateFlags state ) const override; }; class CPortalsDrawSolidOutline : public OpenGLRenderable { public: mutable CubicClipVolume clip; - void render( RenderStateFlags state ) const; + void render( RenderStateFlags state ) const override; }; class CPortalsDrawWireframe : public OpenGLRenderable { public: - void render( RenderStateFlags state ) const; + void render( RenderStateFlags state ) const override; }; class CPortalsRender : public Renderable @@ -133,8 +133,8 @@ public: CPortalsDrawSolidOutline m_drawSolidOutline; CPortalsDrawWireframe m_drawWireframe; - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const; - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const; + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override; + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override; }; extern CPortals portals; diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index f732e149..1813fa71 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -143,7 +143,7 @@ public: EntityFindByClassname( const char* name, Entity*& entity ) : m_name( name ), m_entity( entity ){ m_entity = 0; } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_entity == 0 ) { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 diff --git a/contrib/ufoaiplug/ufoai_filters.cpp b/contrib/ufoaiplug/ufoai_filters.cpp index ff5af6df..b4e59e1d 100644 --- a/contrib/ufoaiplug/ufoai_filters.cpp +++ b/contrib/ufoaiplug/ufoai_filters.cpp @@ -61,7 +61,7 @@ public: EntityFindByName( const char* name, entitylist_t& entitylist, int flag, bool hide ) : m_name( name ), m_entitylist( entitylist ), m_flag( flag ), m_hide( hide ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { int spawnflagsInt; Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 ) { @@ -97,7 +97,7 @@ public: m_surfaceFlagsVis = -1; } - void visit( Face& face ) const { + void visit( Face& face ) const override { #if _DEBUG if ( m_surfaceFlagsVis < 0 ) { m_surfaceFlagsVis = face.getShader().m_flags.m_surfaceFlags; @@ -131,7 +131,7 @@ public: BrushGetLevel( brushlist_t& brushlist, int flag, bool content, bool notset, bool hide ) : m_brushlist( brushlist ), m_flag( flag ), m_content( content ), m_notset( notset ), m_hide( hide ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Brush* brush = Node_getBrush( path.top() ); if ( brush != 0 ) { ForEachFace faces; diff --git a/contrib/ufoaiplug/ufoai_gtk.cpp b/contrib/ufoaiplug/ufoai_gtk.cpp index 5c9b8801..079f466c 100644 --- a/contrib/ufoaiplug/ufoai_gtk.cpp +++ b/contrib/ufoaiplug/ufoai_gtk.cpp @@ -44,7 +44,7 @@ std::size_t ToolbarNoButtons( void ){ class CUFOAIToolbarButton : public IToolbarButton { public: - virtual const char* getImage() const { + virtual const char* getImage() const override { switch ( mIndex ) { case 0: return "ufoai_level1.png"; @@ -62,7 +62,7 @@ public: } return NULL; } - virtual EType getType() const { + virtual EType getType() const override { switch ( mIndex ) { /* case 3: return eButton;*/ @@ -73,7 +73,7 @@ public: default: return eButton; } } - virtual const char* getText() const { + virtual const char* getText() const override { switch ( mIndex ) { case 0: return "Level 1"; @@ -91,7 +91,7 @@ public: } return NULL; } - virtual const char* getTooltip() const { + virtual const char* getTooltip() const override { switch ( mIndex ) { case 0: return "Show only level 1"; @@ -110,7 +110,7 @@ public: return NULL; } - virtual void activate() const { + virtual void activate() const override { switch ( mIndex ) { case 0: filter_level( CONTENTS_LEVEL1 ); break; diff --git a/contrib/ufoaiplug/ufoai_level.cpp b/contrib/ufoaiplug/ufoai_level.cpp index 0ae2a112..9f5576b9 100644 --- a/contrib/ufoaiplug/ufoai_level.cpp +++ b/contrib/ufoaiplug/ufoai_level.cpp @@ -40,7 +40,7 @@ public: EntityFindByClassname( const char* name, Entity*& entity ) : m_name( name ), m_entity( entity ){ m_entity = 0; } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_entity == 0 ) { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && string_equal( m_name, entity->getClassName() ) ) { @@ -72,7 +72,7 @@ class EntityFindFlags : public scene::Graph::Walker public: EntityFindFlags( const char *classname, const char *flag, int *count ) : m_classname( classname ), m_flag( flag ), m_count( count ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && string_equal( m_classname, entity->getClassName() ) && !entity->hasKeyValue( m_flag ) ) { ( *m_count )++; @@ -94,7 +94,7 @@ class EntityFindTeams : public scene::Graph::Walker public: EntityFindTeams( const char *classname, int *count, int *team ) : m_classname( classname ), m_count( count ), m_team( team ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && string_equal( m_classname, entity->getClassName() ) ) { if ( m_count ) { diff --git a/include/ientity.h b/include/ientity.h index 935f4138..b81207cb 100644 --- a/include/ientity.h +++ b/include/ientity.h @@ -77,7 +77,7 @@ public: : m_entity( entity ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { if ( !string_equal( key, "classname" ) ) { m_entity.setKeyValue( key, value ); } diff --git a/include/iscenegraph.h b/include/iscenegraph.h index b33cc8b6..f62656c6 100644 --- a/include/iscenegraph.h +++ b/include/iscenegraph.h @@ -189,7 +189,7 @@ public: /// \brief Returns a copy of itself. virtual scene::Node& clone() const = 0; }; -} +} // namespace scene #include "modulesystem.h" diff --git a/include/itextstream.h b/include/itextstream.h index 1bae69ee..eae4e5cd 100644 --- a/include/itextstream.h +++ b/include/itextstream.h @@ -67,7 +67,7 @@ inline TextOutputStream& operator<<( TextOutputStream& ostream, const T& t ){ class NullOutputStream : public TextOutputStream { public: - std::size_t write( const char*, std::size_t length ){ + std::size_t write( const char*, std::size_t length ) override { return length; } }; diff --git a/libs/archivelib.h b/libs/archivelib.h index b61c63f3..48c2ab40 100644 --- a/libs/archivelib.h +++ b/libs/archivelib.h @@ -74,7 +74,7 @@ class BinaryToTextInputStream : public TextInputStream public: BinaryToTextInputStream( BinaryInputStreamType& inputStream ) : m_inputStream( inputStream ){ } - std::size_t read( char* buffer, std::size_t length ){ + std::size_t read( char* buffer, std::size_t length ) override{ char* p = buffer; for (;; ) { @@ -180,16 +180,16 @@ public: return m_istream.failed(); } - void release(){ + void release() override { delete this; } - size_type size() const { + size_type size() const override { return m_size; } - const char* getName() const { + const char* getName() const override { return m_name.c_str(); } - InputStream& getInputStream(){ + InputStream& getInputStream() override { return m_istream; } }; @@ -208,13 +208,13 @@ public: return m_inputStream.failed(); } - void release(){ + void release() override { delete this; } const char* getName() const { return m_name.c_str(); } - TextInputStream& getInputStream(){ + TextInputStream& getInputStream() override { return m_inputStream; } }; diff --git a/libs/debugging/debugging.h b/libs/debugging/debugging.h index 3781c53f..7b220d2a 100644 --- a/libs/debugging/debugging.h +++ b/libs/debugging/debugging.h @@ -59,10 +59,10 @@ public: class NullDebugMessageHandler : public NullOutputStream, public DebugMessageHandler { public: - virtual TextOutputStream& getOutputStream(){ + TextOutputStream& getOutputStream() override { return *this; } - virtual bool handleMessage(){ + bool handleMessage() override { return false; } }; @@ -70,10 +70,10 @@ public: class DefaultDebugMessageHandler : public DebugMessageHandler { public: - virtual TextOutputStream& getOutputStream(){ + TextOutputStream& getOutputStream() override { return globalErrorStream(); } - virtual bool handleMessage(){ + bool handleMessage() override { #if defined( _DEBUG ) return false; // send debug-break #else diff --git a/libs/eclasslib.h b/libs/eclasslib.h index fe8d9134..7e250176 100644 --- a/libs/eclasslib.h +++ b/libs/eclasslib.h @@ -24,13 +24,12 @@ #include #include #include -#include #include #include "ieclass.h" #include "irender.h" -#include "math/vector.h" +#include "generic/vector.h" #include "string/string.h" typedef Vector3 Colour3; diff --git a/libs/entitylib.h b/libs/entitylib.h index ed41ca2e..0b043e3e 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -93,7 +93,7 @@ public: : m_origin( origin ), m_angles( angles ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { Matrix4 mat = matrix4_rotation_for_euler_xyz_degrees( m_angles ); arrow_draw( m_origin, matrix4_transformed_direction( mat, Vector3( 1, 0, 0 ) ), matrix4_transformed_direction( mat, Vector3( 0, 1, 0 ) ), matrix4_transformed_direction( mat, Vector3( 0, 0, 1 ) ) ); } @@ -281,7 +281,7 @@ class RenderableSolidAABB : public OpenGLRenderable public: RenderableSolidAABB( const AABB& aabb ) : m_aabb( aabb ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { aabb_draw_solid( m_aabb, state ); } }; @@ -292,7 +292,7 @@ class RenderableWireframeAABB : public OpenGLRenderable public: RenderableWireframeAABB( const AABB& aabb ) : m_aabb( aabb ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { aabb_draw_wire( m_aabb ); } }; diff --git a/libs/entityxml.h b/libs/entityxml.h index c3b2b96f..483734d7 100644 --- a/libs/entityxml.h +++ b/libs/entityxml.h @@ -32,14 +32,14 @@ public: entity_import( Entity& entity ) : m_entity( entity ){ } - void pushElement( const XMLElement& element ){ + void pushElement( const XMLElement& element ) override { if ( strcmp( element.name(), "epair" ) == 0 ) { m_entity.setKeyValue( element.attribute( "key" ), element.attribute( "value" ) ); } } - void popElement( const char* name ){ + void popElement( const char* name ) override { } - std::size_t write( const char* data, std::size_t length ){ + std::size_t write( const char* data, std::size_t length ) override { return length; } }; @@ -52,7 +52,7 @@ class entity_export : public XMLExporter public: ExportXMLVisitor( XMLImporter& importer ) : m_importer( importer ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { StaticElement element( "epair" ); element.insertAttribute( "key", key ); element.insertAttribute( "value", value ); @@ -66,7 +66,7 @@ class entity_export : public XMLExporter public: entity_export( const Entity& entity ) : m_entity( entity ){ } - void exportXML( XMLImporter& observer ){ + void exportXML( XMLImporter& observer ) override { ExportXMLVisitor visitor( observer ); m_entity.forEachKeyValue( visitor ); diff --git a/libs/gtkutil/filechooser.cpp b/libs/gtkutil/filechooser.cpp index f0d82a12..96de5bc5 100644 --- a/libs/gtkutil/filechooser.cpp +++ b/libs/gtkutil/filechooser.cpp @@ -73,7 +73,7 @@ public: return m_types.size(); } - void addType( const char* moduleName, filetype_t type ){ + void addType( const char* moduleName, filetype_t type ) override { m_types.push_back( filetype_pair_t( moduleName, type ) ); } }; diff --git a/libs/gtkutil/glfont.cpp b/libs/gtkutil/glfont.cpp index 37dd80fb..99b203aa 100644 --- a/libs/gtkutil/glfont.cpp +++ b/libs/gtkutil/glfont.cpp @@ -110,7 +110,7 @@ public: gl().glDeleteLists( m_displayList, 128 ); gl().glDeleteTextures( 1, &m_atlas ); } - void printString( const char *s ){ + void printString( const char *s ) override { GLboolean rasterPosValid; gl().glGetBooleanv( GL_CURRENT_RASTER_POSITION_VALID, &rasterPosValid ); if( !rasterPosValid ) @@ -150,7 +150,7 @@ public: gl().glPopMatrix(); } - void renderString( const char *s, const GLuint& tex, const unsigned char colour[3], unsigned int& out_wid, unsigned int& out_hei ){ + void renderString( const char *s, const GLuint& tex, const unsigned char colour[3], unsigned int& out_wid, unsigned int& out_hei ) override { // proper way would be using painter.metrics, however this requires it being active()... // same for painter.boundingRect() + result is not correct wrt width for some reason const QRect rect = m_metrics.boundingRect( s ); @@ -400,13 +400,13 @@ public: out_hei = hei; } } - int getPixelAscent() const { + int getPixelAscent() const override { return m_pixelAscent; } - int getPixelDescent() const { + int getPixelDescent() const override { return m_pixelDescent; } - int getPixelHeight() const { + int getPixelHeight() const override { return m_pixelHeight; } }; diff --git a/libs/imagelib.h b/libs/imagelib.h index c9f7c8f6..18c98e00 100644 --- a/libs/imagelib.h +++ b/libs/imagelib.h @@ -47,16 +47,16 @@ public: delete[] pixels; } - void release(){ + void release() override { delete this; } - byte* getRGBAPixels() const { + byte* getRGBAPixels() const override { return reinterpret_cast( pixels ); } - unsigned int getWidth() const { + unsigned int getWidth() const override { return width; } - unsigned int getHeight() const { + unsigned int getHeight() const override { return height; } }; @@ -71,13 +71,13 @@ public: RGBAImage( _width, _height ), m_surfaceFlags( surfaceFlags ), m_contentFlags( contentFlags ), m_value( value ){ } - int getSurfaceFlags() const { + int getSurfaceFlags() const override { return m_surfaceFlags; } - int getContentFlags() const { + int getContentFlags() const override { return m_contentFlags; } - int getValue() const { + int getValue() const override { return m_value; } }; @@ -115,7 +115,7 @@ public: PointerInputStream( const byte* pointer ) : m_read( pointer ){ } - std::size_t read( byte* buffer, std::size_t length ){ + std::size_t read( byte* buffer, std::size_t length ) override { const byte* end = m_read + length; while ( m_read != end ) { diff --git a/libs/instancelib.h b/libs/instancelib.h index 62910007..7baf6d90 100644 --- a/libs/instancelib.h +++ b/libs/instancelib.h @@ -39,7 +39,7 @@ public: InstanceSubgraphWalker( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* parent ) : m_observer( observer ), m_path( path ), m_parent( parent ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { m_path.push( makeReference( node ) ); scene::Instance* instance = Node_getInstantiable( node )->create( m_path, m_parent.top() ); m_observer->insert( instance ); @@ -47,7 +47,7 @@ public: m_parent.push( instance ); return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { m_path.pop(); m_parent.pop(); } @@ -61,11 +61,11 @@ public: UninstanceSubgraphWalker( scene::Instantiable::Observer* observer, const scene::Path& parent ) : m_observer( observer ), m_path( parent ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { m_path.push( makeReference( node ) ); return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { scene::Instance* instance = Node_getInstantiable( node )->erase( m_observer, m_path ); m_observer->erase( instance ); delete instance; @@ -93,14 +93,14 @@ public: } // traverse observer - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { for ( iterator i = begin(); i != end(); ++i ) { Node_traverseSubgraph( child, InstanceSubgraphWalker( ( *i ).first.first, ( *i ).first.second, ( *i ).second ) ); ( *i ).second->boundsChanged(); } } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { for ( iterator i = begin(); i != end(); ++i ) { Node_traverseSubgraph( child, UninstanceSubgraphWalker( ( *i ).first.first, ( *i ).first.second ) ); diff --git a/libs/maplib.h b/libs/maplib.h index 45352c64..40fd8c66 100644 --- a/libs/maplib.h +++ b/libs/maplib.h @@ -42,12 +42,12 @@ public: : m_name( name ){ } - const char* name() const { + const char* name() const override { return m_name.c_str(); } - void attach( const NameCallback& callback ){ + void attach( const NameCallback& callback ) override { } - void detach( const NameCallback& callback ){ + void detach( const NameCallback& callback ) override { } }; @@ -84,42 +84,42 @@ public: } push(); } - void clear(){ + void clear() override { m_size = 0; m_changed(); //print(); } - void begin(){ + void begin() override { m_pending = Pending( &UndoFileChangeTracker::pushOperation ); } - void undo(){ + void undo() override { m_pending = Pending( &UndoFileChangeTracker::pop ); } - void redo(){ + void redo() override { m_pending = Pending( &UndoFileChangeTracker::push ); } - void changed(){ + void changed() override { if ( m_pending != 0 ) { ( ( *this ).*m_pending )(); m_pending = 0; } } - void save(){ + void save() override { m_saved = m_size; m_changed(); } - bool saved() const { + bool saved() const override { return m_saved == m_size; } - void setChangedCallback( const Callback& changed ){ + void setChangedCallback( const Callback& changed ) override { m_changed = changed; m_changed(); } - std::size_t changes() const { + std::size_t changes() const override { return m_size; } }; @@ -181,7 +181,7 @@ public: ~MapRoot(){ } MapRoot( MapRoot&& ) noexcept = default; // no copy: Layers use m_parent pointer - void release(){ + void release() override { GlobalUndoSystem().trackerDetach( m_changeTracker ); m_traverse.detach( this ); @@ -203,10 +203,10 @@ public: } } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } @@ -214,17 +214,17 @@ public: // return ( new MapRoot( *this ) )->node(); // } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new Instance( path, parent ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); instanceAttach( path ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { instanceDetach( path ); return m_instances.erase( observer, path ); } diff --git a/libs/modulesystem/modulesmap.h b/libs/modulesystem/modulesmap.h index dd0243cc..dbe3cb04 100644 --- a/libs/modulesystem/modulesmap.h +++ b/libs/modulesystem/modulesmap.h @@ -24,7 +24,6 @@ #include "modulesystem.h" #include "string/string.h" #include -#include template class ModulesMap : public Modules @@ -68,10 +67,10 @@ public: return 0; } - Type* findModule( const char* name ){ + Type* findModule( const char* name ) override { return find( name ); } - void foreachModule( const typename Modules::Visitor& visitor ){ + void foreachModule( const typename Modules::Visitor& visitor ) override { for ( modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i ) { visitor.visit( ( *i ).first.c_str(), *static_cast( Module_getTable( *( *i ).second ) ) ); @@ -87,7 +86,7 @@ public: InsertModules( ModulesMap& modules ) : m_modules( modules ){ } - void visit( const char* name, Module& module ) const { + void visit( const char* name, Module& module ) const override { m_modules.insert( name, module ); } }; diff --git a/libs/pivot.h b/libs/pivot.h index 1090a5b4..d32407b0 100644 --- a/libs/pivot.h +++ b/libs/pivot.h @@ -246,7 +246,7 @@ public: PointVertex( Vertex3f( 0, 0, size ), g_colour_z ), }{} - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { gl().glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex ), &m_vertices->vertex ); gl().glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex ), &m_vertices->colour ); gl().glDrawArrays( GL_LINES, 0, std::size( m_vertices ) ); diff --git a/libs/profile/file.h b/libs/profile/file.h index 52629e95..b4809ca5 100644 --- a/libs/profile/file.h +++ b/libs/profile/file.h @@ -81,10 +81,10 @@ public: virtual ~MemStream(); int refCount; - void IncRef() { + void IncRef() override { refCount++; } - void DecRef() { + void DecRef() override { refCount--; if ( refCount <= 0 ) { delete this; @@ -102,28 +102,28 @@ protected: void GrowFile( size_type nNewLen ); public: - position_type GetPosition() const; - int Seek( offset_type lOff, int nFrom ); - void SetLength( size_type nNewLen ); - size_type GetLength() const; + position_type GetPosition() const override; + int Seek( offset_type lOff, int nFrom ) override; + void SetLength( size_type nNewLen ) override; + size_type GetLength() const override; unsigned char* GetBuffer() const { return m_pBuffer; } - size_type read( byte_type* buffer, size_type length ); - size_type write( const byte_type* buffer, size_type length ); + size_type read( byte_type* buffer, size_type length ) override; + size_type write( const byte_type* buffer, size_type length ) override; - char* ReadString( char* pBuf, size_type nMax ); - int GetChar(); + char* ReadString( char* pBuf, size_type nMax ) override; + int GetChar() override; - int PutChar( int c ); - void printf( const char*, ... ); ///< \todo implement on MemStream + int PutChar( int c ) override; + void printf( const char*, ... ) override; ///< \todo implement on MemStream - void Abort(); - void Flush(); - void Close(); + void Abort() override; + void Flush() override; + void Close() override; bool Open( const char *filename, const char *mode ); }; @@ -134,10 +134,10 @@ public: virtual ~FileStream(); int refCount; - void IncRef() { + void IncRef() override { refCount++; } - void DecRef() { + void DecRef() override { refCount--; if ( refCount <= 0 ) { delete this; @@ -150,22 +150,22 @@ protected: bool m_bCloseOnDelete; public: - position_type GetPosition() const; - int Seek( offset_type lOff, int nFrom ); - void SetLength( size_type nNewLen ); - size_type GetLength() const; + position_type GetPosition() const override; + int Seek( offset_type lOff, int nFrom ) override; + void SetLength( size_type nNewLen ) override; + size_type GetLength() const override; - size_type read( byte_type* buffer, size_type length ); - size_type write( const byte_type* buffer, size_type length ); + size_type read( byte_type* buffer, size_type length ) override; + size_type write( const byte_type* buffer, size_type length ) override; - char* ReadString( char* pBuf, size_type nMax ); - int GetChar(); + char* ReadString( char* pBuf, size_type nMax ) override; + int GetChar() override; - int PutChar( int c ); - void printf( const char*, ... ); ///< completely matches the usual printf behaviour + int PutChar( int c ) override; + void printf( const char*, ... ) override; ///< completely matches the usual printf behaviour - void Abort(); - void Flush(); - void Close(); + void Abort() override; + void Flush() override; + void Close() override; bool Open( const char *filename, const char *mode ); }; diff --git a/libs/render.h b/libs/render.h index 10f937cc..f62d0a53 100644 --- a/libs/render.h +++ b/libs/render.h @@ -863,7 +863,7 @@ public: RenderablePointArray( const Array& array, GLenum mode ) : m_array( array ), m_mode( mode ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { #define NV_DRIVER_BUG 0 #if NV_DRIVER_BUG gl().glColorPointer( 4, GL_UNSIGNED_BYTE, 0, 0 ); @@ -884,7 +884,7 @@ public: : m_mode( mode ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { pointvertex_gl_array( &m_vector.front() ); gl().glDrawArrays( m_mode, 0, GLsizei( m_vector.size() ) ); } @@ -916,7 +916,7 @@ public: : m_mode( mode ), m_vertices( vertices ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { pointvertex_gl_array( m_vertices.data() ); gl().glDrawArrays( m_mode, 0, m_vertices.size() ); } @@ -932,7 +932,7 @@ public: : m_mode( mode ), m_indices( indices ), m_vertices( vertices ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { #if 1 pointvertex_gl_array( m_vertices.data() ); gl().glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() ); @@ -965,7 +965,7 @@ public: RenderableDepthTestedPointArray( Array& array, GLenum mode ) : m_array( array ), m_mode( mode ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { if( state & RENDER_COLOURWRITE ){ // render depending on visibility for( auto& p : m_array ){ GLuint sampleCount; @@ -1287,7 +1287,7 @@ public: tex = 0; } } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { if( tex > 0 ){ gl().glBindTexture( GL_TEXTURE_2D, tex ); //Here we draw the texturemaped quads. diff --git a/libs/scenelib.h b/libs/scenelib.h index 1145eb28..eafa1324 100644 --- a/libs/scenelib.h +++ b/libs/scenelib.h @@ -245,7 +245,7 @@ class NullNode : public Node::Symbiot public: NullNode() : m_node( this, 0, m_casts, nullptr ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ @@ -308,10 +308,10 @@ class delete_all : public scene::Traversable::Walker public: delete_all( scene::Node& parent ) : m_parent( parent ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { Node_getTraversable( m_parent )->erase( node ); } }; @@ -338,7 +338,7 @@ class EntityWalker : public scene::Graph::Walker public: EntityWalker( const Functor& functor ) : functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( Node_isEntity( path.top() ) ) { functor( instance ); return false; @@ -388,10 +388,10 @@ public: ParentBrushes( scene::Node& parent ) : m_parent( parent ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( Node_isPrimitive( node ) ) { Node_getTraversable( m_parent )->insert( node ); } @@ -410,7 +410,7 @@ public: : m_hasBrushes( hasBrushes ){ m_hasBrushes = true; } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( !Node_isPrimitive( node ) ) { m_hasBrushes = false; } @@ -505,13 +505,13 @@ class Instance public: AABBAccumulateWalker( AABB& aabb ) : m_aabb( aabb ), m_depth( 0 ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_depth == 1 ) { aabb_extend_by_aabb_safe( m_aabb, instance.worldAABB() ); } return ++m_depth != 2; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -520,7 +520,7 @@ class Instance class TransformChangedWalker : public scene::Graph::Walker { public: - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { instance.transformChangedLocal(); return true; } @@ -529,7 +529,7 @@ class Instance class ParentSelectedChangedWalker : public scene::Graph::Walker { public: - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { instance.parentSelectedChanged(); return true; } @@ -543,13 +543,13 @@ class Instance ChildSelectedWalker( bool& childSelected ) : m_childSelected( childSelected ), m_depth( 0 ){ m_childSelected = false; } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_depth == 1 && !m_childSelected ) { m_childSelected = instance.isSelected() || instance.childSelected(); } return ++m_depth != 2; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -765,7 +765,7 @@ class InstanceWalker : public scene::Graph::Walker public: InstanceWalker( const Functor& functor ) : m_functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { //m_functor( instance ); //return true; if ( path.top().get().visible() ) { @@ -786,13 +786,13 @@ class ChildInstanceWalker : public scene::Graph::Walker public: ChildInstanceWalker( const Functor& functor ) : m_functor( functor ), m_depth( 0 ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_depth == 1 ) { m_functor( instance ); } return ++m_depth != 2; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -897,12 +897,12 @@ public: SelectChildren( const scene::Path& root ) : m_path( root ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { m_path.push( makeReference( node ) ); selectPath( m_path, true ); return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { m_path.pop(); } }; @@ -992,11 +992,11 @@ public: void setCountChangedCallback( const Callback& countChanged ){ m_countChanged = countChanged; } - void increment(){ + void increment() override { ++m_count; m_countChanged(); } - void decrement(){ + void decrement() override { --m_count; m_countChanged(); } diff --git a/libs/script/scripttokeniser.h b/libs/script/scripttokeniser.h index b01cee77..c5fa99de 100644 --- a/libs/script/scripttokeniser.h +++ b/libs/script/scripttokeniser.h @@ -340,13 +340,13 @@ public: m_eof = !m_istream.readChar( m_current ); m_token[MAXTOKEN - 1] = '\0'; } - void release(){ + void release() override { delete this; } - void nextLine(){ + void nextLine() override { m_crossline = true; } - const char* getToken(){ + const char* getToken() override { if ( m_unget ) { m_unget = false; return m_token; @@ -354,17 +354,17 @@ public: return fillToken(); } - void ungetToken(){ + void ungetToken() override { ASSERT_MESSAGE( !m_unget, "can't unget more than one token" ); m_unget = true; } - std::size_t getLine() const { + std::size_t getLine() const override { return m_scriptline; } - std::size_t getColumn() const { + std::size_t getColumn() const override { return m_scriptcolumn; } - bool bufferContains( const char* str ){ + bool bufferContains( const char* str ) override { return m_istream.bufferContains( str ); } }; diff --git a/libs/script/scripttokenwriter.h b/libs/script/scripttokenwriter.h index b2f38db1..cade700d 100644 --- a/libs/script/scripttokenwriter.h +++ b/libs/script/scripttokenwriter.h @@ -32,30 +32,30 @@ public: ~SimpleTokenWriter(){ writeSeparator(); } - void release(){ + void release() override { delete this; } - void nextLine(){ + void nextLine() override { m_separator = '\n'; } - void writeToken( const char* token ){ + void writeToken( const char* token ) override { ASSERT_MESSAGE( strchr( token, ' ' ) == 0, "token contains whitespace: " ); writeSeparator(); m_ostream << token; } - void writeString( const char* string ){ + void writeString( const char* string ) override { writeSeparator(); m_ostream << '"' << string << '"'; } - void writeInteger( int i ){ + void writeInteger( int i ) override { writeSeparator(); m_ostream << i; } - void writeUnsigned( std::size_t i ){ + void writeUnsigned( std::size_t i ) override { writeSeparator(); m_ostream << i; } - void writeFloat( double f ){ + void writeFloat( double f ) override { writeSeparator(); m_ostream << Decimal( f ); } diff --git a/libs/stream/filestream.h b/libs/stream/filestream.h index e5c6a615..7d4a4c87 100644 --- a/libs/stream/filestream.h +++ b/libs/stream/filestream.h @@ -63,17 +63,17 @@ public: return m_file == 0; } - size_type read( byte_type* buffer, size_type length ){ + size_type read( byte_type* buffer, size_type length ) override { return fread( buffer, 1, length, m_file ); } - size_type seek( size_type position ){ + size_type seek( size_type position ) override { return fseek( m_file, static_cast( position ), SEEK_SET ); } - size_type seek( offset_type offset, seekdir direction ){ + size_type seek( offset_type offset, seekdir direction ) override { return fseek( m_file, offset, FileStreamDetail::whence_for_seekdir( direction ) ); } - size_type tell() const { + size_type tell() const override { return ftell( m_file ); } @@ -98,7 +98,7 @@ public: m_istream.seek( offset ); } - size_type read( byte_type* buffer, size_type length ){ + size_type read( byte_type* buffer, size_type length ) override { size_type result = m_istream.read( buffer, std::min( length, m_remaining ) ); m_remaining -= result; return result; @@ -127,17 +127,17 @@ public: return m_file == 0; } - size_type write( const byte_type* buffer, size_type length ){ + size_type write( const byte_type* buffer, size_type length ) override { return fwrite( buffer, 1, length, m_file ); } - size_type seek( size_type position ){ + size_type seek( size_type position ) override { return fseek( m_file, static_cast( position ), SEEK_SET ); } - size_type seek( offset_type offset, seekdir direction ){ + size_type seek( offset_type offset, seekdir direction ) override { return fseek( m_file, offset, FileStreamDetail::whence_for_seekdir( direction ) ); } - size_type tell() const { + size_type tell() const override { return ftell( m_file ); } }; diff --git a/libs/stream/memstream.h b/libs/stream/memstream.h index 73a8def2..270def89 100644 --- a/libs/stream/memstream.h +++ b/libs/stream/memstream.h @@ -29,7 +29,7 @@ class BufferOutputStream : public TextOutputStream { std::vector m_buffer; public: - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { m_buffer.insert( m_buffer.end(), buffer, buffer + length ); return length; } @@ -59,7 +59,7 @@ public: BufferInputStream( const char* buffer, std::size_t length ) : m_read( buffer ), m_end( buffer + length ){ } - std::size_t read( char* buffer, std::size_t length ){ + std::size_t read( char* buffer, std::size_t length ) override { std::size_t count = std::min( std::size_t( m_end - m_read ), length ); const char* end = m_read + count; while ( m_read != end ) diff --git a/libs/stream/textfilestream.h b/libs/stream/textfilestream.h index 0697d262..b8dde4d3 100644 --- a/libs/stream/textfilestream.h +++ b/libs/stream/textfilestream.h @@ -42,7 +42,7 @@ public: return m_file == 0; } - std::size_t read( char* buffer, std::size_t length ){ + std::size_t read( char* buffer, std::size_t length ) override { return fread( buffer, 1, length, m_file ); } }; @@ -65,7 +65,7 @@ public: return m_file == 0; } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { return fwrite( buffer, 1, length, m_file ); } }; diff --git a/libs/stream/textstream.h b/libs/stream/textstream.h index 33ac51be..acf910c5 100644 --- a/libs/stream/textstream.h +++ b/libs/stream/textstream.h @@ -396,7 +396,7 @@ public: } *m_pos++ = c; } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { const char*const end = buffer + length; for ( const char* p = buffer; p != end; ++p ) { diff --git a/libs/transformlib.h b/libs/transformlib.h index 5d3fd79d..3feed538 100644 --- a/libs/transformlib.h +++ b/libs/transformlib.h @@ -40,7 +40,7 @@ class IdentityTransform : public TransformNode { public: /// \brief Returns the identity matrix. - const Matrix4& localToParent() const { + const Matrix4& localToParent() const override { return g_matrix4_identity; } }; @@ -57,7 +57,7 @@ public: return m_localToParent; } /// \brief Returns the stored local->parent transform. - const Matrix4& localToParent() const { + const Matrix4& localToParent() const override { return m_localToParent; } }; diff --git a/libs/traverselib.h b/libs/traverselib.h index 7c62b8a3..9619b0c9 100644 --- a/libs/traverselib.h +++ b/libs/traverselib.h @@ -176,7 +176,7 @@ public: m_observer = 0; } /// \brief \copydoc scene::Traversable::insert() - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableNodeSet::insert: sanity check failed" ); m_undo.save(); @@ -189,7 +189,7 @@ public: } } /// \brief \copydoc scene::Traversable::erase() - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableNodeSet::erase: sanity check failed" ); m_undo.save(); @@ -202,7 +202,7 @@ public: m_children.erase( NodeSmartReference( node ) ); } /// \brief \copydoc scene::Traversable::traverse() - void traverse( const Walker& walker ){ + void traverse( const Walker& walker ) override { UnsortedNodeSet::iterator i = m_children.begin(); while ( i != m_children.end() ) { @@ -213,7 +213,7 @@ public: } } /// \brief \copydoc scene::Traversable::empty() - bool empty() const { + bool empty() const override { return m_children.empty(); } @@ -256,7 +256,7 @@ public: } m_observer = 0; } - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { ASSERT_MESSAGE( m_node == 0, "TraversableNode::insert - element already exists" ); m_node = &node; @@ -266,7 +266,7 @@ public: m_observer->insert( node ); } } - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { ASSERT_MESSAGE( m_node == &node, "TraversableNode::erase - failed to find element" ); if ( m_observer != 0 ) { @@ -276,12 +276,12 @@ public: m_node = 0; node.DecRef(); } - void traverse( const scene::Traversable::Walker& walker ){ + void traverse( const scene::Traversable::Walker& walker ) override { if ( m_node != 0 ) { Node_traverseSubgraph( *m_node, walker ); } } - bool empty() const { + bool empty() const override { return m_node != 0; } @@ -319,10 +319,10 @@ public: class TraversableObserverPairRelay : public ReferencePair, public scene::Traversable::Observer { public: - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { forEach( TraversableObserverInsert( node ) ); } - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { forEach( TraversableObserverErase( node ) ); } }; @@ -351,10 +351,10 @@ public: class TraversableObserverRelay : public ReferenceSet, public scene::Traversable::Observer { public: - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { forEach( TraversableObserverInsert( node ) ); } - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { forEach( TraversableObserverErase( node ) ); } }; diff --git a/libs/undolib.h b/libs/undolib.h index ea0ce39e..33d5c51b 100644 --- a/libs/undolib.h +++ b/libs/undolib.h @@ -34,7 +34,7 @@ public: : m_data( data ){ } - void release(){ + void release() override { delete this; } @@ -85,10 +85,10 @@ public: } } - UndoMemento* exportState() const { + UndoMemento* exportState() const override { return new BasicUndoMemento( m_object ); } - void importState( const UndoMemento* state ){ + void importState( const UndoMemento* state ) override { save(); m_importCallback( ( static_cast*>( state ) )->get() ); } @@ -127,10 +127,10 @@ public: } } - UndoMemento* exportState() const { + UndoMemento* exportState() const override { return new BasicUndoMemento( m_object ); } - void importState( const UndoMemento* state ){ + void importState( const UndoMemento* state ) override { save(); m_object = ( static_cast*>( state ) )->get(); } diff --git a/libs/xml/xmlelement.h b/libs/xml/xmlelement.h index 4bbd5163..273976a6 100644 --- a/libs/xml/xmlelement.h +++ b/libs/xml/xmlelement.h @@ -38,10 +38,10 @@ public: void insertAttribute( const char* name, const char* value ){ m_attrs.insert( attrs_t::value_type( name, value ) ); } - const char* name() const { + const char* name() const override { return m_name; } - const char* attribute( const char* name ) const { + const char* attribute( const char* name ) const override { attrs_t::const_iterator i = m_attrs.find( name ); if ( i != m_attrs.end() ) { return i->second; @@ -50,7 +50,7 @@ public: return ""; } } - void forEachAttribute( XMLAttrVisitor& visitor ) const { + void forEachAttribute( XMLAttrVisitor& visitor ) const override { for ( attrs_t::const_iterator i = m_attrs.begin(); i != m_attrs.end(); ++i ) { visitor.visit( i->first, i->second ); @@ -72,10 +72,10 @@ public: void insertAttribute( const char* name, const char* value ){ m_attrs.insert( attrs_t::value_type( name, value ) ); } - const char* name() const { + const char* name() const override { return m_name.c_str(); } - const char* attribute( const char* name ) const { + const char* attribute( const char* name ) const override { attrs_t::const_iterator i = m_attrs.find( name ); if ( i != m_attrs.end() ) { return i->second.c_str(); @@ -84,7 +84,7 @@ public: return ""; } } - void forEachAttribute( XMLAttrVisitor& visitor ) const { + void forEachAttribute( XMLAttrVisitor& visitor ) const override { for ( attrs_t::const_iterator i = m_attrs.begin(); i != m_attrs.end(); ++i ) { visitor.visit( i->first.c_str(), i->second.c_str() ); diff --git a/libs/xml/xmlparser.h b/libs/xml/xmlparser.h index 38128722..703cc139 100644 --- a/libs/xml/xmlparser.h +++ b/libs/xml/xmlparser.h @@ -35,10 +35,10 @@ public: SAXElement( const char* name, const char** atts ) : m_name( name ), m_atts( atts ){ } - const char* name() const { + const char* name() const override { return m_name; } - const char* attribute( const char* name ) const { + const char* attribute( const char* name ) const override { if ( m_atts != 0 ) { for ( const char** att = m_atts; *att != 0; att += 2 ) { @@ -49,7 +49,7 @@ public: } return ""; } - void forEachAttribute( XMLAttrVisitor& visitor ) const { + void forEachAttribute( XMLAttrVisitor& visitor ) const override { if ( m_atts != 0 ) { for ( const char** att = m_atts; *att != 0; att += 2 ) { @@ -184,7 +184,7 @@ public: XMLStreamParser( TextInputStream& istream ) : m_istream( istream ){ } - virtual void exportXML( XMLImporter& importer ){ + virtual void exportXML( XMLImporter& importer ) override { //bool wellFormed = false; char chars[1024]; diff --git a/libs/xml/xmlwriter.h b/libs/xml/xmlwriter.h index e699e417..d671c812 100644 --- a/libs/xml/xmlwriter.h +++ b/libs/xml/xmlwriter.h @@ -129,7 +129,7 @@ public: m_ostream.write( '>' ); } - void pushElement( const XMLElement& element ){ + void pushElement( const XMLElement& element ) override { if ( m_elements.back().m_state == state_t::eStartElement ) { m_elements.back().m_state = state_t::eContent; m_ostream.write( '>' ); @@ -141,7 +141,7 @@ public: write_string( element.name() ); element.forEachAttribute( *this ); } - void popElement( const char* name ){ + void popElement( const char* name ) override { if ( m_elements.back().m_state == state_t::eStartElement ) { m_ostream.write( '/' ); m_ostream.write( '>' ); @@ -156,7 +156,7 @@ public: m_elements.pop_back(); } } - std::size_t write( const char* data, std::size_t length ){ + std::size_t write( const char* data, std::size_t length ) override { if ( m_elements.back().m_state == state_t::eStartElement ) { m_elements.back().m_state = state_t::eContent; m_ostream.write( '>' ); @@ -165,7 +165,7 @@ public: return length; } - void visit( const char* name, const char* value ){ + void visit( const char* name, const char* value ) override { m_ostream.write( ' ' ); write_string( name ); m_ostream.write( '=' ); diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp index 49e56485..2679f3eb 100644 --- a/plugins/archivepak/archive.cpp +++ b/plugins/archivepak/archive.cpp @@ -108,10 +108,10 @@ public: delete i->second.file(); } - void release(){ + void release() override { delete this; } - ArchiveFile* openFile( const char* name ){ + ArchiveFile* openFile( const char* name ) override { PakFileSystem::iterator i = m_filesystem.find( name ); if ( i != m_filesystem.end() && !i->second.is_directory() ) { PakRecord* file = i->second.file(); @@ -119,7 +119,7 @@ public: } return 0; } - virtual ArchiveTextFile* openTextFile( const char* name ){ + virtual ArchiveTextFile* openTextFile( const char* name ) override { PakFileSystem::iterator i = m_filesystem.find( name ); if ( i != m_filesystem.end() && !i->second.is_directory() ) { PakRecord* file = i->second.file(); @@ -127,11 +127,11 @@ public: } return 0; } - bool containsFile( const char* name ){ + bool containsFile( const char* name ) override { PakFileSystem::iterator i = m_filesystem.find( name ); return i != m_filesystem.end() && !i->second.is_directory(); } - void forEachFile( VisitorFunc visitor, const char* root ){ + void forEachFile( VisitorFunc visitor, const char* root ) override { m_filesystem.traverse( visitor, root ); } }; diff --git a/plugins/archivewad/archive.cpp b/plugins/archivewad/archive.cpp index 8d3a3d79..5c899885 100644 --- a/plugins/archivewad/archive.cpp +++ b/plugins/archivewad/archive.cpp @@ -128,27 +128,27 @@ public: } } - void release(){ + void release() override { delete this; } - ArchiveFile* openFile( const char* name ){ + ArchiveFile* openFile( const char* name ) override { files_t::iterator i = m_files.find( name ); if ( i != m_files.end() ) { return StoredArchiveFile::create( name, m_name.c_str(), i->second.m_position, i->second.m_stream_size, i->second.m_file_size ); } return 0; } - virtual ArchiveTextFile* openTextFile( const char* name ){ + virtual ArchiveTextFile* openTextFile( const char* name ) override { files_t::iterator i = m_files.find( name ); if ( i != m_files.end() ) { return StoredArchiveTextFile::create( name, m_name.c_str(), i->second.m_position, i->second.m_stream_size ); } return 0; } - bool containsFile( const char* name ){ + bool containsFile( const char* name ) override { return m_files.contains( name ); } - void forEachFile( VisitorFunc visitor, const char* root ){ + void forEachFile( VisitorFunc visitor, const char* root ) override { if ( root[0] == '\0' ) { if ( visitor.directory( "textures/", 1 ) ) { return; diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp index 1d4ec786..e18de7e7 100644 --- a/plugins/archivezip/archive.cpp +++ b/plugins/archivezip/archive.cpp @@ -47,16 +47,16 @@ public: : m_name( name ), m_istream( archiveName ), m_substream( m_istream, position, stream_size ), m_zipstream( m_substream ), m_size( file_size ){ } - void release(){ + void release() override { delete this; } - size_type size() const { + size_type size() const override { return m_size; } - const char* getName() const { + const char* getName() const override { return m_name.c_str(); } - InputStream& getInputStream(){ + InputStream& getInputStream() override { return m_zipstream; } }; @@ -76,10 +76,10 @@ public: : m_name( name ), m_istream( archiveName ), m_substream( m_istream, position, stream_size ), m_zipstream( m_substream ), m_textStream( m_zipstream ){ } - void release(){ + void release() override { delete this; } - TextInputStream& getInputStream(){ + TextInputStream& getInputStream() override { return m_textStream; } }; @@ -213,10 +213,10 @@ public: return m_istream.failed(); } - void release(){ + void release() override { delete this; } - ArchiveFile* openFile( const char* name ){ + ArchiveFile* openFile( const char* name ) override { ZipFileSystem::iterator i = m_filesystem.find( name ); if ( i != m_filesystem.end() && !i->second.is_directory() ) { ZipRecord* file = i->second.file(); @@ -239,7 +239,7 @@ public: } return 0; } - ArchiveTextFile* openTextFile( const char* name ){ + ArchiveTextFile* openTextFile( const char* name ) override { ZipFileSystem::iterator i = m_filesystem.find( name ); if ( i != m_filesystem.end() && !i->second.is_directory() ) { ZipRecord* file = i->second.file(); @@ -262,11 +262,11 @@ public: } return 0; } - bool containsFile( const char* name ){ + bool containsFile( const char* name ) override { ZipFileSystem::iterator i = m_filesystem.find( name ); return i != m_filesystem.end() && !i->second.is_directory(); } - void forEachFile( VisitorFunc visitor, const char* root ){ + void forEachFile( VisitorFunc visitor, const char* root ) override { m_filesystem.traverse( visitor, root ); } }; diff --git a/plugins/archivezip/zlibstream.h b/plugins/archivezip/zlibstream.h index 2997dd50..94999da7 100644 --- a/plugins/archivezip/zlibstream.h +++ b/plugins/archivezip/zlibstream.h @@ -47,7 +47,7 @@ public: ~DeflatedInputStream(){ inflateEnd( &m_zipstream ); } - size_type read( byte_type* buffer, size_type length ){ + size_type read( byte_type* buffer, size_type length ) override { m_zipstream.next_out = buffer; m_zipstream.avail_out = static_cast( length ); while ( m_zipstream.avail_out != 0 ) diff --git a/plugins/assmodel/model.cpp b/plugins/assmodel/model.cpp index c74b6559..99f2f29a 100644 --- a/plugins/assmodel/model.cpp +++ b/plugins/assmodel/model.cpp @@ -101,7 +101,7 @@ public: ReleaseShader(); } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { if ( ( state & RENDER_BUMP ) != 0 ) { gl().glNormalPointer( GL_FLOAT, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->normal ); gl().glVertexAttribPointer( c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->texcoord ); @@ -398,11 +398,11 @@ public: return m_surfaces.size(); } - VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const override { return test.TestAABB( m_aabb_local, localToWorld ); } - virtual const AABB& localAABB() const { + const AABB& localAABB() const override { return m_aabb_local; } @@ -539,7 +539,7 @@ public: } } } - void skinChanged(){ + void skinChanged() override { destroyRemaps(); constructRemaps(); } @@ -580,23 +580,23 @@ public: } } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_lightList->evaluateLights(); render( renderer, volume, Instance::localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { renderSolid( renderer, volume ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_picomodel.testSelect( selector, test, Instance::localToWorld() ); } - bool testLight( const RendererLight& light ) const { + bool testLight( const RendererLight& light ) const override { return light.testAABB( worldAABB() ); } - void insertLight( const RendererLight& light ){ + void insertLight( const RendererLight& light ) override { const Matrix4& localToWorld = Instance::localToWorld(); SurfaceLightLists::iterator j = m_surfaceLightLists.begin(); for ( PicoModel::const_iterator i = m_picomodel.begin(); i != m_picomodel.end(); ++i ) @@ -604,7 +604,7 @@ public: Surface_addLight( *( *i ), *j++, localToWorld, light ); } } - void clearLights(){ + void clearLights() override { for ( SurfaceLightLists::iterator i = m_surfaceLightLists.begin(); i != m_surfaceLightLists.end(); ++i ) { ( *i ).clear(); @@ -639,23 +639,23 @@ public: PicoModelNode( const AssScene scene ) : m_node( this, this, StaticTypeCasts::instance().get(), nullptr ), m_picomodel( scene ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new PicoModelInstance( path, parent, m_picomodel ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/assmodel/plugin.cpp b/plugins/assmodel/plugin.cpp index 2eb624db..504d15c3 100644 --- a/plugins/assmodel/plugin.cpp +++ b/plugins/assmodel/plugin.cpp @@ -215,7 +215,7 @@ class PicoModelLoader : public ModelLoader public: PicoModelLoader(){ } - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadPicoModel( *s_assImporter, file ); } }; diff --git a/plugins/entity/curve.h b/plugins/entity/curve.h index 3742cf8f..5f84d022 100644 --- a/plugins/entity/curve.h +++ b/plugins/entity/curve.h @@ -25,8 +25,6 @@ #include "selectable.h" #include "renderable.h" -#include - #include "math/curve.h" #include "stream/stringstream.h" #include "signal/signal.h" @@ -38,7 +36,7 @@ class RenderableCurve : public OpenGLRenderable { public: std::vector m_vertices; - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { pointvertex_gl_array( &m_vertices.front() ); gl().glDrawArrays( GL_LINE_STRIP, 0, GLsizei( m_vertices.size() ) ); } diff --git a/plugins/entity/doom3group.cpp b/plugins/entity/doom3group.cpp index 4677ec38..bbc55cd0 100644 --- a/plugins/entity/doom3group.cpp +++ b/plugins/entity/doom3group.cpp @@ -46,7 +46,6 @@ #include "targetable.h" #include "origin.h" -#include "angle.h" #include "rotation.h" #include "model.h" #include "filters.h" @@ -344,7 +343,7 @@ public: m_traverseObservers.detach( *observer ); } - const AABB& localAABB() const { + const AABB& localAABB() const override { m_curveBounds = m_curveNURBS.m_bounds; aabb_extend_by_aabb_safe( m_curveBounds, m_curveCatmullRom.m_bounds ); return m_curveBounds; @@ -394,7 +393,7 @@ public: void rotate( const Quaternion& rotation ){ rotation_rotate( m_rotation, rotation ); } - void snapto( float snap ){ + void snapto( float snap ) override { m_originKey.m_origin = origin_snapped( m_originKey.m_origin, snap ); m_originKey.write( &m_entity ); } @@ -487,26 +486,26 @@ public: m_contained.m_curveNURBS.disconnect( m_contained.m_curveNURBSChanged ); m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childSelected(), Instance::childBounds() ); m_curveNURBS.renderComponentsSelected( renderer, volume, localToWorld() ); m_curveCatmullRom.renderComponentsSelected( renderer, volume, localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childSelected(), Instance::childBounds() ); m_curveNURBS.renderComponentsSelected( renderer, volume, localToWorld() ); m_curveCatmullRom.renderComponentsSelected( renderer, volume, localToWorld() ); } - void renderComponents( Renderer& renderer, const VolumeTest& volume ) const { + void renderComponents( Renderer& renderer, const VolumeTest& volume ) const override { if ( GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex ) { m_curveNURBS.renderComponents( renderer, volume, localToWorld() ); m_curveCatmullRom.renderComponents( renderer, volume, localToWorld() ); } } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { test.BeginMesh( localToWorld() ); SelectionIntersection best; @@ -517,23 +516,23 @@ public: } } - bool isSelectedComponents() const { + bool isSelectedComponents() const override { return m_curveNURBS.isSelected() || m_curveCatmullRom.isSelected(); } - void setSelectedComponents( bool selected, SelectionSystem::EComponentMode mode ){ + void setSelectedComponents( bool selected, SelectionSystem::EComponentMode mode ) override { if ( mode == SelectionSystem::eVertex ) { m_curveNURBS.setSelected( selected ); m_curveCatmullRom.setSelected( selected ); } } - void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ){ + void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ) override { if ( mode == SelectionSystem::eVertex ) { test.BeginMesh( localToWorld() ); m_curveNURBS.testSelect( selector, test ); m_curveCatmullRom.testSelect( selector, test ); } } - void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const { + void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const override { } void transformComponents( const Matrix4& matrix ){ @@ -545,7 +544,7 @@ public: } } - const AABB& getSelectedComponentsBounds() const { + const AABB& getSelectedComponentsBounds() const override { m_aabb_component = AABB(); m_curveNURBS.forEachSelected( [&]( const Vector3& point ){ aabb_extend_by_point_safe( m_aabb_component, point ); @@ -555,10 +554,10 @@ public: }); return m_aabb_component; } - void gatherSelectedComponents( const Vector3Callback& callback ) const { + void gatherSelectedComponents( const Vector3Callback& callback ) const override { } - void snapComponents( float snap ){ + void snapComponents( float snap ) override { if ( m_curveNURBS.isSelected() ) { m_curveNURBS.snapto( snap ); m_curveNURBS.write( curve_Nurbs, m_contained.getEntity() ); @@ -674,34 +673,34 @@ public: destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new Doom3GroupNode( *this ) )->node(); } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new Doom3GroupInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/eclassmodel.cpp b/plugins/entity/eclassmodel.cpp index dcf697ee..05b548ba 100644 --- a/plugins/entity/eclassmodel.cpp +++ b/plugins/entity/eclassmodel.cpp @@ -278,7 +278,7 @@ public: m_angles[0] = m_angles[1] = 0; } } - void snapto( float snap ){ + void snapto( float snap ) override { m_originKey.m_origin = origin_snapped( m_originKey.m_origin, snap ); m_originKey.write( &m_entity ); } @@ -349,10 +349,10 @@ public: m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } @@ -453,34 +453,34 @@ public: ~EclassModelNode(){ destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new EclassModelNode( *this ) )->node(); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new EclassModelInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/entity.cpp b/plugins/entity/entity.cpp index 4b3f7054..5c68c4f9 100644 --- a/plugins/entity/entity.cpp +++ b/plugins/entity/entity.cpp @@ -294,7 +294,7 @@ class filter_entity_classname : public EntityFilter public: filter_entity_classname( const char* classname ) : m_classname( classname ){ } - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return string_equal( entity.getClassName(), m_classname ); } }; @@ -306,7 +306,7 @@ class filter_entity_classgroup : public EntityFilter public: filter_entity_classgroup( const char* classgroup ) : m_classgroup( classgroup ), m_length( string_length( m_classgroup ) ){ } - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return string_equal_n( entity.getClassName(), m_classgroup, m_length ); } }; @@ -320,7 +320,7 @@ filter_entity_classgroup g_filter_entity_path( "path_" ); class filter_entity_misc_model : public EntityFilter { public: - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return entity.getEntityClass().miscmodel_is; } }; @@ -329,7 +329,7 @@ filter_entity_misc_model g_filter_entity_misc_model; class filter_entity_doom3model : public EntityFilter { public: - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return string_equal( entity.getClassName(), "func_static" ) && !string_equal( entity.getKeyValue( "model" ), entity.getKeyValue( "name" ) ); } @@ -341,7 +341,7 @@ filter_entity_doom3model g_filter_entity_doom3model; class filter_entity_not_func_detail : public EntityFilter { public: - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return entity.isContainer() && !string_equal_n( entity.getClassName(), "func_detail", 11 ); } @@ -352,7 +352,7 @@ filter_entity_not_func_detail g_filter_entity_not_func_detail; class filter_entity_world : public EntityFilter { public: - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { const char* value = entity.getClassName(); return string_equal( value, "worldspawn" ) || string_equal( value, "func_group" ) @@ -365,7 +365,7 @@ filter_entity_world g_filter_entity_world; class filter_entity_point : public EntityFilter { public: - bool filter( const Entity& entity ) const { + bool filter( const Entity& entity ) const override { return !entity.isContainer() && !entity.getEntityClass().miscmodel_is && !string_equal_prefix( entity.getClassName(), "light" ); diff --git a/plugins/entity/filters.h b/plugins/entity/filters.h index ddf41511..e485102f 100644 --- a/plugins/entity/filters.h +++ b/plugins/entity/filters.h @@ -55,7 +55,7 @@ public: GlobalFilterSystem().unregisterFilterable( *this ); } - void updateFiltered(){ + void updateFiltered() override { if ( entity_filtered( m_entity ) ) { m_node.enable( scene::Node::eFiltered ); } diff --git a/plugins/entity/generic.cpp b/plugins/entity/generic.cpp index 83a1ccbc..43ab514a 100644 --- a/plugins/entity/generic.cpp +++ b/plugins/entity/generic.cpp @@ -188,11 +188,11 @@ public: return m_transform; } - const AABB& localAABB() const { + const AABB& localAABB() const override { return m_aabb_local; } - VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const override { return volume.TestAABB( localAABB(), localToWorld ); } @@ -235,7 +235,7 @@ public: void rotate( const Quaternion& rotation ){ m_angles = angles_rotated( m_angles, rotation ); } - void snapto( float snap ){ + void snapto( float snap ) override { m_originKey.m_origin = origin_snapped( m_originKey.m_origin, snap ); m_originKey.write( &m_entity ); } @@ -312,14 +312,14 @@ public: m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_contained.testSelect( selector, test, Instance::localToWorld() ); } @@ -398,27 +398,27 @@ public: m_node( this, this, StaticTypeCasts::instance().get(), other.m_node.m_layer ), m_contained( other.m_contained, m_node, InstanceSet::TransformChangedCaller( m_instances ), InstanceSetEvaluateTransform::Caller( m_instances ) ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new GenericEntityNode( *this ) )->node(); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new GenericEntityInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/group.cpp b/plugins/entity/group.cpp index 0e5aff4f..6a14f46e 100644 --- a/plugins/entity/group.cpp +++ b/plugins/entity/group.cpp @@ -345,10 +345,10 @@ public: StaticRenderableConnectionLines::instance().detach( *this ); m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childSelected(), Instance::childBounds() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childSelected(), Instance::childBounds() ); } @@ -462,34 +462,34 @@ public: destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new GroupNode( *this ) )->node(); } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new GroupInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/keyobservers.h b/plugins/entity/keyobservers.h index 0941d01f..d19db0c1 100644 --- a/plugins/entity/keyobservers.h +++ b/plugins/entity/keyobservers.h @@ -32,13 +32,13 @@ public: void insert( const char* key, const KeyObserver& observer ){ m_keyObservers.insert( KeyObservers::value_type( key, observer ) ); } - void insert( const char* key, EntityKeyValue& value ){ + void insert( const char* key, EntityKeyValue& value ) override { for ( KeyObservers::const_iterator i = m_keyObservers.find( key ); i != m_keyObservers.end() && string_equal( ( *i ).first, key ); ++i ) { value.attach( ( *i ).second ); } } - void erase( const char* key, EntityKeyValue& value ){ + void erase( const char* key, EntityKeyValue& value ) override { for ( KeyObservers::const_iterator i = m_keyObservers.find( key ); i != m_keyObservers.end() && string_equal( ( *i ).first, key ); ++i ) { value.detach( ( *i ).second ); diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index f7d94a25..2af5f5fc 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -892,7 +892,7 @@ public: RenderLightRadiiWire( LightRadii& radii, const Vector3& origin ) : m_radii( radii ), m_origin( origin ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { //light_draw_radius_wire( m_origin, m_radii.m_radii ); // draw two practically useful radiuses light_draw_radius_wire( m_origin, m_radii.m_radii_transformed.data() + !m_radii.isLinear(), m_radiiPoints ); @@ -910,7 +910,7 @@ public: RenderLightRadiiFill( LightRadii& radii, const Vector3& origin ) : m_radii( radii ), m_origin( origin ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { //light_draw_radius_fill( m_origin, m_radii.m_radii ); // draw two practically useful radiuses light_draw_radius_fill( m_origin, m_radii.m_radii_transformed.data() + !m_radii.isLinear(), m_radiiPoints ); @@ -928,7 +928,7 @@ public: RenderLightRadiiBox( const Vector3& origin ) : m_origin( origin ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { //draw the bounding box of light based on light_radius key if ( ( state & RENDER_FILL ) != 0 ) { aabb_draw_flatshade( m_points ); @@ -953,7 +953,7 @@ public: RenderLightCenter( const Vector3& center, EntityClass& eclass ) : m_center( center ), m_eclass( eclass ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { gl().glBegin( GL_POINTS ); gl().glColor3fv( vector3_to_array( m_eclass.color ) ); gl().glVertex3fv( vector3_to_array( m_center ) ); @@ -970,7 +970,7 @@ public: RenderLightProjection( const Matrix4& projection ) : m_projection( projection ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { Matrix4 unproject( matrix4_full_inverse( m_projection ) ); std::array points = aabb_corners( AABB( Vector3( 0.5f, 0.5f, 0.5f ), Vector3( 0.5f, 0.5f, 0.5f ) ) ); points[0] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[0], 1 ) ) ); @@ -1414,16 +1414,16 @@ public: m_traverseObservers.detach( *observer ); } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { light_draw( m_aabb_light, state ); } - VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const override { return volume.TestAABB( m_aabb_light, localToWorld ); } // cache - const AABB& localAABB() const { + const AABB& localAABB() const override { return m_aabb_light; } @@ -1503,7 +1503,7 @@ public: void rotate( const Quaternion& rotation ){ rotation_rotate( m_rotation, rotation ); } - void snapto( float snap ){ + void snapto( float snap ) override { if ( g_lightType == LIGHTTYPE_DOOM3 && !m_useLightOrigin && !m_traverse.empty() ) { m_useLightOrigin = true; m_lightOrigin = m_originKey.m_origin; @@ -1579,7 +1579,7 @@ public: typedef MemberCaller TransformChangedCaller; mutable Matrix4 m_localPivot; - const Matrix4& getLocalPivot() const { + const Matrix4& getLocalPivot() const override { m_localPivot = rotation_toMatrix( m_rotation ); m_localPivot.t().vec3() = m_aabb_light.origin; return m_localPivot; @@ -1841,13 +1841,13 @@ public: m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_contained.testSelect( selector, test, Instance::localToWorld() ); } @@ -1890,7 +1890,7 @@ public: } - bool isSelectedComponents() const { + bool isSelectedComponents() const override { if ( g_lightType == LIGHTTYPE_DOOM3 ) { return m_dragPlanes.isSelected(); } @@ -1898,7 +1898,7 @@ public: return m_scaleRadius.isSelected(); } } - void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ){ + void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ) override { if ( mode == SelectionSystem::eFace ) { if ( g_lightType == LIGHTTYPE_DOOM3 ) { m_dragPlanes.setSelected( false ); @@ -1908,9 +1908,9 @@ public: } } } - void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ){ + void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ) override { } - void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const { + void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const override { } void selectedChangedComponent( const Selectable& selectable ){ @@ -1948,29 +1948,29 @@ public: } typedef MemberCaller LightChangedCaller; - Shader* getShader() const { + Shader* getShader() const override { return m_contained.getShader(); } - const AABB& aabb() const { + const AABB& aabb() const override { return m_contained.aabb(); } - bool testAABB( const AABB& other ) const { + bool testAABB( const AABB& other ) const override { return m_contained.testAABB( other ); } - const Matrix4& rotation() const { + const Matrix4& rotation() const override { return m_contained.rotation(); } - const Vector3& offset() const { + const Vector3& offset() const override { return m_contained.offset(); } - const Vector3& colour() const { + const Vector3& colour() const override { return m_contained.colour(); } - bool isProjected() const { + bool isProjected() const override { return m_contained.isProjected(); } - const Matrix4& projection() const { + const Matrix4& projection() const override { return m_contained.projection(); } }; @@ -2061,34 +2061,34 @@ public: destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new LightNode( *this ) )->node(); } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new LightInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/miscmodel.cpp b/plugins/entity/miscmodel.cpp index 610bc108..073889f2 100644 --- a/plugins/entity/miscmodel.cpp +++ b/plugins/entity/miscmodel.cpp @@ -341,7 +341,7 @@ public: #endif //m_angles = vector3_snapped_to_zero( matrix4_get_rotation_euler_xyz_degrees( mat ), ANGLEKEY_SMALLEST ); } - void snapto( float snap ){ + void snapto( float snap ) override { m_originKey.m_origin = origin_snapped( m_originKey.m_origin, snap ); m_originKey.write( &m_entity ); } @@ -402,10 +402,10 @@ public: StaticRenderableConnectionLines::instance().detach( *this ); m_contained.instanceDetach( Instance::path() ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderSolid( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_contained.renderWireframe( renderer, volume, Instance::localToWorld(), getSelectable().isSelected() ); } void evaluateTransform(){ @@ -508,34 +508,34 @@ public: destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new MiscModelNode( *this ) )->node(); } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new MiscModelInstance( path, parent, m_contained ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/entity/model.h b/plugins/entity/model.h index d704dddf..f059b3ed 100644 --- a/plugins/entity/model.h +++ b/plugins/entity/model.h @@ -44,14 +44,14 @@ public: m_resource.detach( *this ); } - void realise(){ + void realise() override { m_resource.get()->load(); m_node = m_resource.get()->getNode(); if ( m_node != 0 ) { m_traverse.insert( *m_node ); } } - void unrealise(){ + void unrealise() override { if ( m_node != 0 ) { m_traverse.erase( *m_node ); } diff --git a/plugins/entity/modelskinkey.h b/plugins/entity/modelskinkey.h index 2eefe957..ceb9d63c 100644 --- a/plugins/entity/modelskinkey.h +++ b/plugins/entity/modelskinkey.h @@ -68,17 +68,17 @@ public: } typedef MemberCaller SkinChangedCaller; - void realise(){ + void realise() override { m_skinChangedCallback(); } - void unrealise(){ + void unrealise() override { } }; class InstanceSkinChanged : public scene::Instantiable::Visitor { public: - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { //\todo don't do this for instances that are not children of the entity setting the skin SkinnedModel* skinned = InstanceTypeCast::cast( instance ); if ( skinned != 0 ) { diff --git a/plugins/entity/namedentity.h b/plugins/entity/namedentity.h index f9f77ea6..5a33d944 100644 --- a/plugins/entity/namedentity.h +++ b/plugins/entity/namedentity.h @@ -56,7 +56,7 @@ class NamedEntity : public Nameable public: NamedEntity( EntityKeyValues& entity ) : m_entity( entity ){ } - const char* name() const { + const char* name() const override { if ( m_name.empty() ) { return m_entity.getClassName(); } @@ -68,10 +68,10 @@ public: const Colour3& color() const { return m_entity.getEntityClass().color; } - void attach( const NameCallback& callback ){ + void attach( const NameCallback& callback ) override { m_changed.insert( callback ); } - void detach( const NameCallback& callback ){ + void detach( const NameCallback& callback ) override { m_changed.erase( callback ); } diff --git a/plugins/entity/namekeys.h b/plugins/entity/namekeys.h index 7f19a618..87d4a4c3 100644 --- a/plugins/entity/namekeys.h +++ b/plugins/entity/namekeys.h @@ -92,7 +92,7 @@ public: ~NameKeys(){ m_entity.detach( *this ); } - void setNamespace( Namespace& space ){ + void setNamespace( Namespace& space ) override { eraseAll(); m_namespace = &space; insertAll(); @@ -102,11 +102,11 @@ public: m_keyIsName = keyIsName; insertAll(); } - void insert( const char* key, EntityKeyValue& value ){ + void insert( const char* key, EntityKeyValue& value ) override { m_keyValues.insert( KeyValues::value_type( key, &value ) ); insertName( key, value ); } - void erase( const char* key, EntityKeyValue& value ){ + void erase( const char* key, EntityKeyValue& value ) override { eraseName( key, value ); m_keyValues.erase( key ); } diff --git a/plugins/entity/origin.h b/plugins/entity/origin.h index 5d706291..da9e5726 100644 --- a/plugins/entity/origin.h +++ b/plugins/entity/origin.h @@ -102,7 +102,7 @@ class SetDoom3GroupOriginWalker : public scene::Traversable::Walker public: SetDoom3GroupOriginWalker( const Vector3& origin ) : m_origin( origin ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { BrushDoom3_setDoom3GroupOrigin( node, m_origin ); return true; } @@ -132,12 +132,12 @@ public: } } - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { if ( m_enabled ) { BrushDoom3_setDoom3GroupOrigin( node, m_origin ); } } - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { if ( m_enabled ) { BrushDoom3_setDoom3GroupOrigin( node, Vector3( 0, 0, 0 ) ); } diff --git a/plugins/entity/skincache.cpp b/plugins/entity/skincache.cpp index 39a29dd0..ab8b377a 100644 --- a/plugins/entity/skincache.cpp +++ b/plugins/entity/skincache.cpp @@ -180,19 +180,19 @@ class Doom3ModelSkinCacheElement final : public ModelSkin public: Doom3ModelSkinCacheElement() : m_skin( 0 ){ } - void attach( ModuleObserver& observer ){ + void attach( ModuleObserver& observer ) override { m_observers.attach( observer ); if ( realised() ) { observer.realise(); } } - void detach( ModuleObserver& observer ){ + void detach( ModuleObserver& observer ) override { if ( realised() ) { observer.unrealise(); } m_observers.detach( observer ); } - bool realised() const { + bool realised() const override { return m_skin != 0; } void realise( const char* name ){ @@ -205,11 +205,11 @@ public: m_observers.unrealise(); m_skin = 0; } - const char* getRemap( const char* name ) const { + const char* getRemap( const char* name ) const override { ASSERT_MESSAGE( realised(), "Doom3ModelSkinCacheElement::getRemap: not realised" ); return m_skin->getRemap( name ); } - void forEachRemap( const SkinRemapCallback& callback ) const { + void forEachRemap( const SkinRemapCallback& callback ) const override { ASSERT_MESSAGE( realised(), "Doom3ModelSkinCacheElement::forEachRemap: not realised" ); m_skin->forEachRemap( callback ); } @@ -257,17 +257,17 @@ public: GlobalFileSystem().detach( *this ); } - ModelSkin& capture( const char* name ){ + ModelSkin& capture( const char* name ) override { return *m_cache.capture( name ); } - void release( const char* name ){ + void release( const char* name ) override { m_cache.release( name ); } bool realised() const { return m_realised; } - void realise(){ + void realise() override { g_skins.realise(); m_realised = true; for ( Cache::iterator i = m_cache.begin(); i != m_cache.end(); ++i ) @@ -275,7 +275,7 @@ public: ( *i ).value->realise( ( *i ).key.c_str() ); } } - void unrealise(){ + void unrealise() override { m_realised = false; for ( Cache::iterator i = m_cache.begin(); i != m_cache.end(); ++i ) { diff --git a/plugins/entity/targetable.h b/plugins/entity/targetable.h index b0327175..4c5db27a 100644 --- a/plugins/entity/targetable.h +++ b/plugins/entity/targetable.h @@ -265,7 +265,7 @@ public: m_targetsChanged(); } - void insert( const char* key, EntityKeyValue& value ){ + void insert( const char* key, EntityKeyValue& value ) override { std::size_t index; if ( readTargetKey( key, index ) ) { TargetingEntities::iterator i = m_targetingEntities.insert( TargetingEntities::value_type( index, TargetingEntity() ) ).first; @@ -273,7 +273,7 @@ public: targetsChanged(); } } - void erase( const char* key, EntityKeyValue& value ){ + void erase( const char* key, EntityKeyValue& value ) override { std::size_t index; if ( readTargetKey( key, index ) ) { TargetingEntities::iterator i = m_targetingEntities.find( index ); @@ -378,18 +378,18 @@ public: m_targeting.targetsChanged(); } - void insert( const char* key, EntityKeyValue& value ){ + void insert( const char* key, EntityKeyValue& value ) override { if ( string_equal( key, g_targetable_nameKey ) ) { value.attach( TargetedEntity::TargetnameChangedCaller( m_targeted ) ); } } - void erase( const char* key, EntityKeyValue& value ){ + void erase( const char* key, EntityKeyValue& value ) override { if ( string_equal( key, g_targetable_nameKey ) ) { value.detach( TargetedEntity::TargetnameChangedCaller( m_targeted ) ); } } - const Vector3& world_position() const { + const Vector3& world_position() const override { #if 1 const AABB& bounds = Instance::worldAABB(); if ( aabb_valid( bounds ) ) { @@ -431,7 +431,7 @@ public: ASSERT_MESSAGE( erased, "cannot detach instance" ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { if( g_showConnections ){ for ( TargetableInstances::const_iterator i = m_instances.begin(); i != m_instances.end(); ++i ) { @@ -441,7 +441,7 @@ public: } } } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { renderSolid( renderer, volume ); } }; diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp index ff8bd6ba..6c038a86 100644 --- a/plugins/mapq3/plugin.cpp +++ b/plugins/mapq3/plugin.cpp @@ -83,7 +83,7 @@ public: return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if ( string_equal( primitive, "patchDef3" ) ) { @@ -100,7 +100,7 @@ public: Tokeniser_unexpectedError( tokeniser, primitive, "#doom3-primitive" ); return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); tokeniser.nextLine(); if ( !Tokeniser_parseToken( tokeniser, "Version" ) ) { @@ -118,7 +118,7 @@ public: Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); writer.writeToken( "Version" ); writer.writeInteger( MapVersion ); @@ -154,7 +154,7 @@ public: return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if ( string_equal( primitive, "patchDef3" ) ) { @@ -171,7 +171,7 @@ public: Tokeniser_unexpectedError( tokeniser, primitive, "#quake4-primitive" ); return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); tokeniser.nextLine(); if ( !Tokeniser_parseToken( tokeniser, "Version" ) ) { @@ -189,7 +189,7 @@ public: Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); writer.writeToken( "Version" ); writer.writeInteger( MapVersion ); @@ -242,7 +242,7 @@ public: return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if ( string_equal( primitive, "patchDef2" ) ) { @@ -290,13 +290,13 @@ public: return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); m_formatDetected = false; Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); Map_Write( root, traverse, writer, false ); writer.release(); @@ -323,7 +323,7 @@ public: return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if( !m_formatDetected ){ @@ -367,13 +367,13 @@ public: Tokeniser_unexpectedError( tokeniser, primitive, "#quake-primitive" ); return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); m_formatDetected = false; Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); Map_Write( root, traverse, writer, true ); writer.release(); @@ -399,7 +399,7 @@ public: return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if ( string_equal( primitive, "(" ) ) { @@ -411,12 +411,12 @@ public: Tokeniser_unexpectedError( tokeniser, primitive, "#halflife-primitive" ); return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); Map_Write( root, traverse, writer, true ); writer.release(); @@ -442,7 +442,7 @@ public: MapFormat* getTable(){ return this; } - scene::Node& parsePrimitive( Tokeniser& tokeniser ) const { + scene::Node& parsePrimitive( Tokeniser& tokeniser ) const override { const char* primitive = tokeniser.getToken(); if ( primitive != 0 ) { if( !m_formatDetected ){ @@ -486,13 +486,13 @@ public: Tokeniser_unexpectedError( tokeniser, primitive, "#quake2-primitive" ); return g_nullNode; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewMapTokeniser( inputStream ); m_formatDetected = false; Map_Read( root, tokeniser, entityTable, *this ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter( outputStream ); Map_Write( root, traverse, writer, true ); writer.release(); @@ -635,12 +635,12 @@ public: return this; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser( inputStream ); VMF_Read( root, tokeniser, entityTable ); tokeniser.release(); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { } }; diff --git a/plugins/mapq3/write.cpp b/plugins/mapq3/write.cpp index 46d079e8..15a66dbd 100644 --- a/plugins/mapq3/write.cpp +++ b/plugins/mapq3/write.cpp @@ -70,7 +70,7 @@ void Entity_ExportTokens( const Entity& entity, TokenWriter& writer ){ : m_writer( writer ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { m_writer.writeString( key ); m_writer.writeString( value ); m_writer.nextLine(); @@ -94,7 +94,7 @@ public: layers.update_ownIndices(); Layers_Write( layers, m_writer ); } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { m_stack.push( false ); Entity* entity = Node_getEntity( node ); @@ -135,7 +135,7 @@ public: return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( m_stack.top() ) { m_writer.writeToken( "}" ); m_writer.nextLine(); diff --git a/plugins/mapxml/plugin.cpp b/plugins/mapxml/plugin.cpp index 7208cb18..3386ae59 100644 --- a/plugins/mapxml/plugin.cpp +++ b/plugins/mapxml/plugin.cpp @@ -74,10 +74,10 @@ public: return this; } - void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const { + void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const override { Map_Read( root, inputStream, entityTable ); } - void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const { + void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream ) const override { Map_Write( root, traverse, outputStream ); } }; diff --git a/plugins/mapxml/xmlwrite.cpp b/plugins/mapxml/xmlwrite.cpp index 77fcb2d4..a1f8c561 100644 --- a/plugins/mapxml/xmlwrite.cpp +++ b/plugins/mapxml/xmlwrite.cpp @@ -40,7 +40,7 @@ class write_all : public scene::Traversable::Walker public: write_all( XMLImporter& importer ) : m_importer( importer ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { Entity* entity = Node_getEntity( node ); if ( entity != 0 ) { m_importer.write( "\n", 1 ); @@ -60,7 +60,7 @@ public: } return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( Node_getEntity( node ) != 0 ) { m_importer.write( "\n", 1 ); m_importer.popElement( "entity" ); diff --git a/plugins/md3model/model.h b/plugins/md3model/model.h index c44340e2..eebc10a2 100644 --- a/plugins/md3model/model.h +++ b/plugins/md3model/model.h @@ -48,11 +48,11 @@ public: void clear(){ m_lights.clear(); } - void evaluateLights() const { + void evaluateLights() const override { } - void lightsChanged() const { + void lightsChanged() const override { } - void forEachLight( const RendererLightCallback& callback ) const { + void forEachLight( const RendererLightCallback& callback ) const override { for ( Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i ) { callback( *( *i ) ); @@ -142,7 +142,7 @@ public: } } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { #if 1 if ( ( state & RENDER_BUMP ) != 0 ) { gl().glNormalPointer( GL_FLOAT, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->normal ); @@ -256,11 +256,11 @@ public: } } - VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const override { return test.TestAABB( m_aabb_local, localToWorld ); } - virtual const AABB& localAABB() const { + virtual const AABB& localAABB() const override { return m_aabb_local; } @@ -363,7 +363,7 @@ public: } } } - void skinChanged(){ + void skinChanged() override { ASSERT_MESSAGE( m_skins.size() == m_model.size(), "ERROR" ); destroyRemaps(); constructRemaps(); @@ -402,23 +402,23 @@ public: } } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_lightList->evaluateLights(); render( renderer, volume, Instance::localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { renderSolid( renderer, volume ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_model.testSelect( selector, test, Instance::localToWorld() ); } - bool testLight( const RendererLight& light ) const { + bool testLight( const RendererLight& light ) const override { return light.testAABB( worldAABB() ); } - void insertLight( const RendererLight& light ){ + void insertLight( const RendererLight& light ) override { const Matrix4& localToWorld = Instance::localToWorld(); SurfaceLightLists::iterator j = m_surfaceLightLists.begin(); for ( Model::const_iterator i = m_model.begin(); i != m_model.end(); ++i ) @@ -426,7 +426,7 @@ public: Surface_addLight( *( *i ), *j++, localToWorld, light ); } } - void clearLights(){ + void clearLights() override { for ( SurfaceLightLists::iterator i = m_surfaceLightLists.begin(); i != m_surfaceLightLists.end(); ++i ) { ( *i ).clear(); @@ -463,23 +463,23 @@ public: return m_model; } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new ModelInstance( path, parent, m_model ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/md3model/plugin.cpp b/plugins/md3model/plugin.cpp index 770d1031..930ae9fb 100644 --- a/plugins/md3model/plugin.cpp +++ b/plugins/md3model/plugin.cpp @@ -46,7 +46,7 @@ class MD3ModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadMD3Model( file ); } }; @@ -86,7 +86,7 @@ ModelMD3Module g_ModelMD3Module; class MD2ModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadMD2Model( file ); } }; @@ -113,7 +113,7 @@ ModelMD2Module g_ModelMD2Module; class MDLModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadMDLModel( file ); } }; @@ -140,7 +140,7 @@ ModelMDLModule g_ModelMDLModule; class MDCModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadMDCModel( file ); } }; @@ -188,7 +188,7 @@ ImageMDLModule g_ImageMDLModule; class MD5ModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return loadMD5Model( file ); } }; diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index 0b79ca68..dfa210b5 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -53,11 +53,11 @@ public: void clear(){ m_lights.clear(); } - void evaluateLights() const { + void evaluateLights() const override { } - void lightsChanged() const { + void lightsChanged() const override { } - void forEachLight( const RendererLightCallback& callback ) const { + void forEachLight( const RendererLightCallback& callback ) const override { for ( Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i ) { callback( *( *i ) ); @@ -89,7 +89,7 @@ public: ReleaseShader(); } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { if ( ( state & RENDER_BUMP ) != 0 ) { gl().glNormalPointer( GL_FLOAT, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->normal ); gl().glVertexAttribPointer( c_attr_TexCoord0, 2, GL_FLOAT, 0, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->texcoord ); @@ -337,11 +337,11 @@ public: return m_surfaces.size(); } - VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const override { return test.TestAABB( m_aabb_local, localToWorld ); } - virtual const AABB& localAABB() const { + virtual const AABB& localAABB() const override { return m_aabb_local; } @@ -490,7 +490,7 @@ public: } } } - void skinChanged(){ + void skinChanged() override { destroyRemaps(); constructRemaps(); } @@ -531,23 +531,23 @@ public: } } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_lightList->evaluateLights(); render( renderer, volume, Instance::localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { renderSolid( renderer, volume ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_picomodel.testSelect( selector, test, Instance::localToWorld() ); } - bool testLight( const RendererLight& light ) const { + bool testLight( const RendererLight& light ) const override { return light.testAABB( worldAABB() ); } - void insertLight( const RendererLight& light ){ + void insertLight( const RendererLight& light ) override { const Matrix4& localToWorld = Instance::localToWorld(); SurfaceLightLists::iterator j = m_surfaceLightLists.begin(); for ( PicoModel::const_iterator i = m_picomodel.begin(); i != m_picomodel.end(); ++i ) @@ -555,7 +555,7 @@ public: Surface_addLight( *( *i ), *j++, localToWorld, light ); } } - void clearLights(){ + void clearLights() override { for ( SurfaceLightLists::iterator i = m_surfaceLightLists.begin(); i != m_surfaceLightLists.end(); ++i ) { ( *i ).clear(); @@ -590,23 +590,23 @@ public: PicoModelNode( picoModel_t* model ) : m_node( this, this, StaticTypeCasts::instance().get(), nullptr ), m_picomodel( model ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new PicoModelInstance( path, parent, m_picomodel ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 8a01c0d7..c28d0ba1 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -1716,51 +1716,51 @@ void Shaders_Refresh(){ class Quake3ShaderSystem : public ShaderSystem, public ModuleObserver { public: - void realise(){ + void realise() override { Shaders_Realise(); } - void unrealise(){ + void unrealise() override { Shaders_Unrealise(); } - void refresh(){ + void refresh() override { Shaders_Refresh(); } - IShader* getShaderForName( const char* name ){ + IShader* getShaderForName( const char* name ) override { return Shader_ForName( name ); } - void foreachShaderName( const ShaderNameCallback& callback ){ + void foreachShaderName( const ShaderNameCallback& callback ) override { for ( ShaderDefinitionMap::const_iterator i = g_shaderDefinitions.begin(); i != g_shaderDefinitions.end(); ++i ) { callback( ( *i ).first.c_str() ); } } - void beginActiveShadersIterator(){ + void beginActiveShadersIterator() override { ActiveShaders_IteratorBegin(); } - bool endActiveShadersIterator(){ + bool endActiveShadersIterator() override { return ActiveShaders_IteratorAtEnd(); } - IShader* dereferenceActiveShadersIterator(){ + IShader* dereferenceActiveShadersIterator() override { return ActiveShaders_IteratorCurrent(); } - void incrementActiveShadersIterator(){ + void incrementActiveShadersIterator() override { ActiveShaders_IteratorIncrement(); } - void setActiveShadersChangedNotify( const Callback& notify ){ + void setActiveShadersChangedNotify( const Callback& notify ) override { g_ActiveShadersChangedNotify = notify; } - void attach( ModuleObserver& observer ){ + void attach( ModuleObserver& observer ) override { g_observers.attach( observer ); } - void detach( ModuleObserver& observer ){ + void detach( ModuleObserver& observer ) override { g_observers.detach( observer ); } - void setLightingEnabled( bool enabled ){ + void setLightingEnabled( bool enabled ) override { if ( CShader::m_lightingEnabled != enabled ) { for ( shaders_t::const_iterator i = g_ActiveShaders.begin(); i != g_ActiveShaders.end(); ++i ) { @@ -1774,7 +1774,7 @@ public: } } - const char* getTexturePrefix() const { + const char* getTexturePrefix() const override { return g_texturePrefix; } }; diff --git a/plugins/vfspk3/archive.cpp b/plugins/vfspk3/archive.cpp index d24b941b..0dfab637 100644 --- a/plugins/vfspk3/archive.cpp +++ b/plugins/vfspk3/archive.cpp @@ -47,10 +47,10 @@ public: DirectoryArchive( const char* root ) : m_root( root ){ } - void release(){ + void release() override { delete this; } - virtual ArchiveFile* openFile( const char* name ){ + virtual ArchiveFile* openFile( const char* name ) override { UnixPath path( m_root.c_str() ); path.push_filename( name ); DirectoryArchiveFile* file = new DirectoryArchiveFile( name, path.c_str() ); @@ -60,7 +60,7 @@ public: file->release(); return 0; } - virtual ArchiveTextFile* openTextFile( const char* name ){ + virtual ArchiveTextFile* openTextFile( const char* name ) override { UnixPath path( m_root.c_str() ); path.push_filename( name ); DirectoryArchiveTextFile* file = new DirectoryArchiveTextFile( name, path.c_str() ); @@ -70,12 +70,12 @@ public: file->release(); return 0; } - virtual bool containsFile( const char* name ){ + virtual bool containsFile( const char* name ) override { UnixPath path( m_root.c_str() ); path.push_filename( name ); return file_readable( path.c_str() ); } - virtual void forEachFile( VisitorFunc visitor, const char* root ){ + virtual void forEachFile( VisitorFunc visitor, const char* root ) override { std::vector dirs; UnixPath path( m_root.c_str() ); path.push( root ); diff --git a/plugins/vfspk3/vfs.cpp b/plugins/vfspk3/vfs.cpp index 1992bb52..560035a5 100644 --- a/plugins/vfspk3/vfs.cpp +++ b/plugins/vfspk3/vfs.cpp @@ -155,7 +155,7 @@ public: DirectoryListVisitor( StrList& matches, const char* directory ) : m_matches( matches ), m_directory( directory ) {} - void visit( const char* name ){ + void visit( const char* name ) override { const char* subname = path_make_relative( name, m_directory ); if ( subname != name ) { if ( subname[0] == '/' ) { @@ -179,7 +179,7 @@ public: FileListVisitor( StrList& matches, const char* directory, const char* extension ) : m_matches( matches ), m_directory( directory ), m_extension( extension ) {} - void visit( const char* name ){ + void visit( const char* name ) override { const char* subname = path_make_relative( name, m_directory ); if ( subname != name ) { if ( subname[0] == '/' ) { @@ -519,14 +519,14 @@ const char* FindPath( const char* absolute ){ class Quake3FileSystem : public VirtualFileSystem { public: - void initDirectory( const char *path ){ + void initDirectory( const char *path ) override { InitDirectory( path, FileSystemQ3API_getArchiveModules() ); } - void initialise(){ + void initialise() override { globalOutputStream() << "filesystem initialised\n"; g_observers.realise(); } - void shutdown(){ + void shutdown() override { g_observers.unrealise(); globalOutputStream() << "filesystem shutdown\n"; Shutdown(); @@ -535,20 +535,20 @@ public: int getFileCount( const char *filename, int flags ){ return GetFileCount( filename, flags ); } - ArchiveFile* openFile( const char* filename ){ + ArchiveFile* openFile( const char* filename ) override { return OpenFile( filename ); } - ArchiveTextFile* openTextFile( const char* filename ){ + ArchiveTextFile* openTextFile( const char* filename ) override { return OpenTextFile( filename ); } - std::size_t loadFile( const char *filename, void **buffer ){ + std::size_t loadFile( const char *filename, void **buffer ) override { return LoadFile( filename, buffer, 0 ); } - void freeFile( void *p ){ + void freeFile( void *p ) override { FreeFile( p ); } - void forEachDirectory( const char* basedir, const FileNameCallback& callback, std::size_t depth ){ + void forEachDirectory( const char* basedir, const FileNameCallback& callback, std::size_t depth ) override { StrList list = GetDirList( basedir, depth ); for ( const CopiedString& str : list ) @@ -556,7 +556,7 @@ public: callback( str.c_str() ); } } - void forEachFile( const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth ){ + void forEachFile( const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth ) override { StrList list = GetFileList( basedir, extension, depth ); for ( const CopiedString& str : list ) @@ -575,21 +575,21 @@ public: return GetFileList( basedir, extension, 1 ); } - const char* findFile( const char *name ){ + const char* findFile( const char *name ) override { return FindFile( name ); } - const char* findRoot( const char *name ){ + const char* findRoot( const char *name ) override { return FindPath( name ); } - void attach( ModuleObserver& observer ){ + void attach( ModuleObserver& observer ) override { g_observers.attach( observer ); } - void detach( ModuleObserver& observer ){ + void detach( ModuleObserver& observer ) override { g_observers.detach( observer ); } - Archive* getArchive( const char* archiveName, bool pakonly ){ + Archive* getArchive( const char* archiveName, bool pakonly ) override { for ( archive_entry_t& arch : g_archives ) { if ( pakonly && !arch.is_pakfile ) { @@ -602,7 +602,7 @@ public: } return 0; } - void forEachArchive( const ArchiveNameCallback& callback, bool pakonly, bool reverse ){ + void forEachArchive( const ArchiveNameCallback& callback, bool pakonly, bool reverse ) override { if ( reverse ) { g_archives.reverse(); } diff --git a/radiant/brush.h b/radiant/brush.h index c0ac4671..2c02c137 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -45,8 +45,6 @@ #include "nameable.h" #include "moduleobserver.h" -#include - #include "cullable.h" #include "renderable.h" #include "selectable.h" @@ -285,8 +283,7 @@ typedef ReferencePair FaceShaderObserverPair; class ContentsFlagsValue { public: - ContentsFlagsValue(){ - } + ContentsFlagsValue() = default; ContentsFlagsValue( int surfaceFlags, int contentFlags, int value, bool specified ) : m_surfaceFlags( surfaceFlags ), m_contentFlags( contentFlags ), @@ -333,9 +330,9 @@ public: CopiedString m_shader; ContentsFlagsValue m_flags; - SavedState( const FaceShader& faceShader ){ - m_shader = faceShader.getShader(); - m_flags = faceShader.m_flags; + SavedState( const FaceShader& faceShader ) + : m_shader( faceShader.getShader() ), + m_flags( faceShader.m_flags ){ } void exportState( FaceShader& faceShader ) const { @@ -388,12 +385,12 @@ public: m_state = 0; } - void realise(){ + void realise() override{ ASSERT_MESSAGE( !m_realised, "FaceTexdef::realise: already realised" ); m_realised = true; m_observers.forEach( []( FaceShaderObserver& observer ){ observer.realiseShader(); } ); } - void unrealise(){ + void unrealise() override{ ASSERT_MESSAGE( m_realised, "FaceTexdef::unrealise: already unrealised" ); m_observers.forEach( []( FaceShaderObserver& observer ){ observer.unrealiseShader(); } ); m_realised = false; @@ -476,8 +473,7 @@ public: public: TextureProjection m_projection; - SavedState( const FaceTexdef& faceTexdef ){ - m_projection = faceTexdef.m_projection; + SavedState( const FaceTexdef& faceTexdef ) : m_projection( faceTexdef.m_projection ){ } void exportState( FaceTexdef& faceTexdef ) const { @@ -521,12 +517,12 @@ public: m_projection.m_brushprimit_texdef.removeScale( m_shader.width(), m_shader.height() ); } - void realiseShader(){ + void realiseShader() override{ if ( m_projectionInitialised && !m_scaleApplied ) { addScale(); } } - void unrealiseShader(){ + void unrealiseShader() override{ if ( m_projectionInitialised && m_scaleApplied ) { removeScale(); } @@ -584,7 +580,7 @@ public: Texdef_FitTexture( m_projection, m_shader.width(), m_shader.height(), normal, winding, s_repeat, t_repeat, only_dimension ); } - void emitTextureCoordinates( Winding& winding, const Vector3& normal, const Matrix4& localToWorld ){ + void emitTextureCoordinates( Winding& winding, const Vector3& normal, const Matrix4& localToWorld ) const { Texdef_EmitTextureCoordinates( m_projection, m_shader.width(), m_shader.height(), winding, normal, localToWorld ); } @@ -654,7 +650,7 @@ public: Plane3 m_plane; SavedState( const FacePlane& facePlane ){ - if ( facePlane.isDoom3Plane() ) { + if ( FacePlane::isDoom3Plane() ) { m_plane = facePlane.m_plane; } else @@ -664,7 +660,7 @@ public: } void exportState( FacePlane& facePlane ) const { - if ( facePlane.isDoom3Plane() ) { + if ( FacePlane::isDoom3Plane() ) { facePlane.m_plane = m_plane; facePlane.updateTranslated(); } @@ -921,7 +917,7 @@ class Face : m_texdefState.exportState( face.getTexdef() ); } - void release(){ + void release() override { delete this; } }; @@ -1011,10 +1007,10 @@ public: m_observer->planeChanged(); } - void realiseShader(){ + void realiseShader() override { m_observer->shaderChanged(); } - void unrealiseShader(){ + void unrealiseShader() override { } void instanceAttach( MapFile* map ){ @@ -1031,11 +1027,11 @@ public: m_shader.instanceDetach(); } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { Winding_Draw( m_winding, m_planeTransformed.plane3().normal(), state ); } - void updateFiltered(){ + void updateFiltered() override { m_filtered = face_filtered( *this ); } bool isFiltered() const { @@ -1052,10 +1048,10 @@ public: } // undoable - UndoMemento* exportState() const { + UndoMemento* exportState() const override { return new SavedState( *this ); } - void importState( const UndoMemento* data ){ + void importState( const UndoMemento* data ) override { undoSave(); static_cast( data )->exportState( *this ); @@ -1430,7 +1426,7 @@ struct EdgeFaces class RenderableWireframe : public OpenGLRenderable { public: - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { #if 1 gl().glVertexPointer( 3, GL_FLOAT, sizeof( DepthTestedPointVertex ), &m_vertices->vertex ); gl().glDrawElements( GL_LINES, GLsizei( m_size << 1 ), RenderIndexTypeID, m_faceVertex.data() ); @@ -1539,7 +1535,7 @@ public: return *m_faces[m_faceVertex.getFace()]; } - void testSelect( SelectionTest& test, SelectionIntersection& best ){ + void testSelect( SelectionTest& test, SelectionIntersection& best ) const { test.TestPoint( getVertex(), best ); } }; @@ -1692,31 +1688,31 @@ public: // assignment not supported Brush& operator=( const Brush& other ) = delete; - void setDoom3GroupOrigin( const Vector3& origin ){ + void setDoom3GroupOrigin( const Vector3& origin ) override { //globalOutputStream() << "func_static origin before: " << m_funcStaticOrigin << " after: " << origin << '\n'; - for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( auto& face : m_faces ) { - ( *i )->getPlane().m_funcStaticOrigin = origin; - ( *i )->getPlane().updateTranslated(); - ( *i )->planeChanged(); + face->getPlane().m_funcStaticOrigin = origin; + face->getPlane().updateTranslated(); + face->planeChanged(); } planeChanged(); } void attach( BrushObserver& observer ){ - for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( auto& face : m_faces ) { - observer.push_back( *( *i ) ); + observer.push_back( *face ); } - for ( SelectableEdges::iterator i = m_select_edges.begin(); i != m_select_edges.end(); ++i ) + for ( auto& edge : m_select_edges ) { - observer.edge_push_back( *i ); + observer.edge_push_back( edge ); } - for ( SelectableVertices::iterator i = m_select_vertices.begin(); i != m_select_vertices.end(); ++i ) + for ( auto& vertex : m_select_vertices ) { - observer.vertex_push_back( *i ); + observer.vertex_push_back( vertex ); } m_observers.insert( &observer ); @@ -1726,22 +1722,22 @@ public: } void forEachFace( const BrushVisitor& visitor ) const { - for ( Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( const auto& face : m_faces ) { - visitor.visit( *( *i ) ); + visitor.visit( *face ); } } void forEachFace_instanceAttach( MapFile* map ) const { - for ( Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( const auto& face : m_faces ) { - ( *i )->instanceAttach( map ); + face->instanceAttach( map ); } } void forEachFace_instanceDetach( MapFile* map ) const { - for ( Faces::const_iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( const auto& face : m_faces ) { - ( *i )->instanceDetach( map ); + face->instanceDetach( map ); } } @@ -1769,16 +1765,16 @@ public: } // nameable - const char* name() const { + const char* name() const override { return "brush"; } - void attach( const NameCallback& callback ){ + void attach( const NameCallback& callback ) override { } - void detach( const NameCallback& callback ){ + void detach( const NameCallback& callback ) override { } // filterable - void updateFiltered(){ + void updateFiltered() override { if ( m_node != 0 ) { if ( brush_filtered( *this ) ) { m_node->enable( scene::Node::eFiltered ); @@ -1791,7 +1787,7 @@ public: } // observer - void planeChanged(){ + void planeChanged() override { /* m_BRep_evaluation mutex prevents cyclic dependency: transformModifier.set ; transformChanged() ; planeChanged() ; pivotChanged() ; sceneChangeNotify() ; sceneRender() ; localAABB ; evaluateBRep ; buildBRep() ; evaluateTransform ; !!!problem starts here!!!! planeChanged() ; pivotChanged() ; sceneChangeNotify() ; @@ -1802,7 +1798,7 @@ public: m_lightsChanged(); } } - void shaderChanged(){ + void shaderChanged() override { updateFiltered(); planeChanged(); ///isn't too much for shader changed only? } @@ -1820,25 +1816,25 @@ public: } typedef MemberCaller TransformChangedCaller; - void evaluateTransform(){ + void evaluateTransform() override { if ( m_transformChanged ) { revertTransform(); m_evaluateTransform(); m_transformChanged = false; } } - const Matrix4& localToParent() const { + const Matrix4& localToParent() const override { return g_matrix4_identity; } void aabbChanged(){ m_boundsChanged(); } - const AABB& localAABB() const { + const AABB& localAABB() const override { evaluateBRep(); return m_aabb_local; } - VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const override { return test.TestAABB( m_aabb_local, localToWorld ); } @@ -1870,33 +1866,33 @@ public: } void transform( const Matrix4& matrix ){ - bool mirror = matrix4_handedness( matrix ) == MATRIX4_LEFTHANDED; + const bool mirror = matrix4_handedness( matrix ) == MATRIX4_LEFTHANDED; - for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( auto& face : m_faces ) { - ( *i )->transform( matrix, mirror ); + face->transform( matrix, mirror ); } } - void snapto( float snap ){ - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + void snapto( float snap ) override { + for ( auto *observer : m_observers ) { - ( *i )->vertex_snap( snap ); + observer->vertex_snap( snap ); } -// for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) +// for ( auto& face : m_faces ) // { -// ( *i )->snapto( snap ); +// face->snapto( snap ); // } } void revertTransform(){ - for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( auto& face : m_faces ) { - ( *i )->revertTransform(); + face->revertTransform(); } } void freezeTransform(){ - for ( Faces::iterator i = m_faces.begin(); i != m_faces.end(); ++i ) + for ( auto& face : m_faces ) { - ( *i )->freezeTransform(); + face->freezeTransform(); } m_transformChanged = false; } @@ -1944,9 +1940,9 @@ public: void appendFaces( const Faces& other ){ clear(); - for ( Faces::const_iterator i = other.begin(); i != other.end(); ++i ) + for ( const auto& face : other ) { - push_back( *i ); + push_back( face ); } } @@ -1956,7 +1952,7 @@ public: public: BrushUndoMemento( const Faces& faces ) : m_faces( faces ){ } - void release(){ + void release() override { delete this; } @@ -1972,18 +1968,18 @@ public: } } - UndoMemento* exportState() const { + UndoMemento* exportState() const override { return new BrushUndoMemento( m_faces ); } - void importState( const UndoMemento* state ){ + void importState( const UndoMemento* state ) override { undoSave(); appendFaces( static_cast( state )->m_faces ); planeChanged(); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->DEBUG_verify(); + observer->DEBUG_verify(); } } @@ -2051,9 +2047,9 @@ public: } void reserve( std::size_t count ){ m_faces.reserve( count ); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->reserve( count ); + observer->reserve( count ); } } void push_back( Faces::value_type face ){ @@ -2061,10 +2057,10 @@ public: if ( m_instanceCounter.m_count != 0 ) { m_faces.back()->instanceAttach( m_map ); } - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->push_back( *face ); - ( *i )->DEBUG_verify(); + observer->push_back( *face ); + observer->DEBUG_verify(); } } void pop_back(){ @@ -2072,10 +2068,10 @@ public: m_faces.back()->instanceDetach( m_map ); } m_faces.pop_back(); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->pop_back(); - ( *i )->DEBUG_verify(); + observer->pop_back(); + observer->DEBUG_verify(); } } void erase( std::size_t index ){ @@ -2083,16 +2079,16 @@ public: m_faces[index]->instanceDetach( m_map ); } m_faces.erase( m_faces.begin() + index ); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->erase( index ); - ( *i )->DEBUG_verify(); + observer->erase( index ); + observer->DEBUG_verify(); } } - void connectivityChanged(){ - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + void connectivityChanged() override { + for ( auto *observer : m_observers ) { - ( *i )->connectivityChanged(); + observer->connectivityChanged(); } } @@ -2103,10 +2099,10 @@ public: forEachFace_instanceDetach( m_map ); } m_faces.clear(); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->clear(); - ( *i )->DEBUG_verify(); + observer->clear(); + observer->DEBUG_verify(); } } std::size_t size() const { @@ -2118,13 +2114,7 @@ public: /// \brief Returns true if any face of the brush contributes to the final B-Rep. bool hasContributingFaces() const { - for ( const_iterator i = begin(); i != end(); ++i ) - { - if ( ( *i )->contributes() ) { - return true; - } - } - return false; + return std::ranges::any_of( *this, []( const FaceSmartPointer& face ){ return face->contributes(); } ); } /// \brief Removes faces that do not contribute to the brush. This is useful for cleaning up after CSG operations on the brush. @@ -2214,7 +2204,7 @@ public: #endif } - void update_wireframe( RenderableWireframe& wire, const bool* faces_visible ) const { + void update_wireframe( RenderableWireframe& wire, const bool (&faces_visible)[ c_brush_maxFaces ] ) const { wire.m_faceVertex.resize( m_edge_indices.size() ); wire.m_vertices = m_uniqueVertexPoints.data(); wire.m_size = 0; @@ -2228,7 +2218,7 @@ public: } - void update_faces_wireframe( Array& wire, const bool* faces_visible ) const { + void update_faces_wireframe( Array& wire, const bool (&faces_visible)[ c_brush_maxFaces ] ) const { std::size_t count = 0; for ( std::size_t i = 0; i < m_faceCentroidPoints.size(); ++i ) { @@ -2249,9 +2239,9 @@ public: /// \brief Makes this brush a deep-copy of the \p other. void copy( const Brush& other ){ - for ( Faces::const_iterator i = other.m_faces.begin(); i != other.m_faces.end(); ++i ) + for ( const auto& face : other.m_faces ) { - addFace( *( *i ) ); + addFace( *face ); } planeChanged(); } @@ -2327,30 +2317,30 @@ public: private: void edge_push_back( FaceVertexId faceVertex ){ m_select_edges.push_back( SelectableEdge( m_faces, faceVertex ) ); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->edge_push_back( m_select_edges.back() ); + observer->edge_push_back( m_select_edges.back() ); } } void edge_clear(){ m_select_edges.clear(); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->edge_clear(); + observer->edge_clear(); } } void vertex_push_back( FaceVertexId faceVertex ){ m_select_vertices.push_back( SelectableVertex( m_faces, faceVertex ) ); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->vertex_push_back( m_select_vertices.back() ); + observer->vertex_push_back( m_select_vertices.back() ); } } void vertex_clear(){ m_select_vertices.clear(); - for ( Observers::iterator i = m_observers.begin(); i != m_observers.end(); ++i ) + for ( auto *observer : m_observers ) { - ( *i )->vertex_clear(); + observer->vertex_clear(); } } @@ -2490,10 +2480,10 @@ private: } /// \brief Returns true if the brush is a finite volume. A brush without a finite volume extends past the maximum world bounds and is not valid. - bool isBounded(){ - for ( const_iterator i = begin(); i != end(); ++i ) + bool isBounded(){ // fixme: should return false for 0 faces? + for ( const auto& face : *this ) { - if ( !( *i )->is_bounded() ) { + if ( !face->is_bounded() ) { return false; } } @@ -2506,7 +2496,7 @@ private: { m_aabb_local = AABB(); - if( m_faces.size() ) + if( m_faces.size() != 0 ) m_faces[0]->plane3(); //force evaluateTransform() first, as m_faces is changed during vertexModeTransform for ( std::size_t i = 0; i < m_faces.size(); ++i ) @@ -2524,10 +2514,9 @@ private: windingForClipPlane( f.getWinding(), f.plane3() ); // update brush bounds - const Winding& winding = f.getWinding(); - for ( Winding::const_iterator i = winding.begin(); i != winding.end(); ++i ) + for ( const auto& v : f.getWinding() ) { - aabb_extend_by_point_safe( m_aabb_local, ( *i ).vertex ); + aabb_extend_by_point_safe( m_aabb_local, v.vertex ); } // update texture coordinates @@ -2536,7 +2525,7 @@ private: } } - bool degenerate = !isBounded(); + const bool degenerate = !isBounded(); if ( !degenerate ) { // clean up connectivity information. @@ -2572,9 +2561,9 @@ public: template void foreach( Functor functor ){ - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto *fi : m_faceInstances ) { - functor( *( *i ) ); + functor( *fi ); } } @@ -2637,14 +2626,14 @@ public: void clear(){ m_lights.clear(); } - void evaluateLights() const { + void evaluateLights() const override { } - void lightsChanged() const { + void lightsChanged() const override { } - void forEachLight( const RendererLightCallback& callback ) const { - for ( Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i ) + void forEachLight( const RendererLightCallback& callback ) const override { + for ( const auto *light : m_lights ) { - callback( *( *i ) ); + callback( *light ); } } }; @@ -3104,7 +3093,7 @@ public: } } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { if ( ( state & RENDER_FILL ) != 0 ) { Winding_Draw( m_winding, m_plane.normal(), state ); } @@ -3464,9 +3453,9 @@ public: typedef MemberCaller SelectedChangedComponentCaller; const BrushInstanceVisitor& forEachFaceInstance( const BrushInstanceVisitor& visitor ){ - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - visitor.visit( *i ); + visitor.visit( fi ); } return visitor; } @@ -3478,46 +3467,46 @@ public: GlobalShaderCache().release( "$SELPOINT" ); } - void clear(){ + void clear() override { m_faceInstances.clear(); } - void reserve( std::size_t size ){ + void reserve( std::size_t size ) override { m_faceInstances.reserve( size ); } - void push_back( Face& face ){ + void push_back( Face& face ) override { m_faceInstances.push_back( FaceInstance( face, SelectedChangedComponentCaller( *this ) ) ); } - void pop_back(){ + void pop_back() override { ASSERT_MESSAGE( !m_faceInstances.empty(), "erasing invalid element" ); m_faceInstances.pop_back(); } - void erase( std::size_t index ){ + void erase( std::size_t index ) override { ASSERT_MESSAGE( index < m_faceInstances.size(), "erasing invalid element" ); m_faceInstances.erase( m_faceInstances.begin() + index ); } - void connectivityChanged(){ - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + void connectivityChanged() override { + for ( auto& fi : m_faceInstances ) { - ( *i ).connectivityChanged(); + fi.connectivityChanged(); } } - void edge_clear(){ + void edge_clear() override { m_edgeInstances.clear(); } - void edge_push_back( SelectableEdge& edge ){ + void edge_push_back( SelectableEdge& edge ) override { m_edgeInstances.push_back( EdgeInstance( m_faceInstances, edge ) ); } - void vertex_clear(){ + void vertex_clear() override { m_vertexInstances.clear(); } - void vertex_push_back( SelectableVertex& vertex ){ + void vertex_push_back( SelectableVertex& vertex ) override { m_vertexInstances.push_back( VertexInstance( m_faceInstances, vertex ) ); } - void vertex_select(){ + void vertex_select() override { bool src_selected = false; bool dst_selected = false; for( const auto& v : m_brush.m_vertexModeVertices ) @@ -3542,18 +3531,18 @@ public: m_brush.freezeTransform(); } - void vertex_snap( const float snap ){ + void vertex_snap( const float snap ) override { vertex_snap( snap, true ); } - void DEBUG_verify() const { + void DEBUG_verify() const override { ASSERT_MESSAGE( m_faceInstances.size() == m_brush.DEBUG_size(), "FATAL: mismatch" ); } - bool isSelected() const { + bool isSelected() const override { return m_selectable.isSelected(); } - void setSelected( bool select ){ + void setSelected( bool select ) override { m_selectable.setSelected( select ); if ( !select && parent() ){ Selectable* sel_parent = Instance_getSelectable( *parent() ); @@ -3564,10 +3553,10 @@ public: void update_selected() const { m_render_selected.clear(); - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( const auto& fi : m_faceInstances ) { - if ( ( *i ).getFace().contributes() ) { - ( *i ).iterate_selected( m_render_selected ); + if ( fi.getFace().contributes() ) { + fi.iterate_selected( m_render_selected ); } } } @@ -3602,13 +3591,13 @@ public: } } - void renderComponents( Renderer& renderer, const VolumeTest& volume ) const { + void renderComponents( Renderer& renderer, const VolumeTest& volume ) const override { m_brush.evaluateBRep(); const Matrix4& localToWorld = Instance::localToWorld(); - renderer.SetState( m_brush.m_state_point, Renderer::eWireframeOnly ); - renderer.SetState( m_brush.m_state_point, Renderer::eFullMaterials ); + renderer.SetState( Brush::m_state_point, Renderer::eWireframeOnly ); + renderer.SetState( Brush::m_state_point, Renderer::eFullMaterials ); if ( volume.fill() && GlobalSelectionSystem().ComponentMode() == SelectionSystem::eFace ) { evaluateViewDependent( volume, localToWorld ); @@ -3646,10 +3635,10 @@ public: m_lightList->evaluateLights(); - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( const auto& fi : m_faceInstances ) { - renderer.setLights( ( *i ).m_lights ); - ( *i ).render( renderer, volume, localToWorld ); + renderer.setLights( fi.m_lights ); + fi.render( renderer, volume, localToWorld ); } renderComponentsSelected( renderer, volume, localToWorld ); @@ -3667,7 +3656,7 @@ public: renderComponentsSelected( renderer, volume, localToWorld ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_brush.evaluateBRep(); renderClipPlane( renderer, volume ); @@ -3675,7 +3664,7 @@ public: renderSolid( renderer, volume, localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_brush.evaluateBRep(); renderClipPlane( renderer, volume ); @@ -3683,72 +3672,66 @@ public: renderWireframe( renderer, volume, localToWorld() ); } - void viewChanged() const { + void viewChanged() const override { m_viewChanged = true; } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { test.BeginMesh( localToWorld() ); SelectionIntersection best; - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - ( *i ).testSelect( test, best ); + fi.testSelect( test, best ); } if ( best.valid() ) { selector.addIntersection( best ); } } - bool isSelectedComponents() const { - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) - { - if ( ( *i ).selectedComponents() ) { - return true; - } - } - return false; + bool isSelectedComponents() const override { + return std::ranges::any_of( m_faceInstances, []( const FaceInstance& fi ){ return fi.selectedComponents(); } ); } - void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ){ - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ) override { + for ( auto& fi : m_faceInstances ) { - ( *i ).setSelected( mode, select ); + fi.setSelected( mode, select ); } } - void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ){ + void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ) override { test.BeginMesh( localToWorld() ); switch ( mode ) { case SelectionSystem::eVertex: { - for ( VertexInstances::iterator i = m_vertexInstances.begin(); i != m_vertexInstances.end(); ++i ) + for ( auto& vi : m_vertexInstances ) { - ( *i ).testSelect( selector, test ); + vi.testSelect( selector, test ); } } break; case SelectionSystem::eEdge: { - for ( EdgeInstances::iterator i = m_edgeInstances.begin(); i != m_edgeInstances.end(); ++i ) + for ( auto& ei : m_edgeInstances ) { - ( *i ).testSelect( selector, test ); + ei.testSelect( selector, test ); } } break; case SelectionSystem::eFace: { if ( test.getVolume().fill() ) { - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - ( *i ).testSelect( selector, test ); + fi.testSelect( selector, test ); } } else { - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - ( *i ).testSelect_centroid( selector, test ); + fi.testSelect_centroid( selector, test ); } } } @@ -3757,7 +3740,7 @@ public: break; } } - void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const { + void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const override { m_brush.evaluateBRep(); // highlight() may happen right next to undo(), hence care to evaluate; normally render() triggers this beforehand test.BeginMesh( localToWorld() ); @@ -3829,26 +3812,26 @@ public: { case SelectionSystem::eVertex: { - for ( VertexInstances::iterator i = m_vertexInstances.begin(); i != m_vertexInstances.end(); ++i ) + for ( auto& vi : m_vertexInstances ) { - ( *i ).setSelected( !( *i ).isSelected() ); + vi.setSelected( !vi.isSelected() ); } } break; case SelectionSystem::eEdge: { - for ( EdgeInstances::iterator i = m_edgeInstances.begin(); i != m_edgeInstances.end(); ++i ) + for ( auto& ei : m_edgeInstances ) { - ( *i ).setSelected( !( *i ).isSelected() ); + ei.setSelected( !ei.isSelected() ); } } break; case SelectionSystem::eFace: { - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - if( !( *i ).getFace().isFiltered() ) - ( *i ).setSelected( mode, !( *i ).isSelected() ); + if( !fi.getFace().isFiltered() ) + fi.setSelected( mode, !fi.isSelected() ); } } break; @@ -3863,20 +3846,20 @@ public: const Vector3 viewdir( test.getVolume().getViewDir() ); double bestDot = 1; - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( auto& fi : m_faceInstances ) { - if( !( *i ).trySelectPlane( test ) ){ + if( !fi.trySelectPlane( test ) ){ continue; } - const double dot = fabs( vector3_dot( ( *i ).getFace().plane3().normal(), viewdir ) ); + const double dot = fabs( vector3_dot( fi.getFace().plane3().normal(), viewdir ) ); const double diff = bestDot - dot; if( diff > 0.03 ){ bestDot = dot; bestInstances.clear(); - bestInstances.push_back( &( *i ) ); + bestInstances.push_back( &fi ); } else if( fabs( diff ) <= 0.03 ){ - bestInstances.push_back( &( *i ) ); + bestInstances.push_back( &fi ); } } } @@ -3884,17 +3867,17 @@ public: FaceInstances_ptrs bestInstances; selectPlanes( test, bestInstances ); - for ( FaceInstances_ptrs::iterator i = bestInstances.begin(); i != bestInstances.end(); ++i ){ - ( *i )->addSelectable( selector ); - selectedPlaneCallback( ( *i )->getFace().plane3() ); + for ( auto *fi : bestInstances ){ + fi->addSelectable( selector ); + selectedPlaneCallback( fi->getFace().plane3() ); if( test.getVolume().fill() ) return; // select only plane in camera } } void selectReversedPlanes( Selector& selector, const SelectedPlanes& selectedPlanes ) override { - for ( FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( FaceInstance& fi : m_faceInstances ) { - ( *i ).selectReversedPlane( selector, selectedPlanes ); + fi.selectReversedPlane( selector, selectedPlanes ); } } @@ -3947,20 +3930,20 @@ public: void transformComponents( const Matrix4& matrix ); - const AABB& getSelectedComponentsBounds() const { + const AABB& getSelectedComponentsBounds() const override { m_aabb_component = AABB(); - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( const auto& fi : m_faceInstances ) { - ( *i ).iterate_selected( m_aabb_component ); + fi.iterate_selected( m_aabb_component ); } return m_aabb_component; } - void gatherSelectedComponents( const Vector3Callback& callback ) const { - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + void gatherSelectedComponents( const Vector3Callback& callback ) const override { + for ( const auto& fi : m_faceInstances ) { - ( *i ).gatherSelectedComponents( callback ); + fi.gatherSelectedComponents( callback ); } } @@ -4012,7 +3995,7 @@ public: } } - void snapComponents( float snap ){ + void snapComponents( float snap ) override { for ( const auto& fi : m_faceInstances ){ if( fi.selectedComponents( SelectionSystem::eVertex ) ){ vertex_snap( snap, false ); @@ -4083,20 +4066,20 @@ public: m_clipPlane.setPlane( m_brush, plane ); } - bool testLight( const RendererLight& light ) const { + bool testLight( const RendererLight& light ) const override { return light.testAABB( worldAABB() ); } - void insertLight( const RendererLight& light ){ + void insertLight( const RendererLight& light ) override { const Matrix4& localToWorld = Instance::localToWorld(); - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + for ( const auto& fi : m_faceInstances ) { - Face_addLight( *i, localToWorld, light ); + Face_addLight( fi, localToWorld, light ); } } - void clearLights(){ - for ( FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i ) + void clearLights() override { + for ( auto& fi : m_faceInstances ) { - ( *i ).m_lights.clear(); + fi.m_lights.clear(); } } }; @@ -4113,7 +4096,7 @@ class BrushSelectedVisitor : public SelectionSystem::Visitor public: BrushSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { BrushInstance* brush = Instance_getBrush( instance ); if ( brush != 0 ) { m_functor( *brush ); @@ -4134,7 +4117,7 @@ class BrushVisibleSelectedVisitor : public SelectionSystem::Visitor public: BrushVisibleSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { BrushInstance* brush = Instance_getBrush( instance ); if ( brush != 0 && instance.path().top().get().visible() ) { @@ -4168,7 +4151,7 @@ public: FaceInstanceVisitFace( const Functor& functor ) : functor( functor ){ } - void visit( FaceInstance& face ) const { + void visit( FaceInstance& face ) const override { functor( face.getFace() ); } }; @@ -4187,7 +4170,7 @@ public: FaceVisitAll( const Functor& functor ) : functor( functor ){ } - void visit( Face& face ) const { + void visit( Face& face ) const override { functor( face ); } }; @@ -4212,7 +4195,7 @@ public: FaceInstanceVisitAll( const Functor& functor ) : functor( functor ){ } - void visit( FaceInstance& face ) const { + void visit( FaceInstance& face ) const override { functor( face ); } }; @@ -4249,7 +4232,7 @@ class BrushVisibleWalker : public scene::Graph::Walker public: BrushVisibleWalker( const Functor& functor ) : m_functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { BrushInstance* brush = Instance_getBrush( instance ); if ( brush != 0 ) { diff --git a/radiant/brush_primit.cpp b/radiant/brush_primit.cpp index fdeba93e..3d05e79b 100644 --- a/radiant/brush_primit.cpp +++ b/radiant/brush_primit.cpp @@ -24,18 +24,12 @@ #include "debugging/debugging.h" #include "itexdef.h" -#include "itextures.h" -#include - -#include "stringio.h" -#include "texturelib.h" #include "math/matrix.h" #include "math/plane.h" #include "math/aabb.h" #include "winding.h" -#include "preferences.h" bp_globals_t g_bp_globals; diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index 61b6a6ff..f8728635 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -23,7 +23,6 @@ #include "gtkutil/widget.h" -#include "gtkutil/menu.h" #include "gtkmisc.h" #include "brushnode.h" #include "map.h" @@ -35,8 +34,6 @@ #include "xywindow.h" #include "preferences.h" -#include - void Brush_ConstructCuboid( Brush& brush, const AABB& bounds, const char* shader, const TextureProjection& projection ){ const unsigned char box[3][2] = { { 0, 1 }, { 2, 0 }, { 1, 2 } }; Vector3 mins( vector3_subtracted( bounds.origin, bounds.extents ) ); @@ -867,7 +864,7 @@ public: BrushSelectByShaderWalker( const char* name ) : m_name( name ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Brush* brush = Node_getBrush( path.top() ); if ( brush != 0 && Brush_hasShader( *brush, m_name ) ) { @@ -995,7 +992,7 @@ class filter_face_shader : public FaceFilter public: filter_face_shader( const char* shader ) : m_shader( shader ){ } - bool filter( const Face& face ) const { + bool filter( const Face& face ) const override { return shader_equal( face.GetShader(), m_shader ); } }; @@ -1006,7 +1003,7 @@ class filter_face_shader_prefix : public FaceFilter public: filter_face_shader_prefix( const char* prefix ) : m_prefix( prefix ){ } - bool filter( const Face& face ) const { + bool filter( const Face& face ) const override { return shader_equal_n( face.GetShader(), m_prefix, strlen( m_prefix ) ); } }; @@ -1017,7 +1014,7 @@ class filter_face_flags : public FaceFilter public: filter_face_flags( int flags ) : m_flags( flags ){ } - bool filter( const Face& face ) const { + bool filter( const Face& face ) const override { return ( face.getShader().shaderFlags() & m_flags ) != 0; } }; @@ -1028,7 +1025,7 @@ class filter_face_contents : public FaceFilter public: filter_face_contents( int contents ) : m_contents( contents ){ } - bool filter( const Face& face ) const { + bool filter( const Face& face ) const override { return ( face.getShader().m_flags.m_contentFlags & m_contents ) != 0; } }; @@ -1041,7 +1038,7 @@ class filter_brush_any_face : public BrushFilter public: filter_brush_any_face( FaceFilter* filter ) : m_filter( filter ){ } - bool filter( const Brush& brush ) const { + bool filter( const Brush& brush ) const override { #if 1 for( const auto& face : brush ) if( m_filter->filter( *face ) ) @@ -1065,7 +1062,7 @@ class filter_brush_all_faces : public BrushFilter public: filter_brush_all_faces( FaceFilter* filter ) : m_filter( filter ){ } - bool filter( const Brush& brush ) const { + bool filter( const Brush& brush ) const override { #if 1 for( const auto& face : brush ) if( !m_filter->filter( *face ) ) diff --git a/radiant/brushmodule.cpp b/radiant/brushmodule.cpp index 215495c2..eeee2f4c 100644 --- a/radiant/brushmodule.cpp +++ b/radiant/brushmodule.cpp @@ -222,19 +222,19 @@ typedef Callback FaceCallback; class Quake3BrushCreator : public BrushCreator { public: - scene::Node& createBrush(){ + scene::Node& createBrush() override { return ( new BrushNode )->node(); } - EBrushType getFormat() const { + EBrushType getFormat() const override { return Brush::m_type; } - void toggleFormat( EBrushType type ) const { + void toggleFormat( EBrushType type ) const override { Brush_toggleFormat( type ); } - void Brush_forEachFace( scene::Node& brush, const BrushFaceDataCallback& callback ){ + void Brush_forEachFace( scene::Node& brush, const BrushFaceDataCallback& callback ) override { ::Brush_forEachFace( *Node_getBrush( brush ), FaceCallback( BrushFaceDataFromFaceCaller( callback ) ) ); } - bool Brush_addFace( scene::Node& brush, const _QERFaceData& faceData ){ + bool Brush_addFace( scene::Node& brush, const _QERFaceData& faceData ) override { Node_getBrush( brush )->undoSave(); return Node_getBrush( brush )->addPlane( faceData.m_p0, faceData.m_p1, faceData.m_p2, faceData.m_shader, TextureProjection( faceData.m_texdef, brushprimit_texdef_t(), Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ) ) ) != 0; } diff --git a/radiant/brushnode.h b/radiant/brushnode.h index 58a6acd9..58bd7ab4 100644 --- a/radiant/brushnode.h +++ b/radiant/brushnode.h @@ -113,27 +113,27 @@ public: m_xmlImporter( m_brush ), m_xmlExporter( m_brush ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new BrushNode( *this ) )->node(); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new BrushInstance( path, parent, m_brush ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/radiant/brushtokens.h b/radiant/brushtokens.h index 5e5bf86c..4fdae408 100644 --- a/radiant/brushtokens.h +++ b/radiant/brushtokens.h @@ -467,7 +467,7 @@ class BrushTokenImporter : public MapImporter public: BrushTokenImporter( Brush& brush ) : m_brush( brush ){ } - bool importTokens( Tokeniser& tokeniser ){ + bool importTokens( Tokeniser& tokeniser ) override { if ( Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeQuake2BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4 ) { tokeniser.nextLine(); RETURN_FALSE_IF_FAIL( Tokeniser_parseToken( tokeniser, "{" ) ); @@ -550,7 +550,7 @@ class BrushTokenExporter : public MapExporter public: BrushTokenExporter( const Brush& brush ) : m_brush( brush ){ } - void exportTokens( TokenWriter& writer ) const { + void exportTokens( TokenWriter& writer ) const override { m_brush.evaluateBRep(); // ensure b-rep is up-to-date, so that non-contributing faces can be identified. if ( !m_brush.hasContributingFaces() ) { diff --git a/radiant/brushxml.h b/radiant/brushxml.h index 169252df..71b6b038 100644 --- a/radiant/brushxml.h +++ b/radiant/brushxml.h @@ -340,7 +340,7 @@ public: BrushXMLImporter( Brush& brush ) : m_brush( brush ){ m_xml_state.push_back( xml_state_t::eDefault ); } - void pushElement( const XMLElement& element ){ + void pushElement( const XMLElement& element ) override { switch ( m_xml_state.back().state() ) { case xml_state_t::eDefault: @@ -361,7 +361,7 @@ public: break; } } - void popElement( const char* name ){ + void popElement( const char* name ) override { ASSERT_MESSAGE( !m_xml_state.empty(), "parse error" ); m_xml_state.pop_back(); @@ -377,7 +377,7 @@ public: break; } } - std::size_t write( const char* data, std::size_t length ){ + std::size_t write( const char* data, std::size_t length ) override { switch ( m_xml_state.back().state() ) { case xml_state_t::eFace: @@ -397,7 +397,7 @@ class BrushXMLExporter : public XMLExporter public: BrushXMLExporter( const Brush& brush ) : m_brush( brush ){ } - void exportXML( XMLImporter& importer ){ + void exportXML( XMLImporter& importer ) override { m_brush.evaluateBRep(); // ensure b-rep is up-to-date, so that non-contributing faces can be identified. ASSERT_MESSAGE( m_brush.hasContributingFaces(), "exporting an empty brush" ); diff --git a/radiant/build.cpp b/radiant/build.cpp index 09dafaa0..b427a7e0 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -65,8 +65,7 @@ class VariableString final : public Evaluatable { CopiedString m_string; public: - VariableString() : m_string(){ - } + VariableString() = default; VariableString( const char* string ) : m_string( string ){ } Evaluatable* clone() const override { @@ -121,7 +120,7 @@ class Conditional final : public Evaluatable VariableString m_test; public: VariableString m_result; - Conditional( VariableString&& test ) : m_test( test ){ + Conditional( VariableString&& test ) : m_test( std::move( test ) ){ } Evaluatable* clone() const override { return new Conditional( *this ); @@ -130,7 +129,7 @@ public: if ( !m_test.evaluate().empty() ) { return m_result.evaluate(); } - return StringBuffer(); + return {}; } void exportXML( XMLImporter& importer ) const override { StaticElement conditionElement( "cond" ); @@ -170,7 +169,6 @@ public: } }; -#include "xml/ixml.h" class XMLElementParser : public TextOutputStream { @@ -241,7 +239,7 @@ public: XMLElementParser& pushElement( const XMLElement& element ) override { if ( string_equal( element.name(), "cond" ) ) { flush(); - Conditional* conditional = new Conditional( VariableString( element.attribute( "value" ) ) ); + auto* conditional = new Conditional( VariableString( element.attribute( "value" ) ) ); m_tool.push_back( conditional ); m_conditional = new ConditionalXMLConstructor( *conditional ); return *m_conditional; @@ -302,18 +300,10 @@ public: }; typedef std::pair BuildPair; -#define SEPARATOR_STRING "-" +constexpr char SEPARATOR_STRING[] = "-"; inline bool is_separator( const CopiedString& name, const Build& commands ){ - if ( !string_equal( name.c_str(), SEPARATOR_STRING ) ) { - return false; - } - for ( const BuildCommand& cmd : commands ) - { - if ( !string_empty( cmd.c_str() ) ) { - return false; - } - } - return true; + return string_equal( name.c_str(), SEPARATOR_STRING ) + && std::ranges::all_of( commands, string_empty, &BuildCommand::c_str ); // true for empty range } @@ -527,7 +517,7 @@ public: #include "stream/textfilestream.h" #include "xml/xmlparser.h" -const char* const BUILDMENU_VERSION = "2.0"; +constexpr char BUILDMENU_VERSION[] = "2.0"; bool build_commands_parse( const char* filename ){ TextFileInputStream projectFile( filename ); @@ -650,13 +640,13 @@ constexpr Qt::ItemFlags c_itemFlags = Qt::ItemIsSelectable | Qt::ItemIsEditable constexpr Qt::ItemFlags c_itemFlagsDraggable = c_itemFlags | Qt::ItemIsDragEnabled; inline QTreeWidgetItem* new_item( const char *text ){ - auto item = new QTreeWidgetItem; + auto *item = new QTreeWidgetItem; item->setText( 0, text ); item->setFlags( c_itemFlagsDraggable ); return item; } -const char LAST_ITER_STRING[] = "+"; +constexpr char LAST_ITER_STRING[] = "+"; inline void last_iter_append( QTreeWidget* tree ){ QTreeWidgetItem *item = new_item( LAST_ITER_STRING ); item->setFlags( c_itemFlags ); @@ -675,13 +665,12 @@ void BSPCommandList_Construct( QTreeWidget* tree, Project& project ){ last_iter_append( tree ); } -class ProjectList +struct ProjectList { -public: Project& m_project; QTreeWidget* m_buildView; - bool m_changed; - ProjectList( Project& project ) : m_project( project ), m_changed( false ){ + bool m_changed{}; + ProjectList( Project& project ) : m_project( project ){ } }; @@ -827,12 +816,12 @@ protected: class QTreeWidget_project : public QTreeWidget_drag { ProjectList& m_projectList; + BuildPair m_buildpair_copied; + Project::iterator m_buildpair_dragged; public: QTreeWidget_project( ProjectList& projectList ) : m_projectList( projectList ){ } protected: - BuildPair m_buildpair_copied; - Project::iterator m_buildpair_dragged; void startDrag( Qt::DropActions supportedActions ) override { m_buildpair_dragged = Project_find( m_projectList.m_project, indexOfTopLevelItem( currentItem() ) ); QTreeWidget::startDrag( supportedActions ); @@ -889,9 +878,9 @@ protected: class QTreeWidget_commands : public QTreeWidget_drag { -protected: BuildCommand m_buildcommand_copied; Build::iterator m_buildcommand_dragged; +protected: void startDrag( Qt::DropActions supportedActions ) override { ASSERT_NOTNULL( g_current_build ); m_buildcommand_dragged = Build_find( *g_current_build, indexOfTopLevelItem( currentItem() ) ); @@ -1046,9 +1035,9 @@ EMessageBoxReturn BuildMenuDialog_construct( ProjectList& projectList ){ rootLayout->addWidget( container ); { - auto grid = new QGridLayout( container ); + auto *grid = new QGridLayout( container ); { - auto buttons = new QDialogButtonBox; + auto *buttons = new QDialogButtonBox; buttons->setOrientation( Qt::Orientation::Vertical ); // rejection via dialog means will return DialogCode::Rejected (0), eID* > 0 QObject::connect( buttons->addButton( QDialogButtonBox::StandardButton::Ok ), @@ -1062,11 +1051,11 @@ EMessageBoxReturn BuildMenuDialog_construct( ProjectList& projectList ){ } QTreeWidget* buildView = nullptr; { - auto frame = new QGroupBox( "Build menu" ); + auto *frame = new QGroupBox( "Build menu" ); grid->addWidget( frame, 0, 0 ); grid->setRowStretch( 0, 1 ); { - auto tree = projectList.m_buildView = buildView = new QTreeWidget_project( projectList ); + auto *tree = projectList.m_buildView = buildView = new QTreeWidget_project( projectList ); tree->setHorizontalScrollBarPolicy( Qt::ScrollBarPolicy::ScrollBarAlwaysOff ); ( new QHBoxLayout( frame ) )->addWidget( tree ); @@ -1076,10 +1065,10 @@ EMessageBoxReturn BuildMenuDialog_construct( ProjectList& projectList ){ } } { - auto frame = new QGroupBox( "Commandline" ); + auto *frame = new QGroupBox( "Commandline" ); grid->addWidget( frame, 1, 0 ); { - auto tree = new QTreeWidget_commands; + auto *tree = new QTreeWidget_commands; tree->setVerticalScrollBarPolicy( Qt::ScrollBarPolicy::ScrollBarAlwaysOff ); ( new QHBoxLayout( frame ) )->addWidget( tree ); @@ -1092,7 +1081,7 @@ EMessageBoxReturn BuildMenuDialog_construct( ProjectList& projectList ){ } } { - auto expander = new QGroupBox( "Build Variables" ); + auto *expander = new QGroupBox( "Build Variables" ); expander->setFlat( true ); expander->setCheckable( true ); expander->setChecked( false ); @@ -1214,9 +1203,8 @@ class BuildMenuItem using build name before was faulty design, as builds may have equal names */ const size_t m_buildIdx; public: - QAction* m_item; - BuildMenuItem( size_t buildIdx ) - : m_buildIdx( buildIdx ), m_item( nullptr ){ + QAction* m_item{}; + BuildMenuItem( size_t buildIdx ) : m_buildIdx( buildIdx ){ } void run() const { RunBSP( m_buildIdx ); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 8773a8fe..ad82bb53 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -38,16 +38,14 @@ #include "preferencesystem.h" #include "signal/signal.h" -#include "container/array.h" #include "scenelib.h" #include "render.h" -#include "commandlib.h" #include "math/frustum.h" #include "gtkutil/widget.h" -#include "gtkutil/toolbar.h" #include "gtkutil/glwidget.h" #include "gtkutil/xorrectangle.h" +#include "gtkutil/cursor.h" #include "gtkutil/fbo.h" #include "gtkmisc.h" #include "selection.h" @@ -704,14 +702,14 @@ public: m_view->Construct( m_camera.projection, m_camera.modelview, m_camera.width, m_camera.height ); m_update(); } - void setModelview( const Matrix4& modelview ){ + void setModelview( const Matrix4& modelview ) override { m_camera.modelview = modelview; matrix4_multiply_by_matrix4( m_camera.modelview, g_radiant2opengl ); matrix4_affine_invert( m_camera.modelview ); Camera_updateVectors( m_camera ); update(); } - void setFieldOfView( float fieldOfView ){ + void setFieldOfView( float fieldOfView ) override { float farClip = Camera_getFarClipPlane( m_camera ); m_camera.projection = projection_for_camera( camera_t::near_z, farClip, fieldOfView, m_camera.width, m_camera.height ); update(); @@ -822,7 +820,7 @@ class RenderableCamWorkzone : public OpenGLRenderable mutable std::array m_colorarr0[3]; mutable std::array m_colorarr1[3]; public: - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { gl().glEnableClientState( GL_EDGE_FLAG_ARRAY ); const AABB bounds = GlobalSelectionSystem().getBoundsSelected(); @@ -1722,7 +1720,7 @@ public: FloorHeightWalker( const Vector3& current ) : m_current( current ), m_bestUp( g_MaxWorldCoord ), m_bestDown( g_MinWorldCoord ), m_bottom( g_MaxWorldCoord ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( !path.top().get().visible() ) return false; if ( !path.top().get().isRoot() && !node_is_group( path.top() ) ) { @@ -1844,31 +1842,31 @@ public: m_state_stack.push_back( state_type() ); } - void SetState( Shader* state, EStyle style ){ + void SetState( Shader* state, EStyle style ) override { ASSERT_NOTNULL( state ); if ( style == eFullMaterials ) { m_state_stack.back().m_state = state; } } - EStyle getStyle() const { + EStyle getStyle() const override { return eFullMaterials; } - void PushState(){ + void PushState() override { m_state_stack.push_back( m_state_stack.back() ); } - void PopState(){ + void PopState() override { ASSERT_MESSAGE( !m_state_stack.empty(), "popping empty stack" ); m_state_stack.pop_back(); } - void Highlight( EHighlightMode mode, bool bEnable = true ){ + void Highlight( EHighlightMode mode, bool bEnable = true ) override { ( bEnable ) ? m_state_stack.back().m_highlight |= mode : m_state_stack.back().m_highlight &= ~mode; } - void setLights( const LightList& lights ){ + void setLights( const LightList& lights ) override { m_state_stack.back().m_lights = &lights; } - void addRenderable( const OpenGLRenderable& renderable, const Matrix4& world ){ + void addRenderable( const OpenGLRenderable& renderable, const Matrix4& world ) override { if ( m_state_stack.back().m_highlight & ePrimitive ) { m_state_select0->addRenderable( renderable, world, m_state_stack.back().m_lights ); } diff --git a/radiant/camwindow.h b/radiant/camwindow.h index 5fdfd48a..87b00b21 100644 --- a/radiant/camwindow.h +++ b/radiant/camwindow.h @@ -21,7 +21,7 @@ #pragma once -#include "math/vector.h" +#include "generic/vector.h" #include "signal/signalfwd.h" class QWidget; diff --git a/radiant/clippertool.cpp b/radiant/clippertool.cpp index 924335d5..960527ad 100644 --- a/radiant/clippertool.cpp +++ b/radiant/clippertool.cpp @@ -29,6 +29,7 @@ #include "mainframe.h" #include "camwindow.h" #include "xywindow.h" +#include ClipperPoints g_clipper_points; bool g_clipper_flipped = false; diff --git a/radiant/colors.cpp b/radiant/colors.cpp index 1a5cdc57..a45ff811 100644 --- a/radiant/colors.cpp +++ b/radiant/colors.cpp @@ -33,7 +33,6 @@ #include "mainframe.h" #include "brushmodule.h" #include "preferences.h" -#include "commands.h" #include "gtkmisc.h" #include "gtkutil/menu.h" #include "os/dir.h" diff --git a/radiant/console.cpp b/radiant/console.cpp index 93c6ffcd..842334e3 100644 --- a/radiant/console.cpp +++ b/radiant/console.cpp @@ -25,17 +25,15 @@ #include "gtkutil/accelerator.h" #include "gtkutil/messagebox.h" -#include "gtkutil/menu.h" -#include "gtkutil/nonmodal.h" #include "stream/stringstream.h" #include "version.h" #include "aboutmsg.h" -#include "gtkmisc.h" #include "mainframe.h" #include #include +#include #ifndef WIN32 #include // write() @@ -129,7 +127,7 @@ public: #ifdef __GNUC__ //__attribute__((optimize("O0"))) #endif - write( const char* buffer, std::size_t length ){ + write( const char* buffer, std::size_t length ) override { textBuffer->insertPlainText( QString::fromLatin1( buffer, length ) ); return length; } @@ -214,7 +212,7 @@ template class SysPrintStream : public TextOutputStream { public: - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { return Sys_Print( level, buffer, length ); } }; diff --git a/radiant/csg.cpp b/radiant/csg.cpp index 04e111dc..e3f829d2 100644 --- a/radiant/csg.cpp +++ b/radiant/csg.cpp @@ -57,7 +57,6 @@ void Face_extrude( Face& face, const Brush& brush, brush_vector_t& out, float of } } */ -#include "preferences.h" #include "texwindow.h" #include "filterbar.h" @@ -321,7 +320,7 @@ public: BrushHollowSelectedWalker( HollowSettings& settings ) : m_settings( settings ) { } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( path.top().get().visible() ) { Brush* brush = Node_getBrush( path.top() ); if( brush != 0 @@ -379,7 +378,7 @@ public: BrushGatherSelected( brush_vector_t& brushlist ) : m_brushlist( brushlist ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() && Instance_isSelected( instance ) ) if ( Brush* brush = Node_getBrush( path.top() ) ) m_brushlist.push_back( brush ); @@ -390,10 +389,10 @@ public: class BrushDeleteSelected : public scene::Graph::Walker { public: -bool pre( const scene::Path& path, scene::Instance& instance ) const { +bool pre( const scene::Path& path, scene::Instance& instance ) const override { return true; } -void post( const scene::Path& path, scene::Instance& instance ) const { +void post( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Brush* brush = Node_getBrush( path.top() ); if ( brush != 0 @@ -415,10 +414,10 @@ class BrushDeleteSelected : public scene::Graph::Walker public: BrushDeleteSelected( scene::Node* keepNode = nullptr ): m_keepNode( keepNode ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( Node_isBrush( path.top() ) ) { if ( path.top().get().visible() && Instance_isSelected( instance ) @@ -648,10 +647,10 @@ public: } } } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return path.top().get().visible(); } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( Brush* thebrush = Node_getBrush( path.top() ) ) { if ( path.top().get().visible() && !Instance_isSelected( instance ) && std::any_of( m_brushlist.cbegin(), m_brushlist.cend(), @@ -753,10 +752,10 @@ public: m_plane( plane3_for_points( m_points[0], m_points[1], m_points[2] ) ), m_shader( shader ), m_projection( projection ), m_split( split ), m_gj( false ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Brush* brush = Node_getBrush( path.top() ); if ( brush != 0 @@ -822,7 +821,7 @@ public: ? plane3_for_points( points[0], points[2], points[1] ) : plane3_for_points( points[0], points[1], points[2] ) ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { BrushInstance* brush = Instance_getBrush( instance ); if ( brush != 0 && path.top().get().visible() @@ -1029,7 +1028,7 @@ public: Scene_gatherSelectedComponents( MergeVertices& mergeVertices ) : m_mergeVertices( mergeVertices ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { ComponentEditable* componentEditable = Instance_getComponentEditable( instance ); if ( componentEditable ) { @@ -1361,7 +1360,6 @@ void CSG_DeleteComponents(){ */ #include "mainframe.h" #include "gtkutil/dialog.h" -#include "gtkutil/accelerator.h" #include "gtkutil/image.h" #include "gtkutil/spinbox.h" #include "gtkutil/guisettings.h" diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index a0cb5190..6500d603 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -37,7 +37,6 @@ #include "stream/stringstream.h" #include "gtkutil/dialog.h" -#include "gtkutil/entry.h" #include "gtkutil/image.h" #include "gtkutil/spinbox.h" @@ -209,13 +208,13 @@ public: CallbackDialogData( const ImportCallback& importWidget, const ExportCallback& exportWidget, const ImportCallback& importViewer, const ExportCallback& exportViewer ) : m_importWidget( importWidget ), m_exportWidget( exportWidget ), m_importViewer( importViewer ), m_exportViewer( exportViewer ){ } - void release(){ + void release() override{ delete this; } - void importData() const { + void importData() const override { m_exportViewer( m_importWidget ); } - void exportData() const { + void exportData() const override { m_exportWidget( m_importViewer ); } }; diff --git a/radiant/eclass.cpp b/radiant/eclass.cpp index 1a070dd9..70cc5e46 100644 --- a/radiant/eclass.cpp +++ b/radiant/eclass.cpp @@ -34,8 +34,6 @@ #include "stream/stringstream.h" #include "moduleobservers.h" -#include "commandlib.h" - #include "preferences.h" #include "mainframe.h" @@ -196,7 +194,7 @@ void EntityClassQuake3_Construct(){ LoadEntityDefinitionsVisitor( const char* baseDirectory, const char* gameDirectory ) : baseDirectory( baseDirectory ), gameDirectory( gameDirectory ){ } - void visit( const char* name, const EntityClassScanner& table ) const { + void visit( const char* name, const EntityClassScanner& table ) const override { Paths paths; EntityClassQuake3_constructDirectory( baseDirectory, table.getExtension(), paths ); if ( !string_equal( baseDirectory, gameDirectory ) ) { @@ -238,14 +236,14 @@ class EntityClassQuake3 : public ModuleObserver public: EntityClassQuake3() : m_unrealised( 4 ){ } - void realise(){ + void realise() override{ if ( --m_unrealised == 0 ) { //globalOutputStream() << "Entity Classes: realise\n"; EntityClassQuake3_Construct(); m_observers.realise(); } } - void unrealise(){ + void unrealise() override{ if ( ++m_unrealised == 1 ) { m_observers.unrealise(); //globalOutputStream() << "Entity Classes: unrealise\n"; diff --git a/radiant/eclass_def.cpp b/radiant/eclass_def.cpp index 7d8474e8..919ee504 100644 --- a/radiant/eclass_def.cpp +++ b/radiant/eclass_def.cpp @@ -22,8 +22,6 @@ #include "eclass_def.h" #include "iscriplib.h" -#include "ifilesystem.h" -#include "iarchive.h" #include "eclasslib.h" #include "stream/stringstream.h" diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp index f1cd726b..b521ff7b 100644 --- a/radiant/eclass_doom3.cpp +++ b/radiant/eclass_doom3.cpp @@ -34,7 +34,6 @@ #include "string/string.h" #include "eclasslib.h" #include "os/path.h" -#include "os/dir.h" #include "stream/stringstream.h" #include "moduleobservers.h" #include "stringio.h" @@ -687,7 +686,7 @@ class EntityClassDoom3 : public ModuleObserver public: EntityClassDoom3() : m_unrealised( 2 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { globalOutputStream() << "searching vfs directory " << makeQuoted( "def" ) << " for *.def\n"; GlobalFileSystem().forEachFile( "def/", "def", makeCallbackF( EntityClassDoom3_loadFile ) ); @@ -737,7 +736,7 @@ public: m_observers.realise(); } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { m_observers.unrealise(); EntityClassDoom3_clear(); diff --git a/radiant/eclass_fgd.cpp b/radiant/eclass_fgd.cpp index a7a0c2cf..b8a2230d 100644 --- a/radiant/eclass_fgd.cpp +++ b/radiant/eclass_fgd.cpp @@ -27,15 +27,14 @@ #include #include "iscriplib.h" -#include "qerplugin.h" #include "string/string.h" #include "eclasslib.h" #include "os/path.h" #include "stream/stringstream.h" -#include "moduleobservers.h" #include "stringio.h" #include "stream/textfilestream.h" +#include "math/vector.h" namespace { diff --git a/radiant/eclass_xml.cpp b/radiant/eclass_xml.cpp index 9fd2f5ae..8cec60cd 100644 --- a/radiant/eclass_xml.cpp +++ b/radiant/eclass_xml.cpp @@ -111,7 +111,6 @@ #include "ieclass.h" #include "irender.h" #include "ifilesystem.h" -#include "iarchive.h" #include "xml/xmlparser.h" #include "generic/object.h" @@ -122,6 +121,7 @@ #include "eclasslib.h" #include "modulesystem/moduleregistry.h" #include "stringio.h" +#include #define PARSE_ERROR( elementName, name ) makeQuoted( elementName ) << " is not a valid child of " << makeQuoted( name ) diff --git a/radiant/entity.cpp b/radiant/entity.cpp index ea979695..0585e1ce 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -26,7 +26,6 @@ #include "imodel.h" #include "ifilesystem.h" #include "iundo.h" -#include "editable.h" #include "eclasslib.h" #include "scenelib.h" @@ -36,6 +35,7 @@ #include "stringio.h" #include "gtkutil/filechooser.h" +#include "gtkutil/widget.h" #include "gtkmisc.h" #include "select.h" #include "map.h" @@ -65,10 +65,10 @@ public: EntitySetKeyValueSelected( const char* key, const char* value ) : m_key( key ), m_value( value ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && ( instance.childSelected() || Instance_isSelected( instance ) ) ) { @@ -86,10 +86,10 @@ public: EntitySetClassnameSelected( const char* classname ) : m_classname( classname ), m_world( Map_FindWorldspawn( g_map ) ), m_2world( m_world && string_equal( m_classname, "worldspawn" ) ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 && ( instance.childSelected() || Instance_isSelected( instance ) ) ) { if( path.top().get_pointer() == m_world ){ /* do not want to convert whole worldspawn entity */ diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index d25f8523..e9f1b4bc 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -25,14 +25,12 @@ #include "ientity.h" #include "ifilesystem.h" -#include "imodel.h" #include "iscenegraph.h" #include "iselection.h" #include "iundo.h" #include #include -#include #include #include @@ -66,13 +64,11 @@ #include "gtkutil/accelerator.h" #include "gtkutil/dialog.h" #include "gtkutil/filechooser.h" -#include "gtkutil/messagebox.h" #include "gtkutil/nonmodal.h" #include "gtkutil/entry.h" #include "qe3.h" #include "gtkmisc.h" -#include "gtkdlgs.h" #include "entity.h" #include "mainframe.h" #include "textureentry.h" @@ -768,7 +764,7 @@ public: : m_keyvalues( keyvalues ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { m_keyvalues.insert( KeyValues::value_type( CopiedString( key ), CopiedString( value ) ) ); } @@ -797,7 +793,7 @@ void Entity_GetKeyValues_Selected( KeyValues& keyvalues, KeyValues& defaultValue EntityGetKeyValues( KeyValues& keyvalues, KeyValues& defaultValues ) : m_keyvalues( keyvalues ), m_defaultValues( defaultValues ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { Entity* entity = Node_getEntity( instance.path().top() ); if ( entity == 0 && instance.path().size() != 1 ) { entity = Node_getEntity( instance.path().parent() ); @@ -826,7 +822,7 @@ class EntityClassListStoreAppend : public EntityClassVisitor public: EntityClassListStoreAppend( QTreeWidget* tree_ ) : tree( tree_ ){ } - void visit( EntityClass* e ){ + void visit( EntityClass* e ) override { auto item = new QTreeWidgetItem( tree ); item->setData( 0, Qt::ItemDataRole::DisplayRole, e->name() ); item->setData( 0, Qt::ItemDataRole::UserRole, QVariant::fromValue( e ) ); @@ -1396,7 +1392,7 @@ class EntityInspector : public ModuleObserver public: EntityInspector() : m_unrealised( 1 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { if ( g_entityInspector_windowConstructed ) { //globalOutputStream() << "Entity Inspector: realise\n"; @@ -1404,7 +1400,7 @@ public: } } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { if ( g_entityInspector_windowConstructed ) { //globalOutputStream() << "Entity Inspector: unrealise\n"; @@ -1416,7 +1412,6 @@ public: EntityInspector g_EntityInspector; -#include "preferencesystem.h" #include "stringio.h" void EntityInspector_construct(){ diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 5e852fdc..baa37ea4 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -35,11 +35,8 @@ #include "string/string.h" #include "scenelib.h" -#include "nameable.h" #include "signal/isignal.h" -#include "generic/object.h" -#include "gtkutil/widget.h" #include "gtkutil/idledraw.h" #include "gtkutil/accelerator.h" #include "gtkutil/guisettings.h" diff --git a/radiant/feedback.cpp b/radiant/feedback.cpp index fe8c2018..b4f625fb 100644 --- a/radiant/feedback.cpp +++ b/radiant/feedback.cpp @@ -37,7 +37,6 @@ #include #include "map.h" -#include "dialog.h" #include "mainframe.h" diff --git a/radiant/feedback.h b/radiant/feedback.h index f74cea00..8c851f00 100644 --- a/radiant/feedback.h +++ b/radiant/feedback.h @@ -27,11 +27,11 @@ #pragma once -#include "math/vector.h" +#include "generic/vector.h" #include "stream/stringstream.h" #include "xmlstuff.h" #include "dialog.h" -#include "xywindow.h" +#include "qerplugin.h" // we use these classes to let plugins draw inside the Radiant windows // 2D window like YZ XZ XY @@ -67,15 +67,15 @@ public: ESelectState = SELECT_MESSAGE; } // SAX interface - void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); - void saxEndElement( message_info_t *ctx, const xmlChar *name ); - void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); + void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ) override; + void saxEndElement( message_info_t *ctx, const xmlChar *name ) override; + void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ) override; // for use in the dialog window - const char* getName() { + const char* getName() override { return message; } - IGL2DWindow* Highlight(); - void DropHighlight() { } + IGL2DWindow* Highlight() override; + void DropHighlight() override { } }; class CPointMsg final : public ISAXHandler, public IGL2DWindow @@ -91,32 +91,32 @@ public: refCount = 0; } // SAX interface - void Release(){ + void Release() override { delete this; } - void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); - void saxEndElement( message_info_t *ctx, const xmlChar *name ); - void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); + void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ) override; + void saxEndElement( message_info_t *ctx, const xmlChar *name ) override; + void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ) override; // for use in the dialog window - const char* getName() { + const char* getName() override { return message; } - IGL2DWindow* Highlight(); - void DropHighlight(); + IGL2DWindow* Highlight() override; + void DropHighlight() override; // IGL2DWindow interface -------------------------------- // Increment the number of references to this object - void IncRef() { + void IncRef() override { refCount++; } // Decrement the reference count - void DecRef() { + void DecRef() override { refCount--; if ( refCount <= 0 ) { delete this; } } - void Draw2D( VIEWTYPE vt ); + void Draw2D( VIEWTYPE vt ) override; }; class CWindingMsg final : public ISAXHandler, public IGL2DWindow @@ -134,32 +134,32 @@ public: numpoints = 0; } // SAX interface - void Release(){ + void Release() override { delete this; } - void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); - void saxEndElement( message_info_t *ctx, const xmlChar *name ); - void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); + void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ) override; + void saxEndElement( message_info_t *ctx, const xmlChar *name ) override; + void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ) override; // for use in the dialog window - const char* getName() { + const char* getName() override { return message; } - IGL2DWindow* Highlight(); - void DropHighlight(); + IGL2DWindow* Highlight() override; + void DropHighlight() override; // IGL2DWindow interface -------------------------------- // Increment the number of references to this object - void IncRef() { + void IncRef() override { refCount++; } // Decrement the reference count - void DecRef() { + void DecRef() override { refCount--; if ( refCount <= 0 ) { delete this; } } - void Draw2D( VIEWTYPE vt ); + void Draw2D( VIEWTYPE vt ) override; }; class CDbgDlg : public Dialog diff --git a/radiant/filetypes.cpp b/radiant/filetypes.cpp index e95c5340..550fb273 100644 --- a/radiant/filetypes.cpp +++ b/radiant/filetypes.cpp @@ -58,10 +58,10 @@ public: RadiantFileTypeRegistry(){ addType( "*", "*", filetype_t( "All Files", "*.*" ) ); } - void addType( const char* moduleType, const char* moduleName, filetype_t type ){ + void addType( const char* moduleType, const char* moduleName, filetype_t type ) override { m_typelists[moduleType].push_back( filetype_copy_t( moduleName, type ) ); } - void getTypeList( const char* moduleType, IFileTypeList* typelist, bool want_load, bool want_import, bool want_save ){ + void getTypeList( const char* moduleType, IFileTypeList* typelist, bool want_load, bool want_import, bool want_save ) override { filetype_list_t& list_ref = m_typelists[moduleType]; for ( filetype_list_t::iterator i = list_ref.begin(); i != list_ref.end(); ++i ) { @@ -98,7 +98,7 @@ const char* findModuleName( IFileTypeRegistry* registry, const char* moduleType, strncpy( m_pattern + 2, ext, 125 ); m_pattern[127] = '\0'; } - void addType( const char* moduleName, filetype_t type ){ + void addType( const char* moduleName, filetype_t type ) override { if ( extension_equal( m_pattern, type.pattern ) ) { m_moduleName = moduleName; } diff --git a/radiant/filterbar.cpp b/radiant/filterbar.cpp index 16a9cd18..8b294dc8 100644 --- a/radiant/filterbar.cpp +++ b/radiant/filterbar.cpp @@ -1,7 +1,5 @@ #include "filterbar.h" #include "gtkmisc.h" -#include "gtkutil/widget.h" -#include "gtkutil/toolbar.h" #include "stream/stringstream.h" #include "select.h" #include "iundo.h" @@ -10,6 +8,7 @@ #include "commands.h" #include "gtkutil/accelerator.h" #include "generic/callback.h" +#include "math/vector.h" #include #include diff --git a/radiant/filters.cpp b/radiant/filters.cpp index 2e485102..2e27414a 100644 --- a/radiant/filters.cpp +++ b/radiant/filters.cpp @@ -25,15 +25,13 @@ #include "ifilter.h" -#include "scenelib.h" +#include "iscenegraph.h" #include #include #include "gtkutil/widget.h" -#include "gtkutil/menu.h" #include "gtkmisc.h" -#include "mainframe.h" #include "commands.h" #include "preferences.h" @@ -87,16 +85,16 @@ void UpdateFilters(){ class BasicFilterSystem : public FilterSystem { public: - void addFilter( Filter& filter, int mask ){ + void addFilter( Filter& filter, int mask ) override { g_filters.push_back( FilterWrapper( filter, mask ) ); g_filters.back().update(); } - void registerFilterable( Filterable& filterable ){ + void registerFilterable( Filterable& filterable ) override { filterable.updateFiltered(); const bool inserted = g_filterables.insert( &filterable ).second; ASSERT_MESSAGE( inserted, "filterable already registered" ); } - void unregisterFilterable( Filterable& filterable ){ + void unregisterFilterable( Filterable& filterable ) override { const bool erased = g_filterables.erase( &filterable ); ASSERT_MESSAGE( erased, "filterable not registered" ); } diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index eb189dc7..e902562c 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -29,8 +29,6 @@ #include "debugging/debugging.h" -#include "ishaders.h" - #include #include #include "gtkutil/lineedit.h" diff --git a/radiant/glwidget.cpp b/radiant/glwidget.cpp index 83b18c3f..0bd9b37f 100644 --- a/radiant/glwidget.cpp +++ b/radiant/glwidget.cpp @@ -23,7 +23,6 @@ #include "igtkgl.h" #include "modulesystem.h" -#include "gtkutil/glwidget.h" class GtkGLAPI { diff --git a/radiant/grid.cpp b/radiant/grid.cpp index f510ca6a..23709808 100644 --- a/radiant/grid.cpp +++ b/radiant/grid.cpp @@ -27,7 +27,6 @@ #include "preferencesystem.h" -#include "gtkutil/widget.h" #include "signal/signal.h" #include "stringio.h" diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 3d6a3879..caaa9c37 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -37,13 +37,6 @@ #include #include "gtkutil/guisettings.h" -#include "gtkutil/widget.h" -#include "gtkutil/accelerator.h" -#include "entityinspector.h" -#include "gtkmisc.h" -#include "console.h" -#include "commands.h" - class GroupDlg { diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 8c9d9224..e9d698dd 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -42,7 +42,6 @@ #include "igl.h" #include "iscenegraph.h" -#include "iselection.h" #include #include @@ -59,8 +58,6 @@ #include #include "os/path.h" -#include "math/aabb.h" -#include "container/array.h" #include "generic/static.h" #include "stream/stringstream.h" #include "gtkutil/messagebox.h" @@ -68,7 +65,6 @@ #include "gtkmisc.h" #include "brushmanip.h" -#include "build.h" #include "qe3.h" #include "texwindow.h" #include "xywindow.h" @@ -2045,7 +2041,7 @@ private: LoadTexturesByTypeVisitor( const char* dirstring, TexTree& texTree ) : m_dirstring( dirstring ), m_texTree( texTree ), m_stringStream( 64 ) {} - void visit( const char* minor, const _QERPlugImageTable& table ) const { + void visit( const char* minor, const _QERPlugImageTable& table ) const override { GlobalFileSystem().forEachFile( m_dirstring, minor, InsertCaller( *this ), 99 ); } }; diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index de837276..f8b7a940 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -34,13 +34,11 @@ #include "gtkmisc.h" -#include "math/vector.h" +#include "generic/vector.h" #include "os/path.h" #include "gtkutil/dialog.h" #include "gtkutil/filechooser.h" -#include "gtkutil/menu.h" -#include "gtkutil/toolbar.h" #include "gtkutil/image.h" #include "commands.h" diff --git a/radiant/help.cpp b/radiant/help.cpp index 1ac2b328..3dbcd652 100644 --- a/radiant/help.cpp +++ b/radiant/help.cpp @@ -23,7 +23,6 @@ #include "debugging/debugging.h" -#include #include #include diff --git a/radiant/image.cpp b/radiant/image.cpp index 3c1264b5..c6a601ba 100644 --- a/radiant/image.cpp +++ b/radiant/image.cpp @@ -26,8 +26,6 @@ #include "ifilesystem.h" #include "iarchive.h" -#include "generic/reference.h" -#include "os/path.h" #include "stream/stringstream.h" @@ -45,7 +43,7 @@ Image* QERApp_LoadImage( void* environment, const char* name ){ LoadImageVisitor( const char* name, Image*& image ) : m_name( name ), m_image( image ){ } - void visit( const char* name, const _QERPlugImageTable& table ) const { + void visit( const char* name, const _QERPlugImageTable& table ) const override { if ( m_image == 0 ) { ArchiveFile* file = GlobalFileSystem().openFile( StringStream( m_name, '.', name ) ); if ( file != 0 ) { diff --git a/radiant/layerswindow.cpp b/radiant/layerswindow.cpp index 7861ca3b..104897fa 100644 --- a/radiant/layerswindow.cpp +++ b/radiant/layerswindow.cpp @@ -71,7 +71,7 @@ public: } void visit( scene::Instance& instance ) const override { scene::Node& node = instance.path().top().get(); - if( Entity *entity; !( ( entity = Node_getEntity( node ) ) && entity->isContainer() ) ) + if( Entity *entity = Node_getEntity( node ); entity == nullptr || !entity->isContainer() ) node.m_layer = m_layer; } }; @@ -200,7 +200,7 @@ template void items_iterate_recursively( QTreeWidgetItem *item, Functor&& functor ){ functor( item ); for( int i = 0; i < item->childCount(); ++i ) - items_iterate_recursively( item->child( i ), functor ); + items_iterate_recursively( item->child( i ), std::forward( functor ) ); } Layer::iterator item_getLayerIterator( QTreeWidgetItem *item ){ diff --git a/radiant/main.cpp b/radiant/main.cpp index 26b0d538..2a303bdd 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -67,8 +67,6 @@ #include "debugging/debugging.h" -#include "iundo.h" - #include "commandlib.h" #include "os/file.h" #include "os/path.h" @@ -164,7 +162,7 @@ public: LineLimitedTextOutputStream( TextOutputStream& outputStream, std::size_t count ) : outputStream( outputStream ), count( count ){ } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { if ( count != 0 ) { const char* p = buffer; const char* end = buffer + length; @@ -191,13 +189,13 @@ class PopupDebugMessageHandler : public DebugMessageHandler StringOutputStream m_buffer; Lock m_lock; public: - TextOutputStream& getOutputStream(){ + TextOutputStream& getOutputStream() override { if ( !m_lock.locked() ) { return m_buffer; } return globalErrorStream(); } - bool handleMessage(){ + bool handleMessage() override { getOutputStream() << "----------------\n"; LineLimitedTextOutputStream outputStream( getOutputStream(), 24 ); write_stack_trace( outputStream ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 134f9a01..cd1fb0ba 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -31,12 +31,10 @@ #include "version.h" #include "ifilesystem.h" -#include "iundo.h" -#include "ifilter.h" -#include "itoolbar.h" -#include "editable.h" #include "ientity.h" #include "ishaders.h" +#include "ieclass.h" +#include "irender.h" #include "igl.h" #include "moduleobserver.h" @@ -66,21 +64,17 @@ #include "os/path.h" #include "os/file.h" #include -#include "eclasslib.h" #include "moduleobservers.h" #include "gtkutil/glfont.h" #include "gtkutil/glwidget.h" #include "gtkutil/image.h" #include "gtkutil/menu.h" -#include "gtkutil/toolbar.h" -#include "gtkutil/widget.h" #include "gtkutil/guisettings.h" #include "autosave.h" #include "build.h" #include "brushmanip.h" -#include "brushmodule.h" #include "camwindow.h" #include "csg.h" #include "commands.h" @@ -97,13 +91,11 @@ #include "help.h" #include "map.h" #include "mru.h" -#include "patchdialog.h" #include "patchmanip.h" #include "plugin.h" #include "pluginmanager.h" #include "pluginmenu.h" #include "plugintoolbar.h" -#include "points.h" #include "preferences.h" #include "qe3.h" #include "qgl.h" @@ -135,13 +127,13 @@ class VFSModuleObserver : public ModuleObserver public: VFSModuleObserver() : m_unrealised( 1 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { QE_InitVFS(); GlobalFileSystem().initialise(); } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { GlobalFileSystem().shutdown(); } @@ -256,13 +248,13 @@ class HomePathsModuleObserver : public ModuleObserver public: HomePathsModuleObserver() : m_unrealised( 1 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { HomePaths_Realise(); g_homePathObservers.realise(); } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { g_homePathObservers.unrealise(); } @@ -573,12 +565,12 @@ class WorldspawnColourEntityClassObserver : public ModuleObserver public: WorldspawnColourEntityClassObserver() : m_unrealised( 1 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { SetWorldspawnColour( g_xywindow_globals.color_brushes ); } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { } } diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 307e15da..0dbb42a9 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -22,7 +22,6 @@ #pragma once #include "gtkutil/idledraw.h" -#include "gtkutil/widget.h" #include "string/string.h" #include "qerplugin.h" diff --git a/radiant/map.cpp b/radiant/map.cpp index cb7c8553..9c194ad7 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -27,26 +27,17 @@ #include "iselection.h" #include "iundo.h" #include "ibrush.h" -#include "ifilter.h" #include "ireference.h" -#include "ifiletypes.h" #include "ieclass.h" #include "irender.h" #include "ientity.h" -#include "editable.h" #include "ifilesystem.h" #include "namespace.h" #include "moduleobserver.h" -#include - #include "scenelib.h" -#include "transformlib.h" -#include "selectionlib.h" -#include "instancelib.h" #include "traverselib.h" #include "maplib.h" -#include "eclasslib.h" #include "commandlib.h" #include "stream/textfilestream.h" #include "os/path.h" @@ -57,12 +48,12 @@ #include "signal/signal.h" #include "gtkutil/filechooser.h" +#include "gtkutil/widget.h" #include "timer.h" #include "select.h" #include "plugin.h" #include "filetypes.h" #include "gtkdlgs.h" -#include "entityinspector.h" #include "points.h" #include "qe3.h" #include "camwindow.h" @@ -75,7 +66,6 @@ #include "autosave.h" #include "brushmodule.h" #include "brush.h" -#include "patch.h" #include "grid.h" class NameObserver @@ -129,13 +119,13 @@ public: ~BasicNamespace(){ ASSERT_MESSAGE( m_names.empty(), "namespace: names still registered at shutdown" ); } - void attach( const NameCallback& setName, const NameCallbackCallback& attachObserver ){ + void attach( const NameCallback& setName, const NameCallbackCallback& attachObserver ) override { std::pair result = m_names.insert( Names::value_type( setName, m_uniqueNames ) ); ASSERT_MESSAGE( result.second, "cannot attach name" ); attachObserver( NameObserver::NameChangedCaller( ( *result.first ).second ) ); //globalOutputStream() << "attach: " << reinterpret_cast( setName ) << '\n'; } - void detach( const NameCallback& setName, const NameCallbackCallback& detachObserver ){ + void detach( const NameCallback& setName, const NameCallbackCallback& detachObserver ) override { Names::iterator i = m_names.find( setName ); ASSERT_MESSAGE( i != m_names.end(), "cannot detach name" ); //globalOutputStream() << "detach: " << reinterpret_cast( setName ) << '\n'; @@ -143,7 +133,7 @@ public: m_names.erase( i ); } - void makeUnique( const char* name, const NameCallback& setName ) const { + void makeUnique( const char* name, const NameCallback& setName ) const override { char buffer[1024]; name_write( buffer, m_uniqueNames.make_unique( name_read( name ) ) ); setName( buffer ); @@ -218,7 +208,7 @@ void Node_gatherNamespaced( scene::Node& node ){ class GatherNamespaced : public scene::Traversable::Walker { public: - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { Node_gatherNamespaced( node ); return true; } @@ -288,7 +278,7 @@ public: Map() : m_resource( 0 ), m_valid( false ), m_modified_changed( Map_UpdateTitle ){ } - void realise(){ + void realise() override { if ( m_resource != 0 ) { if ( Map_Unnamed( *this ) ) { g_map.m_resource->setNode( NewMapRoot( "" ).get_pointer() ); @@ -309,7 +299,7 @@ public: Map_SetValid( g_map, true ); } } - void unrealise(){ + void unrealise() override { if ( m_resource != 0 ) { Map_SetValid( g_map, false ); Map_SetWorldspawn( g_map, 0 ); @@ -419,7 +409,7 @@ public: EntityFindByClassname( const char* name, Entity*& entity ) : m_name( name ), m_entity( entity ){ m_entity = 0; } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( m_entity == 0 ) { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 @@ -502,7 +492,7 @@ inline bool node_is_worldspawn( scene::Node& node ){ class entity_updateworldspawn : public scene::Traversable::Walker { public: - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( node_is_worldspawn( node ) ) { if ( Map_GetWorldspawn( g_map ) == 0 ) { Map_SetWorldspawn( g_map, &node ); @@ -528,7 +518,7 @@ class CollectAllWalker : public scene::Traversable::Walker public: CollectAllWalker( scene::Node& root, UnsortedNodeSet& nodes ) : m_root( root ), m_nodes( nodes ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { m_nodes.insert( NodeSmartReference( node ) ); Node_getTraversable( m_root )->erase( node ); return false; @@ -572,7 +562,7 @@ public: LayersMergeWalker( Layers *currentLayers ){ currentLayers->forEach( [this]( Layer& layer ){ m_layersVec.push_back( &layer ); } ); } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if( node.m_layer != nullptr ) node.m_layer = m_layersVec[ node.m_layer->m_ownIndex ]; return true; @@ -585,7 +575,7 @@ class LayersAssignWalker : public scene::Traversable::Walker public: LayersAssignWalker( Layer *current ) : m_current( current ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if( Entity *entity; !( ( entity = Node_getEntity( node ) ) && entity->isContainer() ) ) node.m_layer = m_current; return true; @@ -611,13 +601,13 @@ public: MapMergeAll( const scene::Path& root ) : m_path( root ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { Node_getTraversable( m_path.top() )->insert( node ); m_path.push( makeReference( node ) ); selectPath( m_path, true ); return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { m_path.pop(); } }; @@ -629,7 +619,7 @@ public: MapMergeEntities( const scene::Path& root ) : m_path( root ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( node_is_worldspawn( node ) ) { scene::Node* world_node = Map_FindWorldspawn( g_map ); if ( world_node == 0 ) { @@ -658,7 +648,7 @@ public: } return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { m_path.pop(); } }; @@ -694,7 +684,7 @@ public: BasicContainer() : m_node( this, this, StaticTypeCasts::instance().get(), nullptr ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ @@ -725,7 +715,7 @@ public: Convert_Brushes( TexdefTypeId in, TexdefTypeId out ) : _convert_faces( in, out ) { } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if( node.isRoot() ) { return false; } @@ -735,7 +725,7 @@ public: } return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { } }; @@ -774,7 +764,7 @@ public: CloneAll( scene::Node& root ) : m_path( makeReference( root ) ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( node.isRoot() ) { return false; } @@ -784,7 +774,7 @@ public: return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( node.isRoot() ) { return; } @@ -814,7 +804,7 @@ public: CloneAllSelected( scene::Node& root ) : m_path( makeReference( root ) ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( node.isRoot() ) { return false; } @@ -826,7 +816,7 @@ public: return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( node.isRoot() ) { return; } @@ -859,7 +849,7 @@ public: EntityBreakdownWalker( EntityBreakdown& entitymap ) : m_entitymap( entitymap ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 ) { ++m_entitymap[entity->getClassName()]; @@ -881,7 +871,7 @@ public: CountStuffWalker( int& ents_ingame, int& groupents, int& groupents_ingame ) : m_ents_ingame( ents_ingame ), m_groupents( groupents ), m_groupents_ingame( groupents_ingame ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 ){ const char* classname = entity->getClassName(); @@ -1053,7 +1043,7 @@ public: ExcludeWalker( const scene::Traversable::Walker& walker, const Excluder& exclude ) : m_walker( walker ), m_exclude( &exclude ), m_skip( false ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( m_exclude->excluded( node ) || node.isRoot() ) { m_skip = true; return false; @@ -1064,7 +1054,7 @@ public: } return true; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( m_skip ) { m_skip = false; } @@ -1082,7 +1072,7 @@ public: AnyInstanceSelected( bool& selected ) : m_selected( selected ){ m_selected = false; } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { if ( Instance_isSelected( instance ) ) { m_selected = true; } @@ -1105,7 +1095,7 @@ public: m_selected = false; } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( node.isRoot() ) { return false; } @@ -1127,7 +1117,7 @@ bool Node_selectedDescendant( scene::Node& node ){ class SelectionExcluder : public Excluder { public: - bool excluded( scene::Node& node ) const { + bool excluded( scene::Node& node ) const override { return !Node_selectedDescendant( node ); } }; @@ -1145,7 +1135,7 @@ public: IncludeSelectedWalker( const scene::Traversable::Walker& walker ) : m_walker( walker ), m_selected( 0 ), m_skip( false ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { // include node if: // node is not a 'root' AND ( node is selected OR any child of node is selected OR any parent of node is selected ) if ( !node.isRoot() && ( Node_selectedDescendant( node ) || selectedParent() ) ) { @@ -1161,7 +1151,7 @@ public: return false; } } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if ( m_skip ) { m_skip = false; } @@ -1200,7 +1190,7 @@ void Map_Traverse( scene::Node& root, const scene::Traversable::Walker& walker ) class RegionExcluder : public Excluder { public: - bool excluded( scene::Node& node ) const { + bool excluded( scene::Node& node ) const override { return node.excluded( scene::Node::eExcluded ); } }; @@ -1391,7 +1381,7 @@ public: ExcludeAllWalker( bool exclude ) : m_exclude( exclude ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { exclude_node( path.top(), m_exclude ); return true; @@ -1409,7 +1399,7 @@ public: ExcludeSelectedWalker( bool exclude ) : m_exclude( exclude ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( !path.top().get().isRoot() ) /* don't touch model node: disabling one will disable all instances! */ exclude_node( path.top(), ( instance.isSelected() || instance.childSelected() || instance.parentSelected() ) == m_exclude ); return true; @@ -1428,7 +1418,7 @@ public: ExcludeRegionedWalker( bool exclude ) : m_exclude( exclude ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( !path.top().get().isRoot() ){ /* don't touch model node: disabling one will disable all its instances! */ const bool exclude = m_exclude == aabb_intersects_aabb( instance.worldAABB(), m_region ); exclude_node( path.top(), exclude ); @@ -1670,10 +1660,10 @@ class ParentSelectedBrushesToEntityWalker : public scene::Graph::Walker public: ParentSelectedBrushesToEntityWalker( scene::Node& parent ) : m_parent( parent ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { return path.top().get_pointer() != &m_parent; /* skip traverse of target node */ } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( Node_isPrimitive( path.top() ) ){ if ( Instance_isSelected( instance ) ){ NodeSmartReference node( path.top().get() ); @@ -1707,7 +1697,7 @@ public: CountSelectedBrushes( std::size_t& count ) : m_count( count ), m_depth( 0 ){ m_count = 0; } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( ++m_depth != 1 && path.top().get().isRoot() ) { return false; } @@ -1717,7 +1707,7 @@ public: } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -1957,7 +1947,7 @@ public: BrushFindByIndexWalker( std::size_t index, scene::Path& path ) : m_index( index ), m_path( path ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( Node_isPrimitive( node ) && m_index-- == 0 ) { m_path.push( makeReference( node ) ); } @@ -1973,7 +1963,7 @@ public: EntityFindByIndexWalker( std::size_t index, scene::Path& path ) : m_index( index ), m_path( path ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( Node_isEntity( node ) && m_index-- == 0 ) { m_path.push( makeReference( node ) ); } @@ -2023,7 +2013,7 @@ public: BrushFindIndexWalker( const scene::Node& node, std::size_t& count ) : m_node( &node ), m_count( count ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( Node_isPrimitive( node ) ) { if ( m_node == &node ) { m_node = 0; @@ -2044,7 +2034,7 @@ public: EntityFindIndexWalker( const scene::Node& node, std::size_t& count ) : m_node( &node ), m_count( count ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if ( Node_isEntity( node ) ) { if ( m_node == &node ) { m_node = 0; @@ -2140,7 +2130,7 @@ void map_autocaulk_selected(){ { mutable const scene::Instance* m_trigger = 0; public: - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( path.size() == 2 ){ Entity* entity = Node_getEntity( path.top() ); if( entity != 0 && entity->isContainer() && string_equal_nocase_n( entity->getClassName(), "trigger_", 8 ) @@ -2151,7 +2141,7 @@ void map_autocaulk_selected(){ } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if( m_trigger ) Instance_setSelected( instance, false ); if( m_trigger == &instance ) @@ -2199,7 +2189,7 @@ void map_autocaulk_selected(){ WriteBrushesWalker( TokenWriter& writer ) : m_writer( writer ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { if( Node_getBrush( node ) ){ NodeTypeCast::cast( node )->exportTokens( m_writer ); } @@ -2238,7 +2228,7 @@ void map_autocaulk_selected(){ selected_point_entities_walker( const scene::Traversable::Walker& walker ) : m_walker( walker ), m_skip( false ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { Entity* entity = Node_getEntity( node ); if( !node.isRoot() && entity != 0 && !entity->isContainer() && Node_instanceSelected( node ) ) { m_walker.pre( node ); @@ -2248,7 +2238,7 @@ void map_autocaulk_selected(){ } return false; } - void post( scene::Node& node ) const { + void post( scene::Node& node ) const override { if( m_skip ) m_skip = false; else @@ -2321,7 +2311,7 @@ void map_autocaulk_selected(){ CaulkBrushesWalker( CaulkMap& map ) : m_map( map ){ } - bool pre( scene::Node& node ) const { + bool pre( scene::Node& node ) const override { Brush* brush = Node_getBrush( node ); if( brush ){ CaulkMap::const_iterator iter = m_map.find( m_brushIndex ); @@ -2388,7 +2378,7 @@ class MapEntityClasses : public ModuleObserver public: MapEntityClasses() : m_unrealised( 1 ){ } - void realise(){ + void realise() override{ if ( --m_unrealised == 0 ) { if ( g_map.m_resource != 0 ) { ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Map" ); @@ -2396,7 +2386,7 @@ public: } } } - void unrealise(){ + void unrealise() override{ if ( ++m_unrealised == 1 ) { if ( g_map.m_resource != 0 ) { g_map.m_resource->flush(); @@ -2415,14 +2405,14 @@ class MapModuleObserver : public ModuleObserver public: MapModuleObserver() : m_unrealised( 1 ){ } - void realise(){ + void realise() override{ if ( --m_unrealised == 0 ) { ASSERT_MESSAGE( !g_qeglobals.m_userGamePath.empty(), "maps_directory: user-game-path is empty" ); g_mapsPath = StringStream( g_qeglobals.m_userGamePath, "maps/" ); Q_mkdir( g_mapsPath.c_str() ); } } - void unrealise(){ + void unrealise() override{ if ( ++m_unrealised == 1 ) { g_mapsPath = ""; } diff --git a/radiant/modelwindow.cpp b/radiant/modelwindow.cpp index 2c035d3e..d1dfc9d9 100644 --- a/radiant/modelwindow.cpp +++ b/radiant/modelwindow.cpp @@ -30,7 +30,6 @@ #include "igl.h" #include "irender.h" #include "renderable.h" -#include "render.h" #include "renderer.h" #include "view.h" #include "os/path.h" @@ -42,10 +41,10 @@ #include "gtkutil/glwidget.h" #include "gtkutil/toolbar.h" #include "gtkutil/cursor.h" -#include "gtkmisc.h" #include "gtkutil/fbo.h" #include "gtkutil/mousepresses.h" #include "gtkutil/guisettings.h" +#include "gtkutil/widget.h" #include #include @@ -81,18 +80,18 @@ public: ModelGraph( scene::Instantiable::Observer& observer ) : m_observer( observer ){ } - void addSceneChangedCallback( const SignalHandler& handler ){ + void addSceneChangedCallback( const SignalHandler& handler ) override { ASSERT_MESSAGE( 0, "Reached unreachable: addSceneChangedCallback()" ); } - void sceneChanged(){ + void sceneChanged() override { ASSERT_MESSAGE( 0, "Reached unreachable: sceneChanged()" ); } - scene::Node& root(){ + scene::Node& root() override { ASSERT_MESSAGE( !m_rootpath.empty(), "scenegraph root does not exist" ); return m_rootpath.top(); } - void insert_root( scene::Node& root ){ + void insert_root( scene::Node& root ) override { //globalOutputStream() << "insert_root\n"; ASSERT_MESSAGE( m_rootpath.empty(), "scenegraph root already exists" ); @@ -103,7 +102,7 @@ public: m_rootpath.push( makeReference( root ) ); } - void erase_root(){ + void erase_root() override { //globalOutputStream() << "erase_root\n"; ASSERT_MESSAGE( !m_rootpath.empty(), "scenegraph root does not exist" ); @@ -116,50 +115,50 @@ public: root.DecRef(); } - class Layer* currentLayer(){ + class Layer* currentLayer() override { ASSERT_MESSAGE( 0, "Reached unreachable: currentLayer()" ); return nullptr; } - void boundsChanged(){ + void boundsChanged() override { ASSERT_MESSAGE( 0, "Reached unreachable: boundsChanged()" ); } - void traverse( const Walker& walker ){ + void traverse( const Walker& walker ) override { ASSERT_MESSAGE( 0, "Reached unreachable: traverse()" ); } - void traverse_subgraph( const Walker& walker, const scene::Path& start ){ + void traverse_subgraph( const Walker& walker, const scene::Path& start ) override { ASSERT_MESSAGE( 0, "Reached unreachable: traverse_subgraph()" ); } - scene::Instance* find( const scene::Path& path ){ + scene::Instance* find( const scene::Path& path ) override { ASSERT_MESSAGE( 0, "Reached unreachable: find()" ); return nullptr; } - void insert( scene::Instance* instance ){ + void insert( scene::Instance* instance ) override { m_instances.insert( InstanceMap::value_type( PathConstReference( instance->path() ), instance ) ); m_observer.insert( instance ); } - void erase( scene::Instance* instance ){ + void erase( scene::Instance* instance ) override { m_instances.erase( PathConstReference( instance->path() ) ); m_observer.erase( instance ); } - SignalHandlerId addBoundsChangedCallback( const SignalHandler& boundsChanged ){ + SignalHandlerId addBoundsChangedCallback( const SignalHandler& boundsChanged ) override { ASSERT_MESSAGE( 0, "Reached unreachable: addBoundsChangedCallback()" ); return Handle>( nullptr ); } - void removeBoundsChangedCallback( SignalHandlerId id ){ + void removeBoundsChangedCallback( SignalHandlerId id ) override { ASSERT_MESSAGE( 0, "Reached unreachable: removeBoundsChangedCallback()" ); } - TypeId getNodeTypeId( const char* name ){ + TypeId getNodeTypeId( const char* name ) override { ASSERT_MESSAGE( 0, "Reached unreachable: getNodeTypeId()" ); return 0; } - TypeId getInstanceTypeId( const char* name ){ + TypeId getInstanceTypeId( const char* name ) override { ASSERT_MESSAGE( 0, "Reached unreachable: getInstanceTypeId()" ); return 0; } @@ -236,7 +235,7 @@ public: m_observer = 0; } /// \brief \copydoc scene::Traversable::insert() - void insert( scene::Node& node ){ + void insert( scene::Node& node ) override { ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableModelNodeSet::insert: sanity check failed" ); ASSERT_MESSAGE( m_children.find( NodeSmartReference( node ) ) == m_children.end(), "TraversableModelNodeSet::insert - element already exists" ); @@ -248,7 +247,7 @@ public: } } /// \brief \copydoc scene::Traversable::erase() - void erase( scene::Node& node ){ + void erase( scene::Node& node ) override { ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableModelNodeSet::erase: sanity check failed" ); ASSERT_MESSAGE( m_children.find( NodeSmartReference( node ) ) != m_children.end(), "TraversableModelNodeSet::erase - failed to find element" ); @@ -260,7 +259,7 @@ public: m_children.erase( NodeSmartReference( node ) ); } /// \brief \copydoc scene::Traversable::traverse() - void traverse( const Walker& walker ){ + void traverse( const Walker& walker ) override { UnsortedNodeSet::iterator i = m_children.begin(); while ( i != m_children.end() ) { @@ -271,7 +270,7 @@ public: } } /// \brief \copydoc scene::Traversable::empty() - bool empty() const { + bool empty() const override { return m_children.empty(); } }; @@ -314,7 +313,7 @@ public: } ~ModelGraphRoot(){ } - void release(){ + void release() override { m_traverse.detach( this ); delete this; } @@ -322,10 +321,10 @@ public: return m_node; } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } @@ -333,16 +332,16 @@ public: return ( new ModelGraphRoot( *this ) )->node(); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new SelectableInstance( path, parent ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; @@ -410,30 +409,30 @@ public: destroy(); } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - void insert( scene::Node& child ){ + void insert( scene::Node& child ) override { m_instances.insert( child ); } - void erase( scene::Node& child ){ + void erase( scene::Node& child ) override { m_instances.erase( child ); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new SelectableInstance( path, parent ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } @@ -722,25 +721,25 @@ public: m_state_stack.push_back( state_type() ); } - void SetState( Shader* state, EStyle style ){ + void SetState( Shader* state, EStyle style ) override { ASSERT_NOTNULL( state ); if ( style == eFullMaterials ) { m_state_stack.back().m_state = state; } } - EStyle getStyle() const { + EStyle getStyle() const override { return eFullMaterials; } - void PushState(){ + void PushState() override { m_state_stack.push_back( m_state_stack.back() ); } - void PopState(){ + void PopState() override { ASSERT_MESSAGE( !m_state_stack.empty(), "popping empty stack" ); m_state_stack.pop_back(); } - void Highlight( EHighlightMode mode, bool bEnable = true ){ + void Highlight( EHighlightMode mode, bool bEnable = true ) override { } - void addRenderable( const OpenGLRenderable& renderable, const Matrix4& localToWorld ){ + void addRenderable( const OpenGLRenderable& renderable, const Matrix4& localToWorld ) override { m_state_stack.back().m_state->addRenderable( renderable, localToWorld ); } diff --git a/radiant/nullmodel.cpp b/radiant/nullmodel.cpp index e18a0d13..c1d8390c 100644 --- a/radiant/nullmodel.cpp +++ b/radiant/nullmodel.cpp @@ -26,10 +26,8 @@ #include "iscenegraph.h" #include "irender.h" #include "iselection.h" -#include "iundo.h" #include "ientity.h" #include "ireference.h" -#include "igl.h" #include "cullable.h" #include "renderable.h" #include "selectable.h" @@ -55,11 +53,11 @@ public: GlobalShaderCache().release( "" ); } - VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& volume, const Matrix4& localToWorld ) const override { return volume.TestAABB( m_aabb_local, localToWorld ); } - const AABB& localAABB() const { + const AABB& localAABB() const override { return m_aabb_local; } @@ -116,14 +114,14 @@ public: m_nullmodel( nullmodel ){ } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_nullmodel.renderSolid( renderer, volume, Instance::localToWorld() ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_nullmodel.renderWireframe( renderer, volume, Instance::localToWorld() ); } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { m_nullmodel.testSelect( selector, test, Instance::localToWorld() ); } }; @@ -154,23 +152,23 @@ public: m_node.m_isRoot = true; } - void release(){ + void release() override { delete this; } scene::Node& node(){ return m_node; } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new NullModelInstance( path, parent, m_nullmodel ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; diff --git a/radiant/patch.cpp b/radiant/patch.cpp index b0f1c78e..9106157a 100644 --- a/radiant/patch.cpp +++ b/radiant/patch.cpp @@ -24,8 +24,8 @@ #include "patch.h" #include -#include "preferences.h" #include "brush_primit.h" +#include "texturelib.h" #include "signal/signal.h" diff --git a/radiant/patch.h b/radiant/patch.h index 32af2a8f..cc309cf3 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -41,7 +41,6 @@ #include "debugging/debugging.h" -#include #include #include "math/frustum.h" @@ -59,7 +58,6 @@ #include "shaderlib.h" #include "generic/callback.h" #include "signal/signalfwd.h" -#include "texturelib.h" #include "xml/ixml.h" #include "dragplanes.h" @@ -210,7 +208,7 @@ class RenderablePatchWireframe : public OpenGLRenderable public: RenderablePatchWireframe( PatchTesselation& tess ) : m_tess( tess ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { { #if NV_DRIVER_BUG gl().glVertexPointer( 3, GL_FLOAT, 0, 0 ); @@ -265,7 +263,7 @@ class RenderablePatchFixedWireframe : public OpenGLRenderable public: RenderablePatchFixedWireframe( PatchTesselation& tess ) : m_tess( tess ){ } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { gl().glVertexPointer( 3, GL_FLOAT, sizeof( ArbitraryMeshVertex ), &m_tess.m_vertices.data()->vertex ); const RenderIndex* strip_indices = m_tess.m_indices.data(); for ( std::size_t i = 0; i < m_tess.m_numStrips; i++, strip_indices += m_tess.m_lenStrips ) @@ -282,7 +280,7 @@ public: RenderablePatchSolid( PatchTesselation& tess ) : m_tess( tess ){ } void RenderNormals() const; - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { #if 0 if ( ( state & RENDER_FILL ) == 0 ) { RenderablePatchWireframe( m_tess ).render( state ); @@ -379,7 +377,7 @@ class Patch : m_subdivisions_y( subdivisions_y ){ } - void release(){ + void release() override { delete this; } @@ -568,12 +566,12 @@ public: } } - const char* name() const { + const char* name() const override { return "patch"; } - void attach( const NameCallback& callback ){ + void attach( const NameCallback& callback ) override { } - void detach( const NameCallback& callback ){ + void detach( const NameCallback& callback ) override { } void attach( Observer* observer ){ @@ -585,7 +583,7 @@ public: m_observers.erase( observer ); } - void updateFiltered(){ + void updateFiltered() override { if ( m_node != 0 ) { if ( patch_filtered( *this ) ) { m_node->enable( scene::Node::eFiltered ); @@ -604,14 +602,14 @@ public: } } - const Matrix4& localToParent() const { + const Matrix4& localToParent() const override { return g_matrix4_identity; } - const AABB& localAABB() const { + const AABB& localAABB() const override { const_cast( this )->evaluateTransform(); //experimental! fixing extra sceneChangeNotify call during scene rendering return m_aabb_local; } - VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const { + VolumeIntersectionValue intersectVolume( const VolumeTest& test, const Matrix4& localToWorld ) const override { return test.TestAABB( m_aabb_local, localToWorld ); } void render_solid( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld ) const { @@ -695,7 +693,7 @@ public: } bool isValid() const; - void snapto( float snap ){ + void snapto( float snap ) override { undoSave(); for ( PatchControlIter i = m_ctrl.data(); i != m_ctrl.data() + m_ctrl.size(); ++i ) @@ -712,7 +710,7 @@ public: void RenderDebug( RenderStateFlags state ) const; void RenderNormals( RenderStateFlags state ) const; - void pushElement( const XMLElement& element ){ + void pushElement( const XMLElement& element ) override { switch ( m_xml_state.back().state() ) { case xml_state_t::eDefault: @@ -733,7 +731,7 @@ public: } } - void popElement( const char* name ){ + void popElement( const char* name ) override { switch ( m_xml_state.back().state() ) { case xml_state_t::eDefault: @@ -768,7 +766,7 @@ public: ASSERT_MESSAGE( !m_xml_state.empty(), "popping empty stack" ); m_xml_state.pop_back(); } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { switch ( m_xml_state.back().state() ) { case xml_state_t::eDefault: @@ -785,7 +783,7 @@ public: return length; } - void exportXML( XMLImporter& importer ){ + void exportXML( XMLImporter& importer ) override { StaticElement patchElement( "patch" ); importer.pushElement( patchElement ); @@ -935,10 +933,10 @@ public: } } - UndoMemento* exportState() const { + UndoMemento* exportState() const override { return new SavedState( m_width, m_height, m_ctrl, m_shader.c_str(), m_patchDef3, m_subdivisions_x, m_subdivisions_y ); } - void importState( const UndoMemento* state ){ + void importState( const UndoMemento* state ) override { undoSave(); const SavedState& other = *( static_cast( state ) ); @@ -1124,7 +1122,7 @@ class PatchTokenImporter : public MapImporter public: PatchTokenImporter( Patch& patch ) : m_patch( patch ){ } - bool importTokens( Tokeniser& tokeniser ){ + bool importTokens( Tokeniser& tokeniser ) override { RETURN_FALSE_IF_FAIL( Patch_importHeader( m_patch, tokeniser ) ); RETURN_FALSE_IF_FAIL( Patch_importShader( m_patch, tokeniser ) ); RETURN_FALSE_IF_FAIL( Patch_importParams( m_patch, tokeniser ) ); @@ -1141,7 +1139,7 @@ class PatchDoom3TokenImporter : public MapImporter public: PatchDoom3TokenImporter( Patch& patch ) : m_patch( patch ){ } - bool importTokens( Tokeniser& tokeniser ){ + bool importTokens( Tokeniser& tokeniser ) override { RETURN_FALSE_IF_FAIL( Patch_importHeader( m_patch, tokeniser ) ); RETURN_FALSE_IF_FAIL( PatchDoom3_importShader( m_patch, tokeniser ) ); RETURN_FALSE_IF_FAIL( Patch_importParams( m_patch, tokeniser ) ); @@ -1240,7 +1238,7 @@ class PatchTokenExporter : public MapExporter public: PatchTokenExporter( Patch& patch ) : m_patch( patch ){ } - void exportTokens( TokenWriter& writer ) const { + void exportTokens( TokenWriter& writer ) const override { Patch_exportHeader( m_patch, writer ); Patch_exportShader( m_patch, writer ); Patch_exportParams( m_patch, writer ); @@ -1255,7 +1253,7 @@ class PatchDoom3TokenExporter : public MapExporter public: PatchDoom3TokenExporter( Patch& patch ) : m_patch( patch ){ } - void exportTokens( TokenWriter& writer ) const { + void exportTokens( TokenWriter& writer ) const override { Patch_exportHeader( m_patch, writer ); PatchDoom3_exportShader( m_patch, writer ); Patch_exportParams( m_patch, writer ); @@ -1413,7 +1411,7 @@ public: } - void allocate( std::size_t size ){ + void allocate( std::size_t size ) override { m_ctrl_instances.clear(); m_ctrl_instances.reserve( size ); for ( Patch::iterator i = m_patch.begin(); i != m_patch.end(); ++i ) @@ -1422,7 +1420,7 @@ public: } } - void setSelected( bool select ){ + void setSelected( bool select ) override { m_selectable.setSelected( select ); if ( !select && parent() ){ Selectable* sel_parent = Instance_getSelectable( *parent() ); @@ -1430,7 +1428,7 @@ public: sel_parent->setSelected( false ); } } - bool isSelected() const { + bool isSelected() const override { return m_selectable.isSelected(); } @@ -1469,7 +1467,7 @@ public: } #endif - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { m_patch.evaluateTransform(); renderer.setLights( *m_lightList ); renderer.Highlight( Renderer::ePrimitiveWire ); @@ -1478,7 +1476,7 @@ public: renderComponentsSelected( renderer, volume ); } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { m_patch.evaluateTransform(); m_patch.render_wireframe( renderer, volume, localToWorld() ); @@ -1495,14 +1493,14 @@ public: renderer.addRenderable( m_render_selected, localToWorld() ); } } - void renderComponents( Renderer& renderer, const VolumeTest& volume ) const { + void renderComponents( Renderer& renderer, const VolumeTest& volume ) const override { m_patch.evaluateTransform(); if ( GlobalSelectionSystem().ComponentMode() == SelectionSystem::eVertex ) { m_patch.render_component( renderer, volume, localToWorld() ); } } - void testSelect( Selector& selector, SelectionTest& test ){ + void testSelect( Selector& selector, SelectionTest& test ) override { test.BeginMesh( localToWorld(), true ); m_patch.testSelect( selector, test ); } @@ -1513,7 +1511,7 @@ public: ( *i ).m_selectable.setSelected( select ); } } - bool isSelectedComponents() const { + bool isSelectedComponents() const override { for ( PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i ) { if ( ( *i ).m_selectable.isSelected() ) { @@ -1522,7 +1520,7 @@ public: } return false; } - void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ){ + void setSelectedComponents( bool select, SelectionSystem::EComponentMode mode ) override { if ( mode == SelectionSystem::eVertex ) { selectCtrl( select ); } @@ -1530,7 +1528,7 @@ public: m_dragPlanes.setSelected( select ); } } - void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ){ + void testSelectComponents( Selector& selector, SelectionTest& test, SelectionSystem::EComponentMode mode ) override { test.BeginMesh( localToWorld() ); switch ( mode ) @@ -1547,7 +1545,7 @@ public: break; } } - void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const { + void gatherComponentsHighlight( std::vector>& polygons, SelectionIntersection& intersection, SelectionTest& test, SelectionSystem::EComponentMode mode ) const override { test.BeginMesh( localToWorld() ); switch ( mode ) @@ -1571,7 +1569,7 @@ public: } } - const AABB& getSelectedComponentsBounds() const { + const AABB& getSelectedComponentsBounds() const override { m_aabb_component = AABB(); for ( PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i ) @@ -1583,7 +1581,7 @@ public: return m_aabb_component; } - void gatherSelectedComponents( const Vector3Callback& callback ) const { + void gatherSelectedComponents( const Vector3Callback& callback ) const override { for ( PatchControlInstances::const_iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i ) { if ( ( *i ).m_selectable.isSelected() ) { @@ -1652,7 +1650,7 @@ public: } - void snapComponents( float snap ){ + void snapComponents( float snap ) override { if ( selectedVertices() ) { m_patch.undoSave(); for ( PatchControlInstances::iterator i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i ) @@ -1684,7 +1682,7 @@ public: typedef MemberCaller ApplyTransformCaller; - bool testLight( const RendererLight& light ) const { + bool testLight( const RendererLight& light ) const override { return light.testAABB( worldAABB() ); } }; @@ -1771,7 +1769,7 @@ public: m_importMap( m_patch ), m_exportMap( m_patch ){ } - void release(){ + void release() override { delete this; } scene::Node& node(){ @@ -1784,20 +1782,20 @@ public: return m_patch; } - scene::Node& clone() const { + scene::Node& clone() const override { return ( new PatchNode( *this ) )->node(); } - scene::Instance* create( const scene::Path& path, scene::Instance* parent ){ + scene::Instance* create( const scene::Path& path, scene::Instance* parent ) override { return new PatchInstance( path, parent, m_patch ); } - void forEachInstance( const scene::Instantiable::Visitor& visitor ){ + void forEachInstance( const scene::Instantiable::Visitor& visitor ) override { m_instances.forEachInstance( visitor ); } - void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ){ + void insert( scene::Instantiable::Observer* observer, const scene::Path& path, scene::Instance* instance ) override { m_instances.insert( observer, path, instance ); } - scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ){ + scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Path& path ) override { return m_instances.erase( observer, path ); } }; @@ -1822,7 +1820,7 @@ class PatchSelectedVisitor : public SelectionSystem::Visitor public: PatchSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { PatchInstance* patch = Instance_getPatch( instance ); if ( patch != 0 ) { m_functor( *patch ); @@ -1843,7 +1841,7 @@ class PatchVisibleSelectedVisitor : public SelectionSystem::Visitor public: PatchVisibleSelectedVisitor( const Functor& functor ) : m_functor( functor ){ } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { PatchInstance* patch = Instance_getPatch( instance ); if ( patch != 0 && instance.path().top().get().visible() ) { @@ -1864,7 +1862,7 @@ class PatchForEachWalker : public scene::Graph::Walker public: PatchForEachWalker( const Functor& functor ) : m_functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Patch* patch = Node_getPatch( path.top() ); if ( patch != 0 ) { @@ -1890,7 +1888,7 @@ class PatchForEachSelectedWalker : public scene::Graph::Walker public: PatchForEachSelectedWalker( const Functor& functor ) : m_functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Patch* patch = Node_getPatch( path.top() ); if ( patch != 0 @@ -1917,7 +1915,7 @@ class PatchForEachInstanceWalker : public scene::Graph::Walker public: PatchForEachInstanceWalker( const Functor& functor ) : m_functor( functor ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { PatchInstance* patch = Instance_getPatch( instance ); if ( patch != 0 ) { diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 6f136348..80057061 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -31,7 +31,7 @@ #include "math/aabb.h" #include "generic/callback.h" -#include "gtkutil/menu.h" +#include "texturelib.h" #include "gtkutil/image.h" #include "map.h" #include "mainframe.h" @@ -615,7 +615,7 @@ void Patch_Thicken(){ class filter_patch_all : public PatchFilter { public: - bool filter( const Patch& patch ) const { + bool filter( const Patch& patch ) const override { return true; } }; @@ -626,7 +626,7 @@ class filter_patch_shader : public PatchFilter public: filter_patch_shader( const char* shader ) : m_shader( shader ){ } - bool filter( const Patch& patch ) const { + bool filter( const Patch& patch ) const override { return shader_equal( patch.GetShader(), m_shader ); } }; @@ -637,7 +637,7 @@ class filter_patch_flags : public PatchFilter public: filter_patch_flags( int flags ) : m_flags( flags ){ } - bool filter( const Patch& patch ) const { + bool filter( const Patch& patch ) const override { return ( patch.getShaderFlags() & m_flags ) != 0; } }; @@ -816,7 +816,6 @@ void Patch_constructMenu( QMenu* menu ){ #include "gtkutil/dialog.h" -#include "gtkutil/widget.h" #include "gtkutil/spinbox.h" #include diff --git a/radiant/patchmodule.cpp b/radiant/patchmodule.cpp index 371ec8e7..02ecee71 100644 --- a/radiant/patchmodule.cpp +++ b/radiant/patchmodule.cpp @@ -73,23 +73,23 @@ void Patch_Destroy(){ class CommonPatchCreator : public PatchCreator { public: - void Patch_undoSave( scene::Node& patch ) const { + void Patch_undoSave( scene::Node& patch ) const override { Node_getPatch( patch )->undoSave(); } - void Patch_resize( scene::Node& patch, std::size_t width, std::size_t height ) const { + void Patch_resize( scene::Node& patch, std::size_t width, std::size_t height ) const override { Node_getPatch( patch )->setDims( width, height ); } - PatchControlMatrix Patch_getControlPoints( scene::Node& node ) const { + PatchControlMatrix Patch_getControlPoints( scene::Node& node ) const override { Patch& patch = *Node_getPatch( node ); return PatchControlMatrix( patch.getHeight(), patch.getWidth(), patch.getControlPoints().data() ); } - void Patch_controlPointsChanged( scene::Node& patch ) const { + void Patch_controlPointsChanged( scene::Node& patch ) const override { return Node_getPatch( patch )->controlPointsChanged(); } - const char* Patch_getShader( scene::Node& patch ) const { + const char* Patch_getShader( scene::Node& patch ) const override { return Node_getPatch( patch )->GetShader(); } - void Patch_setShader( scene::Node& patch, const char* shader ) const { + void Patch_setShader( scene::Node& patch, const char* shader ) const override { Node_getPatch( patch )->SetShader( shader ); } }; @@ -97,7 +97,7 @@ public: class Quake3PatchCreator : public CommonPatchCreator { public: - scene::Node& createPatch(){ + scene::Node& createPatch() override { return ( new PatchNodeQuake3() )->node(); } }; @@ -111,7 +111,7 @@ PatchCreator& GetQuake3PatchCreator(){ class Doom3PatchCreator : public CommonPatchCreator { public: - scene::Node& createPatch(){ + scene::Node& createPatch() override { return ( new PatchNodeDoom3( true ) )->node(); } }; @@ -125,7 +125,7 @@ PatchCreator& GetDoom3PatchCreator(){ class Doom3PatchDef2Creator : public CommonPatchCreator { public: - scene::Node& createPatch(){ + scene::Node& createPatch() override { return ( new PatchNodeDoom3() )->node(); } }; diff --git a/radiant/plugin.cpp b/radiant/plugin.cpp index b1da75a7..fa875e94 100644 --- a/radiant/plugin.cpp +++ b/radiant/plugin.cpp @@ -31,14 +31,11 @@ #include "irender.h" #include "iscenegraph.h" #include "iselection.h" -#include "ifilter.h" #include "iscriplib.h" #include "igl.h" #include "iundo.h" -#include "itextures.h" #include "ireference.h" #include "ifiletypes.h" -#include "preferencesystem.h" #include "ibrush.h" #include "ipatch.h" #include "iimage.h" @@ -65,7 +62,6 @@ #include "mru.h" #include "surfacedialog.h" #include "groupdialog.h" -#include "patchdialog.h" #include "camwindow.h" #include "watchbsp.h" #include "xywindow.h" diff --git a/radiant/pluginapi.cpp b/radiant/pluginapi.cpp index 576b10e7..89ea22da 100644 --- a/radiant/pluginapi.cpp +++ b/radiant/pluginapi.cpp @@ -20,15 +20,8 @@ */ #include "pluginapi.h" - -#include "modulesystem.h" -#include "qerplugin.h" - -#include "generic/callback.h" -#include "math/vector.h" - +#include "math/vectorfwd.h" #include "camwindow.h" - #include "mainframe.h" diff --git a/radiant/pluginmanager.cpp b/radiant/pluginmanager.cpp index 0aeb1b87..912cb443 100644 --- a/radiant/pluginmanager.cpp +++ b/radiant/pluginmanager.cpp @@ -29,15 +29,12 @@ #include "qerplugin.h" #include "iplugin.h" -#include "math/vector.h" #include "string/string.h" #include "error.h" #include "select.h" #include "plugin.h" -#include "modulesystem.h" - #include "stream/stringstream.h" #include "commands.h" @@ -76,11 +73,11 @@ public: void Dispatch( const char *p ); // IPlugIn ------------------------------------------------------------ - const char* getMenuName(); - std::size_t getCommandCount(); - const char* getCommand( std::size_t n ); - const char* getCommandTitle( std::size_t n ); - const char* getGlobalCommand( std::size_t n ); + const char* getMenuName() override; + std::size_t getCommandCount() override; + const char* getCommand( std::size_t n ) override; + const char* getCommandTitle( std::size_t n ) override; + const char* getGlobalCommand( std::size_t n ) override; }; CPluginSlot::CPluginSlot( QWidget* main_window, const char* name, const _QERPluginTable& table ){ @@ -218,7 +215,7 @@ void FillPluginSlots( CPluginSlots& slots, QWidget* main_window ){ AddPluginVisitor( CPluginSlots& slots, QWidget* main_window ) : m_slots( slots ), m_main_window( main_window ){ } - void visit( const char* name, const _QERPluginTable& table ) const { + void visit( const char* name, const _QERPluginTable& table ) const override { m_slots.AddPluginSlot( m_main_window, name, table ); } } visitor( slots, main_window ); diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp index 8e8d00f4..83ecf6e7 100644 --- a/radiant/pluginmenu.cpp +++ b/radiant/pluginmenu.cpp @@ -25,8 +25,6 @@ #include -#include "gtkutil/menu.h" - #include "pluginmanager.h" #include "mainframe.h" #include "preferences.h" @@ -108,7 +106,7 @@ void PluginsMenu_populate(){ public: PluginsMenuConstructor( QMenu* menu ) : m_menu( menu ){ } - void visit( IPlugIn& plugin ){ + void visit( IPlugIn& plugin ) override { PlugInMenu_Add( m_menu, &plugin ); } }; diff --git a/radiant/plugintoolbar.cpp b/radiant/plugintoolbar.cpp index a0bdfbb8..806fdf99 100644 --- a/radiant/plugintoolbar.cpp +++ b/radiant/plugintoolbar.cpp @@ -27,8 +27,7 @@ #include "stream/stringstream.h" #include "os/file.h" -#include "gtkutil/image.h" -#include "gtkutil/toolbar.h" +#include #include "mainframe.h" #include "plugin.h" @@ -93,7 +92,7 @@ void PluginToolbar_populate(){ AddToolbarItemVisitor( QToolBar* toolbar ) : m_toolbar( toolbar ){ } - void visit( const char* name, const _QERPlugToolbarTable& table ) const { + void visit( const char* name, const _QERPlugToolbarTable& table ) const override { const std::size_t count = table.m_pfnToolbarButtonCount(); for ( std::size_t i = 0; i < count; ++i ) { diff --git a/radiant/points.cpp b/radiant/points.cpp index bb022ba1..92103802 100644 --- a/radiant/points.cpp +++ b/radiant/points.cpp @@ -37,10 +37,8 @@ #include "stream/stringstream.h" #include "os/path.h" #include "os/file.h" -#include "commandlib.h" #include "map.h" -#include "qe3.h" #include "camwindow.h" #include "xywindow.h" #include "xmlstuff.h" @@ -68,13 +66,13 @@ public: void PushPoint( const Vector3& v ); void GenerateDisplayList(); // SAX interface - void Release(){ + void Release() override { // blank because not heap-allocated } - void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); - void saxEndElement( message_info_t *ctx, const xmlChar *name ); - void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); - const char* getName(); + void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ) override; + void saxEndElement( message_info_t *ctx, const xmlChar *name ) override; + void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ) override; + const char* getName() override; typedef const Vector3* const_iterator; @@ -103,18 +101,18 @@ public: } } - void render( RenderStateFlags state ) const { + void render( RenderStateFlags state ) const override { gl().glCallList( m_displaylist ); } - void renderSolid( Renderer& renderer, const VolumeTest& volume ) const { + void renderSolid( Renderer& renderer, const VolumeTest& volume ) const override { if ( shown() ) { renderer.SetState( m_renderstate, Renderer::eWireframeOnly ); renderer.SetState( m_renderstate, Renderer::eFullMaterials ); renderer.addRenderable( *this, g_matrix4_identity ); } } - void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const { + void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const override { renderSolid( renderer, volume ); } diff --git a/radiant/preferencedictionary.h b/radiant/preferencedictionary.h index 26d8ae2f..3750354d 100644 --- a/radiant/preferencedictionary.h +++ b/radiant/preferencedictionary.h @@ -65,7 +65,7 @@ public: return m_preferences.find( name ); } - void registerPreference( const char* name, const StringImportCallback& importer, const StringExportCallback& exporter ){ + void registerPreference( const char* name, const StringImportCallback& importer, const StringExportCallback& exporter ) override { m_preferences.insert( PreferenceEntries::value_type( name, PreferenceEntry( importer, exporter ) ) ); PreferenceCache::iterator i = m_cache.find( name ); if ( i != m_cache.end() ) { @@ -100,16 +100,16 @@ class XMLPreferenceDictionaryExporter : public XMLExporter public: XMLQPrefElement( const char* version ) : m_version( version ){ } - const char* name() const { + const char* name() const override { return "qpref"; } - const char* attribute( const char* name ) const { + const char* attribute( const char* name ) const override { if ( string_equal( name, "version" ) ) { return m_version; } return ""; } - void forEachAttribute( XMLAttrVisitor& visitor ) const { + void forEachAttribute( XMLAttrVisitor& visitor ) const override { visitor.visit( "version", m_version ); } }; @@ -121,16 +121,16 @@ class XMLPreferenceDictionaryExporter : public XMLExporter XMLPreferenceElement( const char* name ) : m_name( name ){ } - const char* name() const { + const char* name() const override { return "epair"; } - const char* attribute( const char* name ) const { + const char* attribute( const char* name ) const override { if ( string_equal( name, "name" ) ) { return m_name; } return ""; } - void forEachAttribute( XMLAttrVisitor& visitor ) const { + void forEachAttribute( XMLAttrVisitor& visitor ) const override { visitor.visit( "name", m_name ); } }; @@ -143,7 +143,7 @@ public: : m_preferences( preferences ), m_version( version ){ } - void exportXML( XMLImporter& importer ){ + void exportXML( XMLImporter& importer ) override { importer.write( "\n", 1 ); XMLQPrefElement qpref_element( m_version ); @@ -199,7 +199,7 @@ public: : m_preferences( preferences ), m_version( version_parse( version ) ){ } - void pushElement( const XMLElement& element ){ + void pushElement( const XMLElement& element ) override { if ( m_xml_stack.empty() ) { if ( string_equal( element.name(), "qpref" ) ) { Version dataVersion( version_parse( element.attribute( "version" ) ) ); @@ -249,13 +249,13 @@ public: } } - void popElement( const char* name ){ + void popElement( const char* name ) override { if ( m_xml_stack.back().m_tag == xml_state_t::tag_epair ) { m_preferences.importPref( m_xml_stack.back().m_name.c_str(), m_xml_stack.back().m_ostream.c_str() ); } m_xml_stack.pop_back(); } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { return m_xml_stack.back().m_ostream.write( buffer, length ); } }; diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index b46f2015..bca6fbab 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -31,13 +31,11 @@ #include "debugging/debugging.h" #include "generic/callback.h" -#include "math/vector.h" #include "string/string.h" #include "stream/stringstream.h" #include "os/file.h" #include "os/path.h" #include "os/dir.h" -#include "gtkutil/filechooser.h" #include "gtkutil/messagebox.h" #include "commandlib.h" @@ -45,7 +43,6 @@ #include "console.h" #include "xywindow.h" #include "mainframe.h" -#include "qe3.h" #include "gtkdlgs.h" #include @@ -131,8 +128,6 @@ CGameDescription *g_pGameDescription; #include "stream/textfilestream.h" -#include "container/array.h" -#include "xml/ixml.h" #include "xml/xmlparser.h" #include "xml/xmlwriter.h" diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 1f5f5be3..b295796d 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -38,8 +38,6 @@ #include "ifilesystem.h" -#include - #include #include @@ -49,7 +47,6 @@ #include "os/path.h" #include "scenelib.h" -#include "gtkutil/messagebox.h" #include "error.h" #include "map.h" #include "build.h" diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 950c3c10..974a3589 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -24,8 +24,6 @@ #include "debugging/debugging.h" #include "iscenegraph.h" -#include "iselection.h" -#include "iundo.h" #include "imap.h" MapModules& ReferenceAPI_getMapModules(); #include "imodel.h" @@ -153,7 +151,7 @@ NodeSmartReference g_nullModel( g_nullNode ); class NullModelLoader : public ModelLoader { public: - scene::Node& loadModel( ArchiveFile& file ){ + scene::Node& loadModel( ArchiveFile& file ) override { return g_nullModel; } }; @@ -557,23 +555,23 @@ public: m_references.clear(); } - Resource* capture( const char* path ){ + Resource* capture( const char* path ) override { //globalOutputStream() << "capture: \"" << path << "\"\n"; return m_references.capture( CopiedString( path ) ).get(); } - void release( const char* path ){ + void release( const char* path ) override { m_references.release( CopiedString( path ) ); //globalOutputStream() << "release: \"" << path << "\"\n"; } - void setEntityCreator( EntityCreator& entityCreator ){ + void setEntityCreator( EntityCreator& entityCreator ) override { g_entityCreator = &entityCreator; } bool realised() const { return m_unrealised == 0; } - void realise(){ + void realise() override { ASSERT_MESSAGE( m_unrealised != 0, "HashtableReferenceCache::realise: already realised" ); if ( --m_unrealised == 0 ) { g_realised = true; @@ -590,7 +588,7 @@ public: } } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { g_realised = false; diff --git a/radiant/renderer.h b/radiant/renderer.h index a8f1f41d..1aeef0b4 100644 --- a/radiant/renderer.h +++ b/radiant/renderer.h @@ -79,7 +79,7 @@ public: : m_volume( volume ), m_walker( walker ){ m_state.push_back( c_volumePartial ); } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { VolumeIntersectionValue visible = ( path.top().get().visible() ) ? m_state.back() : c_volumeOutside; if ( visible == c_volumePartial ) { @@ -96,7 +96,7 @@ public: return m_walker.pre( path, instance, m_state.back() ); } } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( m_state.back() != c_volumeOutside ) { m_walker.post( path, instance, m_state.back() ); } diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index caad8864..2f609de2 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -271,7 +271,7 @@ public: m_program = 0; } - void enable(){ + void enable() override { gl().glUseProgram( m_program ); gl().glEnableVertexAttribArray( c_attr_TexCoord0 ); @@ -284,7 +284,7 @@ public: g_bumpGLSLPass_enabled = true; } - void disable(){ + void disable() override { gl().glUseProgram( 0 ); gl().glDisableVertexAttribArray( c_attr_TexCoord0 ); @@ -297,7 +297,7 @@ public: g_bumpGLSLPass_enabled = false; } - void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ){ + void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) override { Matrix4 world2local( localToWorld ); matrix4_affine_invert( world2local ); @@ -356,19 +356,19 @@ public: gl().glDeleteProgram( m_program ); m_program = 0; } - void enable(){ + void enable() override { gl().glUseProgram( m_program ); GlobalOpenGL_debugAssertNoErrors(); debug_string( "enable depthfill" ); g_depthfillPass_enabled = true; } - void disable(){ + void disable() override { gl().glUseProgram( 0 ); GlobalOpenGL_debugAssertNoErrors(); debug_string( "disable depthfill" ); g_depthfillPass_enabled = false; } - void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ){ + void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) override { } }; @@ -412,7 +412,7 @@ public: m_program = 0; } - void enable(){ + void enable() override { gl().glUseProgram( m_program ); GlobalOpenGL_debugAssertNoErrors(); @@ -420,7 +420,7 @@ public: debug_string( "enable skybox" ); } - void disable(){ + void disable() override { gl().glUseProgram( 0 ); GlobalOpenGL_debugAssertNoErrors(); @@ -428,7 +428,7 @@ public: debug_string( "disable skybox" ); } - void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ){ + void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) override { gl().glUniform3f( u_view_origin, viewer.x(), viewer.y(), viewer.z() ); GlobalOpenGL_debugAssertNoErrors(); @@ -636,7 +636,7 @@ public: } m_passes.clear(); } - void addRenderable( const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights ){ + void addRenderable( const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights ) override { for ( Passes::iterator i = m_passes.begin(); i != m_passes.end(); ++i ) { #if LIGHT_SHADER_DEBUG @@ -666,12 +666,12 @@ public: } } } - void incrementUsed(){ + void incrementUsed() override { if ( ++m_used == 1 && m_shader != 0 ) { m_shader->SetInUse( true ); } } - void decrementUsed(){ + void decrementUsed() override { if ( --m_used == 0 && m_shader != 0 ) { m_shader->SetInUse( false ); } @@ -679,13 +679,13 @@ public: bool realised() const { return m_shader != 0; } - void attach( ModuleObserver& observer ){ + void attach( ModuleObserver& observer ) override { if ( realised() ) { observer.realise(); } m_observers.attach( observer ); } - void detach( ModuleObserver& observer ){ + void detach( ModuleObserver& observer ) override { if ( realised() ) { observer.unrealise(); } @@ -715,11 +715,11 @@ public: destroy(); } - qtexture_t& getTexture() const { + qtexture_t& getTexture() const override { ASSERT_NOTNULL( m_shader ); return *m_shader->getTexture(); } - unsigned int getFlags() const { + unsigned int getFlags() const override { ASSERT_NOTNULL( m_shader ); return m_shader->getFlags(); } @@ -758,7 +758,7 @@ public: m_cullable( cullable ), m_allLights( lights ), m_evaluateChanged( evaluateChanged ){ m_lightsChanged = true; } - void evaluateLights() const { + void evaluateLights() const override { m_evaluateChanged(); if ( m_lightsChanged ) { m_lightsChanged = false; @@ -791,7 +791,7 @@ public: } #endif } - void forEachLight( const RendererLightCallback& callback ) const { + void forEachLight( const RendererLightCallback& callback ) const override { evaluateLights(); for ( Lights::const_iterator i = m_lights.begin(); i != m_lights.end(); ++i ) @@ -799,7 +799,7 @@ public: callback( *( *i ) ); } } - void lightsChanged() const { + void lightsChanged() const override { m_lightsChanged = true; } }; @@ -860,7 +860,7 @@ public: globalOutputStream() << "leaked shader: " << makeQuoted( ( *i ).key ) << '\n'; } } - Shader* capture( const char* name ){ + Shader* capture( const char* name ) override { ASSERT_MESSAGE( name[0] == '$' || *name == '[' || *name == '<' @@ -872,13 +872,13 @@ public: #endif return m_shaders.capture( name ).get(); } - void release( const char *name ){ + void release( const char *name ) override { #if DEBUG_SHADERS globalOutputStream() << "shaders release: " << makeQuoted( name ) << '\n'; #endif m_shaders.release( name ); } - void render( RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer ){ + void render( RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer ) override { gl().glMatrixMode( GL_PROJECTION ); gl().glLoadMatrixf( reinterpret_cast( &projection ) ); #if 0 @@ -987,7 +987,7 @@ public: reset.m_program = nullptr; /* disable shader */ OpenGLState_apply( reset, current, globalstate ); } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { if ( lightingEnabled() ) { g_bumpGLSL.create(); @@ -1004,7 +1004,7 @@ public: } } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { for ( Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i ) { @@ -1053,28 +1053,28 @@ public: typedef std::map LightLists; LightLists m_lightLists; - const LightList& attach( LightCullable& cullable ){ + const LightList& attach( LightCullable& cullable ) override { return ( *m_lightLists.insert( LightLists::value_type( &cullable, LinearLightList( cullable, m_lights, EvaluateChangedCaller( *this ) ) ) ).first ).second; } - void detach( LightCullable& cullable ){ + void detach( LightCullable& cullable ) override { m_lightLists.erase( &cullable ); } - void changed( LightCullable& cullable ){ + void changed( LightCullable& cullable ) override { LightLists::iterator i = m_lightLists.find( &cullable ); ASSERT_MESSAGE( i != m_lightLists.end(), "cullable not attached" ); ( *i ).second.lightsChanged(); } - void attach( RendererLight& light ){ + void attach( RendererLight& light ) override { const bool inserted = m_lights.insert( &light ).second; ASSERT_MESSAGE( inserted, "light could not be attached" ); changed( light ); } - void detach( RendererLight& light ){ + void detach( RendererLight& light ) override { const bool erased = m_lights.erase( &light ); ASSERT_MESSAGE( erased, "light could not be detached" ); changed( light ); } - void changed( RendererLight& light ){ + void changed( RendererLight& light ) override { m_lightsChanged = true; } void evaluateChanged(){ @@ -1093,17 +1093,17 @@ public: mutable bool m_traverseRenderablesMutex; // renderables - void attachRenderable( const Renderable& renderable ){ + void attachRenderable( const Renderable& renderable ) override { ASSERT_MESSAGE( !m_traverseRenderablesMutex, "attaching renderable during traversal" ); const bool inserted = m_renderables.insert( &renderable ).second; ASSERT_MESSAGE( inserted, "renderable could not be attached" ); } - void detachRenderable( const Renderable& renderable ){ + void detachRenderable( const Renderable& renderable ) override { ASSERT_MESSAGE( !m_traverseRenderablesMutex, "detaching renderable during traversal" ); const bool erased = m_renderables.erase( &renderable ); ASSERT_MESSAGE( erased, "renderable could not be detached" ); } - void forEachRenderable( const RenderableCallback& callback ) const { + void forEachRenderable( const RenderableCallback& callback ) const override { ASSERT_MESSAGE( !m_traverseRenderablesMutex, "for-each during traversal" ); m_traverseRenderablesMutex = true; for ( Renderables::const_iterator i = m_renderables.begin(); i != m_renderables.end(); ++i ) @@ -1669,15 +1669,15 @@ public: return m_states.end(); } - void getDefaultState( OpenGLState& state ) const { + void getDefaultState( OpenGLState& state ) const override { OpenGLState_constructDefault( state ); } - void insert( const char* name, const OpenGLState& state ){ + void insert( const char* name, const OpenGLState& state ) override { bool inserted = m_states.insert( States::value_type( name, state ) ).second; ASSERT_MESSAGE( inserted, "OpenGLStateMap::insert: " << name << " already exists" ); } - void erase( const char* name ){ + void erase( const char* name ) override { std::size_t count = m_states.erase( name ); ASSERT_MESSAGE( count == 1, "OpenGLStateMap::erase: " << name << " does not exist" ); } diff --git a/radiant/scenegraph.cpp b/radiant/scenegraph.cpp index f3c148e3..f7122e12 100644 --- a/radiant/scenegraph.cpp +++ b/radiant/scenegraph.cpp @@ -24,8 +24,6 @@ #include "debugging/debugging.h" #include -#include -#include #include "string/string.h" #include "signal/signal.h" @@ -76,18 +74,18 @@ public: : m_observer( observer ){ } - void addSceneChangedCallback( const SignalHandler& handler ){ + void addSceneChangedCallback( const SignalHandler& handler ) override { m_sceneChangedCallbacks.connectLast( handler ); } - void sceneChanged(){ + void sceneChanged() override { m_sceneChangedCallbacks(); } - scene::Node& root(){ + scene::Node& root() override { ASSERT_MESSAGE( !m_rootpath.empty(), "scenegraph root does not exist" ); return m_rootpath.top(); } - void insert_root( scene::Node& root ){ + void insert_root( scene::Node& root ) override { //globalOutputStream() << "insert_root\n"; ASSERT_MESSAGE( m_rootpath.empty(), "scenegraph root already exists" ); @@ -100,7 +98,7 @@ public: m_currentLayer = &Node_getLayers( root )->m_currentLayer; } - void erase_root(){ + void erase_root() override { //globalOutputStream() << "erase_root\n"; ASSERT_MESSAGE( !m_rootpath.empty(), "scenegraph root does not exist" ); @@ -115,24 +113,24 @@ public: m_currentLayer = &m_currentLayer0; } - Layer* currentLayer(){ + Layer* currentLayer() override { return *m_currentLayer; } - void boundsChanged(){ + void boundsChanged() override { m_boundsChanged(); } - void traverse( const Walker& walker ){ + void traverse( const Walker& walker ) override { traverse_subgraph( walker, m_instances.begin() ); } - void traverse_subgraph( const Walker& walker, const scene::Path& start ){ + void traverse_subgraph( const Walker& walker, const scene::Path& start ) override { if ( !m_instances.empty() ) { traverse_subgraph( walker, m_instances.find( PathConstReference( start ) ) ); } } - scene::Instance* find( const scene::Path& path ){ + scene::Instance* find( const scene::Path& path ) override { InstanceMap::iterator i = m_instances.find( PathConstReference( path ) ); if ( i == m_instances.end() ) { return 0; @@ -140,29 +138,29 @@ public: return ( *i ).second; } - void insert( scene::Instance* instance ){ + void insert( scene::Instance* instance ) override { m_instances.insert( InstanceMap::value_type( PathConstReference( instance->path() ), instance ) ); m_observer->insert( instance ); } - void erase( scene::Instance* instance ){ + void erase( scene::Instance* instance ) override { m_observer->erase( instance ); m_instances.erase( PathConstReference( instance->path() ) ); } - SignalHandlerId addBoundsChangedCallback( const SignalHandler& boundsChanged ){ + SignalHandlerId addBoundsChangedCallback( const SignalHandler& boundsChanged ) override { return m_boundsChanged.connectLast( boundsChanged ); } - void removeBoundsChangedCallback( SignalHandlerId id ){ + void removeBoundsChangedCallback( SignalHandlerId id ) override { m_boundsChanged.disconnect( id ); } - TypeId getNodeTypeId( const char* name ){ + TypeId getNodeTypeId( const char* name ) override { return m_nodeTypeIds.getTypeId( name ); } - TypeId getInstanceTypeId( const char* name ){ + TypeId getInstanceTypeId( const char* name ) override { return m_instanceTypeIds.getTypeId( name ); } @@ -220,11 +218,11 @@ GraphTreeModel* scene_graph_get_tree_model(){ class SceneGraphObserver : public scene::Instantiable::Observer { public: - void insert( scene::Instance* instance ){ + void insert( scene::Instance* instance ) override { g_sceneGraph->sceneChanged(); graph_tree_model_insert( g_tree_model, *instance ); } - void erase( scene::Instance* instance ){ + void erase( scene::Instance* instance ) override { g_sceneGraph->sceneChanged(); graph_tree_model_erase( g_tree_model, *instance ); } diff --git a/radiant/select.cpp b/radiant/select.cpp index 27ae2146..d74ea06e 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -31,7 +31,6 @@ #include "stream/stringstream.h" #include "signal/isignal.h" -#include "signal/isignal.h" #include "shaderlib.h" #include "scenelib.h" @@ -51,7 +50,6 @@ #include "tools.h" #include "grid.h" #include "map.h" -#include "entityinspector.h" #include "csg.h" @@ -77,7 +75,7 @@ public: m_count = 0; } - void visit( scene::Instance& instance ) const { + void visit( scene::Instance& instance ) const override { ASSERT_MESSAGE( m_count <= m_max, "Invalid m_count in CollectSelectedBrushesBounds" ); // stop if the array is already full @@ -112,7 +110,7 @@ public: m_count( count ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( path.top().get().visible() ){ Selectable* selectable = Instance_getSelectable( instance ); @@ -223,7 +221,7 @@ public: DeleteSelected() : m_remove( false ), m_removedChild( false ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { m_removedChild = false; if ( Instance_isSelected( instance ) @@ -235,7 +233,7 @@ public: } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( m_removedChild ) { m_removedChild = false; @@ -278,7 +276,7 @@ public: InvertSelectionWalker( SelectionSystem::EMode mode, SelectionSystem::EComponentMode compmode ) : m_mode( mode ), m_compmode( compmode ), m_selectable( 0 ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( !path.top().get().visible() ){ m_selectable = 0; return false; @@ -313,7 +311,7 @@ public: } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( m_selectable != 0 ) { m_selectable->setSelected( !m_selectable->isSelected() ); m_selectable = 0; @@ -385,7 +383,7 @@ class ExpandSelectionToPrimitivesWalker : public scene::Graph::Walker mutable std::size_t m_depth = 0; const scene::Node* m_world = Map_FindWorldspawn( g_map ); public: - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { ++m_depth; if( !path.top().get().visible() ) @@ -410,7 +408,7 @@ public: } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -424,7 +422,7 @@ class ExpandSelectionToEntitiesWalker : public scene::Graph::Walker mutable std::size_t m_depth = 0; const scene::Node* m_world = Map_FindWorldspawn( g_map ); public: - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { ++m_depth; if( !path.top().get().visible() ) @@ -450,7 +448,7 @@ public: } return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { --m_depth; } }; @@ -728,7 +726,7 @@ class EntityFindByPropertyValueWalker : public scene::Graph::Walker public: EntityFindByPropertyValueWalker( const EntityMatcher& entityMatcher ) : m_entityMatcher( entityMatcher ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if( !path.top().get().visible() ){ return false; } @@ -774,7 +772,7 @@ public: EntityGetSelectedPropertyValuesWalker( const char *prop, PropertyValues& propertyvalues ) : m_propertyvalues( propertyvalues ), m_prop( prop ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( Entity* entity = Node_getEntity( path.top() ) ){ if( path.top().get_pointer() != m_world ){ if ( Instance_isSelected( instance ) || instance.childSelected() ) { @@ -881,7 +879,7 @@ void Select_EntitiesByKeyValue( const char* key, const char* value ){ bool m_found = false; Visitor( const char* value ) : m_value( value ){ } - void visit( const char* key, const char* value ){ + void visit( const char* key, const char* value ) override { if ( string_equal_nocase( m_value, value ) ) { m_found = true; } @@ -1001,7 +999,7 @@ public: HideAllWalker( bool hide ) : m_hide( hide ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { hide_node( path.top(), m_hide ); return true; } @@ -1240,7 +1238,7 @@ public: mutable std::vector m_cloned; CloneSelected( bool makeUnique ) : m_makeUnique( makeUnique ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.size() == 1 ) { return true; } @@ -1260,7 +1258,7 @@ public: return true; } - void post( const scene::Path& path, scene::Instance& instance ) const { + void post( const scene::Path& path, scene::Instance& instance ) const override { if ( path.size() == 1 ) { return; } @@ -1523,7 +1521,7 @@ public: SnappableSnapToGridSelected( float snap ) : m_snap( snap ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { Snappable* snappable = Node_getSnappable( path.top() ); if ( snappable != 0 @@ -1546,7 +1544,7 @@ public: ComponentSnappableSnapToGridSelected( float snap ) : m_snap( snap ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( path.top().get().visible() ) { ComponentSnappable* componentSnappable = Instance_getComponentSnappable( instance ); if ( componentSnappable != 0 @@ -1776,7 +1774,7 @@ public: EntityGetSelectedPropertyValuesWalker_nonEmpty( const char *prop, PropertyValues& propertyvalues ) : m_propertyvalues( propertyvalues ), m_prop( prop ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { Entity* entity = Node_getEntity( path.top() ); if ( entity != 0 ){ if( path.top().get_pointer() != m_world ){ diff --git a/radiant/select.h b/radiant/select.h index a6e66d7a..a3ffd20f 100644 --- a/radiant/select.h +++ b/radiant/select.h @@ -21,7 +21,7 @@ #pragma once -#include "math/vector.h" +#include "generic/vector.h" void Select_GetBounds( Vector3& mins, Vector3& maxs ); diff --git a/radiant/selection.cpp b/radiant/selection.cpp index f9ee8338..afb0abb9 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -37,7 +37,6 @@ #include "math/frustum.h" #include "signal/signal.h" -#include "generic/object.h" #include "selectionlib.h" #include "render.h" #include "view.h" diff --git a/radiant/server.cpp b/radiant/server.cpp index 16080abe..a7601d76 100644 --- a/radiant/server.cpp +++ b/radiant/server.cpp @@ -41,27 +41,27 @@ public: RadiantModuleServer() : m_error( false ){ } - void setError( bool error ){ + void setError( bool error ) override { m_error = error; } - bool getError() const { + bool getError() const override { return m_error; } - TextOutputStream& getOutputStream(){ + TextOutputStream& getOutputStream() override { return globalOutputStream(); } - TextOutputStream& getWarningStream(){ + TextOutputStream& getWarningStream() override { return globalWarningStream(); } - TextOutputStream& getErrorStream(){ + TextOutputStream& getErrorStream() override { return globalErrorStream(); } - DebugMessageHandler& getDebugMessageHandler(){ + DebugMessageHandler& getDebugMessageHandler() override { return globalDebugMessageHandler(); } - void registerModule( const char* type, int version, const char* name, Module& module ){ + void registerModule( const char* type, int version, const char* name, Module& module ) override { ASSERT_NOTNULL( (volatile intptr_t)&module ); if ( !m_modules.insert( Modules_::value_type( ModuleKey( ModuleType( type, version ), name ), &module ) ).second ) { globalErrorStream() << "module already registered: type=" << makeQuoted( type ) << " name=" << makeQuoted( name ) << '\n'; @@ -72,7 +72,7 @@ public: } } - Module* findModule( const char* type, int version, const char* name ) const { + Module* findModule( const char* type, int version, const char* name ) const override { Modules_::const_iterator i = m_modules.find( ModuleKey( ModuleType( type, version ), name ) ); if ( i != m_modules.end() ) { return ( *i ).second; @@ -80,7 +80,7 @@ public: return 0; } - void foreachModule( const char* type, int version, const Visitor& visitor ){ + void foreachModule( const char* type, int version, const Visitor& visitor ) override { for ( Modules_::const_iterator i = m_modules.begin(); i != m_modules.end(); ++i ) { if ( string_equal( ( *i ).first.first.first.c_str(), type ) ) { diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 51871a59..12b1c342 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -45,7 +45,6 @@ #include #include "signal/isignal.h" -#include "generic/object.h" #include "math/vector.h" #include "texturelib.h" #include "shaderlib.h" @@ -56,7 +55,6 @@ #include "gtkutil/dialog.h" #include "gtkutil/entry.h" #include "gtkutil/nonmodal.h" -#include "gtkutil/glwidget.h" //Shamus: For Textool #include "gtkutil/guisettings.h" #include "gtkutil/spinbox.h" #include "map.h" @@ -68,9 +66,8 @@ #include "brush_primit.h" #include "xywindow.h" #include "mainframe.h" -#include "gtkdlgs.h" #include "dialog.h" -#include "brush.h" //Shamus: for Textool +#include "brush.h" #include "patch.h" #include "commands.h" #include "stream/stringstream.h" @@ -1574,11 +1571,11 @@ public: OccludeSelector( SelectionIntersection& bestIntersection, bool& occluded ) : m_bestIntersection( bestIntersection ), m_occluded( occluded ){ m_occluded = false; } - void pushSelectable( Selectable& selectable ){ + void pushSelectable( Selectable& selectable ) override { } - void popSelectable(){ + void popSelectable() override { } - void addIntersection( const SelectionIntersection& intersection ){ + void addIntersection( const SelectionIntersection& intersection ) override { if ( SelectionIntersection_closer( intersection, m_bestIntersection ) ) { m_bestIntersection = intersection; m_occluded = true; @@ -1594,7 +1591,7 @@ class BrushGetClosestFaceVisibleWalker : public scene::Graph::Walker public: BrushGetClosestFaceVisibleWalker( SelectionTest& test, Texturable& texturable ) : m_test( test ), m_texturable( texturable ){ } - bool pre( const scene::Path& path, scene::Instance& instance ) const { + bool pre( const scene::Path& path, scene::Instance& instance ) const override { if ( !path.top().get().visible() ) return false; BrushInstance* brush = Instance_getBrush( instance ); diff --git a/radiant/textures.cpp b/radiant/textures.cpp index e852959a..2649c0d4 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -466,32 +466,32 @@ public: return m_qtextures.end(); } - LoadImageCallback defaultLoader() const { + LoadImageCallback defaultLoader() const override { return LoadImageCallback( 0, QERApp_LoadImage ); } - Image* loadImage( const char* name ){ + Image* loadImage( const char* name ) override { return defaultLoader().loadImage( name ); } - qtexture_t* capture( const char* name ){ + qtexture_t* capture( const char* name ) override { return capture( defaultLoader(), name ); } - qtexture_t* capture( const LoadImageCallback& loader, const char* name ){ + qtexture_t* capture( const LoadImageCallback& loader, const char* name ) override { #if DEBUG_TEXTURES globalOutputStream() << "textures capture: " << makeQuoted( name ) << '\n'; #endif return m_qtextures.capture( TextureKey( loader, name ) ).get(); } - void release( qtexture_t* texture ){ + void release( qtexture_t* texture ) override { #if DEBUG_TEXTURES globalOutputStream() << "textures release: " << makeQuoted( texture->name ) << '\n'; #endif m_qtextures.release( TextureKey( texture->load, texture->name ) ); } - void attach( TexturesCacheObserver& observer ){ + void attach( TexturesCacheObserver& observer ) override { ASSERT_MESSAGE( m_observer == 0, "TexturesMap::attach: cannot attach observer" ); m_observer = &observer; } - void detach( TexturesCacheObserver& observer ){ + void detach( TexturesCacheObserver& observer ) override { ASSERT_MESSAGE( m_observer == &observer, "TexturesMap::detach: cannot detach observer" ); m_observer = 0; } diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 85dba4b5..0c7c8d29 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -30,7 +30,6 @@ #include "debugging/debugging.h" #include "ifilesystem.h" -#include "iundo.h" #include "igl.h" #include "iarchive.h" #include "moduleobserver.h" @@ -63,15 +62,9 @@ #include "shaderlib.h" #include "os/file.h" #include "os/path.h" -#include "stream/memstream.h" -#include "stream/textfilestream.h" #include "stream/stringstream.h" -#include "commandlib.h" -#include "texmanip.h" #include "textures.h" -#include "gtkutil/menu.h" -#include "gtkutil/nonmodal.h" #include "gtkutil/cursor.h" #include "gtkutil/widget.h" #include "gtkutil/glwidget.h" @@ -82,20 +75,13 @@ #include "gtkutil/guisettings.h" #include "error.h" -#include "map.h" #include "qgl.h" #include "select.h" -#include "brush_primit.h" -#include "brushmanip.h" -#include "patchmanip.h" #include "plugin.h" -#include "qe3.h" #include "gtkdlgs.h" #include "gtkmisc.h" #include "mainframe.h" #include "findtexturedialog.h" -#include "surfacedialog.h" -#include "patchdialog.h" #include "groupdialog.h" #include "preferences.h" #include "commands.h" @@ -549,10 +535,10 @@ class ShadersObserver : public ModuleObserver { Signal0 m_realiseCallbacks; public: - void realise(){ + void realise() override { m_realiseCallbacks(); } - void unrealise(){ + void unrealise() override { } void insert( const SignalHandler& handler ){ m_realiseCallbacks.connectLast( handler ); @@ -624,7 +610,7 @@ inline bool texture_name_ignore( const char* name ){ class LoadShaderVisitor : public Archive::Visitor { public: - void visit( const char* name ){ + void visit( const char* name ) override { IShader* shader = QERApp_Shader_ForName( CopiedString( PathExtensionless( name ) ).c_str() ); shader->DecRef(); } @@ -710,7 +696,7 @@ public: LoadTexturesByTypeVisitor( const char* dirstring ) : m_dirstring( dirstring ){ } - void visit( const char* minor, const _QERPlugImageTable& table ) const { + void visit( const char* minor, const _QERPlugImageTable& table ) const override { GlobalFileSystem().forEachFile( m_dirstring, minor, TextureDirectoryLoadTextureCaller( m_dirstring ) ); } }; diff --git a/radiant/treemodel.cpp b/radiant/treemodel.cpp index 9f649b21..325eac13 100644 --- a/radiant/treemodel.cpp +++ b/radiant/treemodel.cpp @@ -23,8 +23,6 @@ #include "debugging/debugging.h" -#include - #include #include #include diff --git a/radiant/undo.cpp b/radiant/undo.cpp index 9b9ca9c8..dc274a7d 100644 --- a/radiant/undo.cpp +++ b/radiant/undo.cpp @@ -207,7 +207,7 @@ class RadiantUndoSystem : public UndoSystem UndoStackFiller() : m_stack( 0 ){ } - void save( Undoable* undoable ){ + void save( Undoable* undoable ) override { ASSERT_NOTNULL( undoable ); if ( m_stack != 0 ) { @@ -241,12 +241,12 @@ public: ~RadiantUndoSystem(){ clear(); } - UndoObserver* observer( Undoable* undoable ){ + UndoObserver* observer( Undoable* undoable ) override { ASSERT_NOTNULL( undoable ); return &m_undoables[undoable]; } - void release( Undoable* undoable ){ + void release( Undoable* undoable ) override { ASSERT_NOTNULL( undoable ); m_undoables.erase( undoable ); @@ -265,7 +265,7 @@ public: std::size_t getLevels() const { return m_undo_levels; } - std::size_t size() const { + std::size_t size() const override { return m_undo_stack.size(); } void startUndo(){ @@ -286,7 +286,7 @@ public: mark_undoables( 0 ); return changed; } - void start(){ + void start() override { m_redo_stack.clear(); if ( m_undo_stack.size() == m_undo_levels ) { m_undo_stack.pop_front(); @@ -294,12 +294,12 @@ public: startUndo(); trackersBegin(); } - void finish( const char* command ){ + void finish( const char* command ) override { if ( finishUndo( command ) ) { globalOutputStream() << command << '\n'; } } - void undo(){ + void undo() override { if ( m_undo_stack.empty() ) { globalOutputStream() << "Undo: no undo available\n"; } @@ -315,7 +315,7 @@ public: m_undo_stack.pop_back(); } } - void redo(){ + void redo() override { if ( m_redo_stack.empty() ) { globalOutputStream() << "Redo: no redo available\n"; } @@ -331,17 +331,17 @@ public: m_redo_stack.pop_back(); } } - void clear(){ + void clear() override { mark_undoables( 0 ); m_undo_stack.clear(); m_redo_stack.clear(); trackersClear(); } - void trackerAttach( UndoTracker& tracker ){ + void trackerAttach( UndoTracker& tracker ) override { const bool inserted = m_trackers.insert( &tracker ).second; ASSERT_MESSAGE( inserted, "undo tracker already attached" ); } - void trackerDetach( UndoTracker& tracker ){ + void trackerDetach( UndoTracker& tracker ) override { const bool erased = m_trackers.erase( &tracker ); ASSERT_MESSAGE( erased, "undo tracker cannot be detached" ); } diff --git a/radiant/view.h b/radiant/view.h index da5a112f..486dd551 100644 --- a/radiant/view.h +++ b/radiant/view.h @@ -146,49 +146,49 @@ public: construct(); } - bool TestPoint( const Vector3& point ) const { + bool TestPoint( const Vector3& point ) const override { return viewproj_test_point( m_viewproj, point ); } - bool TestLine( const Segment& segment ) const { + bool TestLine( const Segment& segment ) const override { return frustum_test_line( m_frustum, segment ); } - bool TestPlane( const Plane3& plane ) const { + bool TestPlane( const Plane3& plane ) const override { debug_count_plane(); return viewer_test_plane( m_viewer, plane ); } - bool TestPlane( const Plane3& plane, const Matrix4& localToWorld ) const { + bool TestPlane( const Plane3& plane, const Matrix4& localToWorld ) const override { debug_count_oriented_plane(); return viewer_test_transformed_plane( m_viewer, plane, localToWorld ); } - VolumeIntersectionValue TestAABB( const AABB& aabb ) const { + VolumeIntersectionValue TestAABB( const AABB& aabb ) const override { debug_count_bbox(); return frustum_test_aabb( m_frustum, aabb ); } - VolumeIntersectionValue TestAABB( const AABB& aabb, const Matrix4& localToWorld ) const { + VolumeIntersectionValue TestAABB( const AABB& aabb, const Matrix4& localToWorld ) const override { debug_count_oriented_bbox(); return frustum_intersects_transformed_aabb( m_frustum, aabb, localToWorld ); } - const Matrix4& GetViewMatrix() const { + const Matrix4& GetViewMatrix() const override { return m_viewproj; } - const Matrix4& GetViewport() const { + const Matrix4& GetViewport() const override { return m_viewport; } - const Matrix4& GetModelview() const { + const Matrix4& GetModelview() const override { return m_modelview; } - const Matrix4& GetProjection() const { + const Matrix4& GetProjection() const override { return m_projection; } - bool fill() const { + bool fill() const override { return m_fill; } - const Vector3& getViewer() const { + const Vector3& getViewer() const override { return m_viewer.vec3(); } - const Vector3& getViewDir() const { + const Vector3& getViewDir() const override { return m_viewdir; } const Frustum& getFrustum() const { diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index 85029455..f09f7c5a 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -35,7 +35,6 @@ #include "watchbsp.h" -#include #include #include "commandlib.h" @@ -51,7 +50,6 @@ #include "mainframe.h" #include "sockets.h" #include "timer.h" -#include "xmlstuff.h" class CWatchBSP { @@ -427,7 +425,7 @@ class MessageOutputStream : public TextOutputStream public: MessageOutputStream( message_info_t* data ) : m_data( data ){ } - std::size_t write( const char* buffer, std::size_t length ){ + std::size_t write( const char* buffer, std::size_t length ) override { if ( m_data->pGeometry != 0 ) { m_data->pGeometry->saxCharacters( m_data, reinterpret_cast( buffer ), int( length ) ); } diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 2afcd6cf..4e00ce27 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -31,7 +31,6 @@ #include "ientity.h" #include "igl.h" -#include "ibrush.h" #include "iundo.h" #include "iimage.h" #include "ifilesystem.h" @@ -47,15 +46,14 @@ #include "string/string.h" #include "stream/stringstream.h" -#include "scenelib.h" #include "eclasslib.h" #include "renderer.h" #include "moduleobserver.h" -#include "gtkutil/menu.h" #include "gtkutil/widget.h" #include "gtkutil/glwidget.h" #include "gtkutil/filechooser.h" +#include "gtkutil/cursor.h" #include "gtkutil/fbo.h" #include "gtkmisc.h" #include "select.h" @@ -831,7 +829,7 @@ public: addItem( m_previous.c_str(), "" ); } } - void visit( EntityClass* e ){ + void visit( EntityClass* e ) override { ASSERT_MESSAGE( !string_empty( e->name() ), "entity-class has no name" ); if ( !m_previous.empty() ) { addItem( m_previous.c_str(), e->name() ); @@ -1676,28 +1674,28 @@ public: m_state_stack.push_back( state_type() ); } - void SetState( Shader* state, EStyle style ){ + void SetState( Shader* state, EStyle style ) override { ASSERT_NOTNULL( state ); if ( style == eWireframeOnly ) { m_state_stack.back().m_state = state; } } - EStyle getStyle() const { + EStyle getStyle() const override { return eWireframeOnly; } - void PushState(){ + void PushState() override { m_state_stack.push_back( m_state_stack.back() ); } - void PopState(){ + void PopState() override { ASSERT_MESSAGE( !m_state_stack.empty(), "popping empty stack" ); m_state_stack.pop_back(); } - void Highlight( EHighlightMode mode, bool bEnable = true ){ + void Highlight( EHighlightMode mode, bool bEnable = true ) override { ( bEnable ) ? m_state_stack.back().m_highlight |= mode : m_state_stack.back().m_highlight &= ~mode; } - void addRenderable( const OpenGLRenderable& renderable, const Matrix4& localToWorld ){ + void addRenderable( const OpenGLRenderable& renderable, const Matrix4& localToWorld ) override { if ( m_state_stack.back().m_highlight & ePrimitive ) { m_state_selected->addRenderable( renderable, localToWorld ); } @@ -2042,11 +2040,11 @@ class EntityClassMenu : public ModuleObserver public: EntityClassMenu() : m_unrealised( 1 ){ } - void realise(){ + void realise() override { if ( --m_unrealised == 0 ) { } } - void unrealise(){ + void unrealise() override { if ( ++m_unrealised == 1 ) { delete std::exchange( XYWnd::m_mnuDrop, nullptr ); } diff --git a/radiant/xywindow.h b/radiant/xywindow.h index 905f29d4..5800775f 100644 --- a/radiant/xywindow.h +++ b/radiant/xywindow.h @@ -24,7 +24,6 @@ #include "math/matrix.h" #include "signal/signal.h" -#include "gtkutil/cursor.h" #include "gtkutil/xorrectangle.h" #include "view.h" #include "map.h"