From 7d4146603df0e8e442ff2eee7a3500c38591d2f6 Mon Sep 17 00:00:00 2001 From: codereader Date: Fri, 7 Jan 2022 07:24:23 +0100 Subject: [PATCH] #5584: Remove old patch control point renderable code --- radiantcore/patch/PatchNode.cpp | 31 ------------------------------- radiantcore/patch/PatchNode.h | 9 --------- 2 files changed, 40 deletions(-) diff --git a/radiantcore/patch/PatchNode.cpp b/radiantcore/patch/PatchNode.cpp index 5a935b539f..204db01d1e 100644 --- a/radiantcore/patch/PatchNode.cpp +++ b/radiantcore/patch/PatchNode.cpp @@ -11,10 +11,8 @@ PatchNode::PatchNode(patch::PatchDefType type) : scene::SelectableNode(), m_dragPlanes(std::bind(&PatchNode::selectedChangedComponent, this, std::placeholders::_1)), - m_render_selected(GL_POINTS), m_patch(*this), _untransformedOriginChanged(true), - _selectedControlVerticesNeedUpdate(true), _renderableSurfaceSolid(m_patch.getTesselation(), true), _renderableSurfaceWireframe(m_patch.getTesselation(), false), _renderableCtrlLattice(m_patch, m_ctrl_instances), @@ -36,10 +34,8 @@ PatchNode::PatchNode(const PatchNode& other) : PlaneSelectable(other), Transformable(other), m_dragPlanes(std::bind(&PatchNode::selectedChangedComponent, this, std::placeholders::_1)), - m_render_selected(GL_POINTS), m_patch(other.m_patch, *this), // create the patch out of the one _untransformedOriginChanged(true), - _selectedControlVerticesNeedUpdate(true), _renderableSurfaceSolid(m_patch.getTesselation(), true), _renderableSurfaceWireframe(m_patch.getTesselation(), false), _renderableCtrlLattice(m_patch, m_ctrl_instances), @@ -268,7 +264,6 @@ bool PatchNode::hasVisibleMaterial() const void PatchNode::selectedChangedComponent(const ISelectable& selectable) { // We need to update our vertex colours next time we render them - _selectedControlVerticesNeedUpdate = true; _renderableCtrlPoints.queueUpdate(); // Notify the selection system that this PatchNode was selected. The RadiantSelectionSystem adds @@ -349,8 +344,6 @@ void PatchNode::onPreRender(const VolumeTest& volume) if (isSelected() && GlobalSelectionSystem().ComponentMode() == selection::ComponentSelectionMode::Vertex) { - updateSelectedControlVertices(); - // Selected patches in component mode render the lattice connecting the control points _renderableCtrlLattice.update(_ctrlLatticeShader); _renderableCtrlPoints.update(_ctrlPointShader); @@ -458,29 +451,6 @@ void PatchNode::renderComponents(IRenderableCollector& collector, const VolumeTe #endif } -void PatchNode::updateSelectedControlVertices() const -{ - if (!_selectedControlVerticesNeedUpdate) return; - - _selectedControlVerticesNeedUpdate = false; - - // Clear the renderable point vector that represents the selection - m_render_selected.clear(); - - // Cycle through the transformed patch vertices and set the colour of all selected control vertices to BLUE (hardcoded) - auto ctrl = m_patch.getControlPointsTransformed().begin(); - - for (auto i = m_ctrl_instances.begin(); i != m_ctrl_instances.end(); ++i, ++ctrl) - { - if (i->isSelected()) - { - const Colour4b colour_selected(0, 0, 0, 255); - // Add this patch control instance to the render list - m_render_selected.push_back(VertexCb(reinterpret_cast(ctrl->vertex), colour_selected)); - } - } -} - #if 0 void PatchNode::renderComponentsSelected(IRenderableCollector& collector, const VolumeTest& volume) const { @@ -543,7 +513,6 @@ void PatchNode::transformComponents(const Matrix4& matrix) { // mark this patch transform as dirty m_patch.transformChanged(); - _selectedControlVerticesNeedUpdate = true; } // Also, check if there are any drag planes selected diff --git a/radiantcore/patch/PatchNode.h b/radiantcore/patch/PatchNode.h index 6820679797..f19e854119 100644 --- a/radiantcore/patch/PatchNode.h +++ b/radiantcore/patch/PatchNode.h @@ -32,9 +32,6 @@ class PatchNode final : typedef std::vector PatchControlInstances; PatchControlInstances m_ctrl_instances; - // An array of renderable points - mutable RenderablePointVector m_render_selected; - Patch m_patch; // An internal AABB variable to calculate the bounding box of the selected components (has to be mutable) @@ -48,8 +45,6 @@ class PatchNode final : // If true, the _untransformedOrigin member needs an update bool _untransformedOriginChanged; - mutable bool _selectedControlVerticesNeedUpdate; - RenderablePatchTesselation _renderableSurfaceSolid; RenderablePatchTesselation _renderableSurfaceWireframe; RenderablePatchLattice _renderableCtrlLattice; // Wireframe connecting the control points @@ -164,10 +159,6 @@ class PatchNode final : // Transforms the patch components with the given transformation matrix void transformComponents(const Matrix4& matrix); - // greebo: Updates the internal render array m_render_selected, that contains all control vertices that should be - // rendered as highlighted. - void updateSelectedControlVertices() const; - #if 0 // greebo: Renders the selected components. This is called by the above two render functions void renderComponentsSelected(IRenderableCollector& collector, const VolumeTest& volume) const;