Skip to content

Commit

Permalink
#5623: Rendering of selected merge action nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed May 29, 2021
1 parent 69e0f51 commit e08f1c3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/iglrender.h
Expand Up @@ -36,13 +36,13 @@ class OpenGLState
SORT_INTERACTION = 2, // used by the DBS pass
SORT_FULLBRIGHT = 1025, // used by non-translucent editor passes
SORT_TRANSLUCENT = 1026, // used by blend-type editor passes
SORT_HIGHLIGHT = 1027, // used by the (red) selection system overlay
SORT_OVERLAY_FIRST = 1028, // used by decals
SORT_OVERLAY_SECOND = 1029, // used by merge actions
SORT_OVERLAY_THIRD = 1030, // used by merge actions
SORT_OVERLAY_ONE_BEFORE_LAST = 2046, // used by merge actions
SORT_OVERLAY_LAST = 2047,
SORT_POINT_FIRST = 2048, // used by POINT renderers
SORT_HIGHLIGHT = 2048, // used by the (red) selection system overlay
SORT_POINT_FIRST = 2049, // used by POINT renderers
SORT_POINT_LAST = 3071,
SORT_GUI0 = 3072, // used by selection system controls, pivots (visible)
SORT_GUI1 = 3073, // used by selection system controls, pivots (obscured)
Expand Down
6 changes: 6 additions & 0 deletions radiant/xyview/XYRenderer.h
Expand Up @@ -79,6 +79,12 @@ class XYRenderer :
_shaders.nonMergeActionNodeShader->addRenderable(renderable, localToWorld, nullptr, entity);
}

// Elements can still be selected in merge mode
if ((_flags & Highlight::Flags::Primitives) != 0)
{
_shaders.selectedShader->addRenderable(renderable, localToWorld, nullptr, entity);
}

return;
}

Expand Down
2 changes: 1 addition & 1 deletion radiantcore/map/MergeActionNode.h
Expand Up @@ -106,7 +106,7 @@ class MergeActionNode final :

std::size_t getHighlightFlags() override
{
return Highlight::NoHighlight;
return isSelected() ? Highlight::Selected : Highlight::NoHighlight;
}

void testSelect(Selector& selector, SelectionTest& test) override
Expand Down
4 changes: 2 additions & 2 deletions radiantcore/rendersystem/backend/OpenGLShader.cpp
Expand Up @@ -853,7 +853,7 @@ void OpenGLShader::construct()
static_cast<float>(colorSelBrushes[2]),
static_cast<float>(1));
state.setRenderFlag(RENDER_LINESTIPPLE);
state.setSortPosition(OpenGLState::SORT_OVERLAY_FIRST);
state.setSortPosition(OpenGLState::SORT_HIGHLIGHT);
state.m_linewidth = 2;
state.m_linestipple_factor = 3;
}
Expand All @@ -865,7 +865,7 @@ void OpenGLShader::construct()
static_cast<float>(colorSelBrushes[2]),
static_cast<float>(1));
state.setRenderFlag(RENDER_LINESTIPPLE);
state.setSortPosition(OpenGLState::SORT_OVERLAY_FIRST);
state.setSortPosition(OpenGLState::SORT_HIGHLIGHT);
state.m_linewidth = 2;
state.m_linestipple_factor = 3;
}
Expand Down

0 comments on commit e08f1c3

Please sign in to comment.