* preferences->Camera->Colorize selection option (filling highlighting), def=on
* fix: selected faces wire color is updated immediately on colour theme change
This commit is contained in:
parent
5761c6006b
commit
3d3592c1f0
|
|
@ -2681,8 +2681,7 @@ void render( Renderer& renderer, const VolumeTest& volume, const Matrix4& localT
|
||||||
renderer.PushState();
|
renderer.PushState();
|
||||||
renderer.Highlight( Renderer::ePrimitiveWire );
|
renderer.Highlight( Renderer::ePrimitiveWire );
|
||||||
if ( selectedComponents() ) {
|
if ( selectedComponents() ) {
|
||||||
renderer.Highlight( Renderer::eFace );
|
renderer.Highlight( Renderer::EHighlightMode( Renderer::eFace | Renderer::eFaceWire ) );
|
||||||
renderer.Highlight( Renderer::eFaceWire );
|
|
||||||
}
|
}
|
||||||
m_face->render( renderer, localToWorld );
|
m_face->render( renderer, localToWorld );
|
||||||
renderer.PopState();
|
renderer.PopState();
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ struct camwindow_globals_private_t
|
||||||
bool m_bCubicClipping;
|
bool m_bCubicClipping;
|
||||||
int m_nStrafeMode;
|
int m_nStrafeMode;
|
||||||
bool m_bFaceWire;
|
bool m_bFaceWire;
|
||||||
|
bool m_bFaceFill;
|
||||||
int m_MSAA;
|
int m_MSAA;
|
||||||
|
|
||||||
camwindow_globals_private_t() :
|
camwindow_globals_private_t() :
|
||||||
|
|
@ -92,6 +93,7 @@ struct camwindow_globals_private_t
|
||||||
m_bCubicClipping( false ),
|
m_bCubicClipping( false ),
|
||||||
m_nStrafeMode( 3 ),
|
m_nStrafeMode( 3 ),
|
||||||
m_bFaceWire( true ),
|
m_bFaceWire( true ),
|
||||||
|
m_bFaceFill( true ),
|
||||||
m_MSAA( 8 ){
|
m_MSAA( 8 ){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1577,7 +1579,7 @@ CamRenderer( RenderStateFlags globalstate, Shader* facewire, Shader* wire, Shade
|
||||||
m_state_select1( select1 ),
|
m_state_select1( select1 ),
|
||||||
m_viewer( viewer ){
|
m_viewer( viewer ){
|
||||||
ASSERT_NOTNULL( select0 );
|
ASSERT_NOTNULL( select0 );
|
||||||
ASSERT_NOTNULL( select1 );
|
// ASSERT_NOTNULL( select1 );
|
||||||
m_state_stack.push_back( state_type() );
|
m_state_stack.push_back( state_type() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1612,12 +1614,12 @@ void addRenderable( const OpenGLRenderable& renderable, const Matrix4& world ){
|
||||||
else if ( m_state_wire && m_state_stack.back().m_highlight & ePrimitiveWire ) {
|
else if ( m_state_wire && m_state_stack.back().m_highlight & ePrimitiveWire ) {
|
||||||
m_state_wire->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
m_state_wire->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
||||||
}
|
}
|
||||||
if ( m_state_stack.back().m_highlight & eFace ) {
|
if ( m_state_select1 && m_state_stack.back().m_highlight & eFace ) {
|
||||||
m_state_select1->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
m_state_select1->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
||||||
|
}
|
||||||
if ( m_state_facewire && m_state_stack.back().m_highlight & eFaceWire ) {
|
if ( m_state_facewire && m_state_stack.back().m_highlight & eFaceWire ) {
|
||||||
m_state_facewire->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
m_state_facewire->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_state_stack.back().m_state->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
m_state_stack.back().m_state->addRenderable( renderable, world, m_state_stack.back().m_lights );
|
||||||
}
|
}
|
||||||
|
|
@ -1755,7 +1757,12 @@ void CamWnd::Cam_Draw(){
|
||||||
// }
|
// }
|
||||||
|
|
||||||
{
|
{
|
||||||
CamRenderer renderer( globalstate, g_camwindow_globals_private.m_bFaceWire ? m_state_facewire : 0, m_Camera.draw_mode == cd_texture_plus_wire ? m_state_wire : 0, m_state_select0, m_state_select1, m_view.getViewer() );
|
CamRenderer renderer( globalstate,
|
||||||
|
g_camwindow_globals_private.m_bFaceWire ? m_state_facewire : 0,
|
||||||
|
m_Camera.draw_mode == cd_texture_plus_wire ? m_state_wire : 0,
|
||||||
|
m_state_select0,
|
||||||
|
g_camwindow_globals_private.m_bFaceFill ? m_state_select1 : 0,
|
||||||
|
m_view.getViewer() );
|
||||||
|
|
||||||
Scene_Render( renderer, m_view );
|
Scene_Render( renderer, m_view );
|
||||||
|
|
||||||
|
|
@ -2157,6 +2164,11 @@ void Camera_constructPreferences( PreferencesPage& page ){
|
||||||
FreeCaller1<bool, Camera_SetFarClip>(),
|
FreeCaller1<bool, Camera_SetFarClip>(),
|
||||||
BoolExportCaller( g_camwindow_globals_private.m_bCubicClipping )
|
BoolExportCaller( g_camwindow_globals_private.m_bCubicClipping )
|
||||||
);
|
);
|
||||||
|
page.appendCheckBox(
|
||||||
|
"", "Colorize selection",
|
||||||
|
BoolImportCaller( g_camwindow_globals_private.m_bFaceFill ),
|
||||||
|
BoolExportCaller( g_camwindow_globals_private.m_bFaceFill )
|
||||||
|
);
|
||||||
page.appendCheckBox(
|
page.appendCheckBox(
|
||||||
"", "Selected faces wire",
|
"", "Selected faces wire",
|
||||||
BoolImportCaller( g_camwindow_globals_private.m_bFaceWire ),
|
BoolImportCaller( g_camwindow_globals_private.m_bFaceWire ),
|
||||||
|
|
|
||||||
|
|
@ -2269,18 +2269,18 @@ void OpenGLShader::construct( const char* name ){
|
||||||
state.m_depthfunc = GL_LEQUAL;
|
state.m_depthfunc = GL_LEQUAL;
|
||||||
}
|
}
|
||||||
else if ( string_equal( name + 1, "CAM_FACEWIRE" ) ) {
|
else if ( string_equal( name + 1, "CAM_FACEWIRE" ) ) {
|
||||||
state.m_colour[0] = g_xywindow_globals.color_selbrushes[0];
|
state.m_colour[0] = g_camwindow_globals.color_selbrushes3d[0];
|
||||||
state.m_colour[1] = g_xywindow_globals.color_selbrushes[1];
|
state.m_colour[1] = g_camwindow_globals.color_selbrushes3d[1];
|
||||||
state.m_colour[2] = g_xywindow_globals.color_selbrushes[2];
|
state.m_colour[2] = g_camwindow_globals.color_selbrushes3d[2];
|
||||||
state.m_colour[3] = 1;
|
state.m_colour[3] = 1;
|
||||||
state.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_OFFSETLINE;
|
state.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_OFFSETLINE;
|
||||||
state.m_sort = OpenGLState::eSortOverlayFirst + 2;
|
state.m_sort = OpenGLState::eSortOverlayFirst + 2;
|
||||||
state.m_depthfunc = GL_LEQUAL;
|
state.m_depthfunc = GL_LEQUAL;
|
||||||
|
|
||||||
OpenGLState& hiddenLine = appendDefaultPass();
|
OpenGLState& hiddenLine = appendDefaultPass();
|
||||||
hiddenLine.m_colour[0] = g_xywindow_globals.color_selbrushes[0];
|
hiddenLine.m_colour[0] = g_camwindow_globals.color_selbrushes3d[0];
|
||||||
hiddenLine.m_colour[1] = g_xywindow_globals.color_selbrushes[1];
|
hiddenLine.m_colour[1] = g_camwindow_globals.color_selbrushes3d[1];
|
||||||
hiddenLine.m_colour[2] = g_xywindow_globals.color_selbrushes[2];
|
hiddenLine.m_colour[2] = g_camwindow_globals.color_selbrushes3d[2];
|
||||||
hiddenLine.m_colour[3] = 1;
|
hiddenLine.m_colour[3] = 1;
|
||||||
hiddenLine.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_OFFSETLINE | RENDER_LINESTIPPLE;
|
hiddenLine.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_OFFSETLINE | RENDER_LINESTIPPLE;
|
||||||
hiddenLine.m_sort = OpenGLState::eSortOverlayFirst + 1;
|
hiddenLine.m_sort = OpenGLState::eSortOverlayFirst + 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user