diff --git a/radiant/brush.h b/radiant/brush.h index ca62b640..3645a808 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -2681,8 +2681,7 @@ void render( Renderer& renderer, const VolumeTest& volume, const Matrix4& localT renderer.PushState(); renderer.Highlight( Renderer::ePrimitiveWire ); if ( selectedComponents() ) { - renderer.Highlight( Renderer::eFace ); - renderer.Highlight( Renderer::eFaceWire ); + renderer.Highlight( Renderer::EHighlightMode( Renderer::eFace | Renderer::eFaceWire ) ); } m_face->render( renderer, localToWorld ); renderer.PopState(); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 166a79ff..a1a47507 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -81,6 +81,7 @@ struct camwindow_globals_private_t bool m_bCubicClipping; int m_nStrafeMode; bool m_bFaceWire; + bool m_bFaceFill; int m_MSAA; camwindow_globals_private_t() : @@ -92,6 +93,7 @@ struct camwindow_globals_private_t m_bCubicClipping( false ), m_nStrafeMode( 3 ), m_bFaceWire( true ), + m_bFaceFill( true ), m_MSAA( 8 ){ } @@ -1577,7 +1579,7 @@ CamRenderer( RenderStateFlags globalstate, Shader* facewire, Shader* wire, Shade m_state_select1( select1 ), m_viewer( viewer ){ ASSERT_NOTNULL( select0 ); - ASSERT_NOTNULL( select1 ); +// ASSERT_NOTNULL( select1 ); m_state_stack.push_back( state_type() ); } @@ -1600,7 +1602,7 @@ void PopState(){ void Highlight( EHighlightMode mode, bool bEnable = true ){ ( bEnable ) ? m_state_stack.back().m_highlight |= mode - : m_state_stack.back().m_highlight &= ~mode; + : m_state_stack.back().m_highlight &= ~mode; } void setLights( const LightList& lights ){ m_state_stack.back().m_lights = &lights; @@ -1612,11 +1614,11 @@ void addRenderable( const OpenGLRenderable& renderable, const Matrix4& world ){ else if ( m_state_wire && m_state_stack.back().m_highlight & ePrimitiveWire ) { 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 ); - if ( m_state_facewire && m_state_stack.back().m_highlight & eFaceWire ) { - m_state_facewire->addRenderable( renderable, world, m_state_stack.back().m_lights ); - } + } + 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_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 ); @@ -2157,6 +2164,11 @@ void Camera_constructPreferences( PreferencesPage& page ){ FreeCaller1(), 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( "", "Selected faces wire", BoolImportCaller( g_camwindow_globals_private.m_bFaceWire ), diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index 6eb3fa7a..4913f8b0 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -2269,18 +2269,18 @@ void OpenGLShader::construct( const char* name ){ state.m_depthfunc = GL_LEQUAL; } else if ( string_equal( name + 1, "CAM_FACEWIRE" ) ) { - state.m_colour[0] = g_xywindow_globals.color_selbrushes[0]; - state.m_colour[1] = g_xywindow_globals.color_selbrushes[1]; - state.m_colour[2] = g_xywindow_globals.color_selbrushes[2]; + state.m_colour[0] = g_camwindow_globals.color_selbrushes3d[0]; + state.m_colour[1] = g_camwindow_globals.color_selbrushes3d[1]; + state.m_colour[2] = g_camwindow_globals.color_selbrushes3d[2]; state.m_colour[3] = 1; state.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_OFFSETLINE; state.m_sort = OpenGLState::eSortOverlayFirst + 2; state.m_depthfunc = GL_LEQUAL; OpenGLState& hiddenLine = appendDefaultPass(); - hiddenLine.m_colour[0] = g_xywindow_globals.color_selbrushes[0]; - hiddenLine.m_colour[1] = g_xywindow_globals.color_selbrushes[1]; - hiddenLine.m_colour[2] = g_xywindow_globals.color_selbrushes[2]; + hiddenLine.m_colour[0] = g_camwindow_globals.color_selbrushes3d[0]; + hiddenLine.m_colour[1] = g_camwindow_globals.color_selbrushes3d[1]; + hiddenLine.m_colour[2] = g_camwindow_globals.color_selbrushes3d[2]; hiddenLine.m_colour[3] = 1; hiddenLine.m_state = RENDER_CULLFACE | RENDER_DEPTHTEST | RENDER_COLOURWRITE | RENDER_OFFSETLINE | RENDER_LINESTIPPLE; hiddenLine.m_sort = OpenGLState::eSortOverlayFirst + 1; diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 29cc4e26..5fd12131 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -2575,7 +2575,7 @@ void PopState(){ void Highlight( EHighlightMode mode, bool bEnable = true ){ ( bEnable ) ? m_state_stack.back().m_highlight |= mode - : m_state_stack.back().m_highlight &= ~mode; + : m_state_stack.back().m_highlight &= ~mode; } void addRenderable( const OpenGLRenderable& renderable, const Matrix4& localToWorld ){ if ( m_state_stack.back().m_highlight & ePrimitive ) {