Skip to content

Commit

Permalink
#5893: Remove the regular IRenderableCollector::addRenderable method,…
Browse files Browse the repository at this point in the history
… since nothing was using it anymore.

Except for the MeasurementTool which is broken by this commit.
  • Loading branch information
codereader committed Feb 13, 2022
1 parent 28d7959 commit 34cd699
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 70 deletions.
39 changes: 0 additions & 39 deletions include/irenderable.h
Expand Up @@ -36,45 +36,6 @@ class IRenderableCollector
// Process the given renderable object
virtual void processRenderable(Renderable& renderable, const VolumeTest& volume) = 0;

/**
* \brief Submit a renderable object.
*
* This method allows renderable geometry to be submitted under the control
* of a LitObject which will determine whether and how the renderable is
* illuminated by scene lights. Each objected submitted with this method
* will be considered for lighting by the lights which are submitted to the
* same RenderableCollector using addLight().
*
* Objects may be submitted without a LitObject if they are not affected by
* scene lights.
*
* \param shader
* The Shader object this Renderable will be attached to.
*
* \param renderable
* The renderable object to submit.
*
* \param localToWorld
* The local to world transform that should be applied to this object when
* it is rendered.
*
* \param entity
* Optional IRenderEntity exposing parameters which affect the rendering of
* this Renderable.
*
* \param litObject
* Optional LitObject determining lighting interactions for this
* renderable. This may or may not be the same actual object as the
* OpenGLRenderable, depending on how the object class hierarchy is set up.
* If a single LitObject contains multiple renderables, a separate call to
* this method must be made for each renderable (with the same litObject
* parameter).
*/
virtual void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const IRenderEntity* entity = nullptr) = 0;

/**
* Submits a renderable object that is used for highlighting an object.
* Depending on the view, this might be a coloured, transparent overlay
Expand Down
8 changes: 0 additions & 8 deletions libs/render/CamRenderer.h
Expand Up @@ -52,14 +52,6 @@ class CamRenderer :

bool supportsFullMaterials() const override { return true; }

void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const IRenderEntity* entity = nullptr) override
{
addHighlightRenderable(renderable, localToWorld);
}

void addHighlightRenderable(const OpenGLRenderable& renderable, const Matrix4& localToWorld) override
{
if (_editMode == IMap::EditMode::Merge && (_flags & Highlight::Flags::MergeAction) != 0)
Expand Down
10 changes: 0 additions & 10 deletions radiant/xyview/XYRenderer.h
Expand Up @@ -38,16 +38,6 @@ class XYRenderer :
return false;
}

void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const IRenderEntity* entity = nullptr) override
{
addHighlightRenderable(renderable, localToWorld);

shader.addRenderable(renderable, localToWorld, entity);
}

void addHighlightRenderable(const OpenGLRenderable& renderable, const Matrix4& localToWorld) override
{
if (_editMode == IMap::EditMode::Merge)
Expand Down
2 changes: 2 additions & 0 deletions radiant/xyview/tools/MeasurementTool.cpp
Expand Up @@ -166,11 +166,13 @@ void MeasurementTool::render(RenderSystem& renderSystem, IRenderableCollector& c
{
ensureShaders(renderSystem);

#if 0
// Render lines
collector.addRenderable(*_wireShader, _lines, Matrix4::getIdentity());

// Render points
collector.addRenderable(*_pointShader, _points, Matrix4::getIdentity());
#endif

// Render distance string
for (std::size_t i = 1; i < _points.size(); ++i)
Expand Down
13 changes: 0 additions & 13 deletions test/Entity.cpp
Expand Up @@ -456,13 +456,9 @@ namespace
bool renderSolid;

// Count of submitted and processed renderables, and lights
int renderables = 0;
int processedNodes = 0;
int highlightRenderables = 0;

// List of renderables and their shaders
std::vector< std::pair<const Shader*, const OpenGLRenderable*> > renderablePtrs;

std::vector<const OpenGLRenderable*> highlightRenderablePtrs;

void processNode(const scene::INodePtr& node, const VolumeTest& volume) override
Expand All @@ -471,14 +467,6 @@ namespace
++processedNodes;
}

void addRenderable(Shader& shader, const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const IRenderEntity* entity = nullptr) override
{
++renderables;
renderablePtrs.push_back(std::make_pair(&shader, &renderable));
}

void addHighlightRenderable(const OpenGLRenderable& renderable,
const Matrix4& localToWorld) override
{
Expand Down Expand Up @@ -1019,7 +1007,6 @@ TEST_F(EntityTest, RenderEmptyFuncStatic)
RenderFixture rf;
rf.renderSubGraph(funcStatic);
EXPECT_EQ(rf.nodesVisited, 1);
EXPECT_EQ(rf.collector.renderables, 0);
}

TEST_F(EntityTest, RenderFuncStaticWithModel)
Expand Down

0 comments on commit 34cd699

Please sign in to comment.