]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/renderstate.cpp
Radiant:
[xonotic/netradiant.git] / radiant / renderstate.cpp
index 0c274918c92096777ab57af1f3dbaa1f766efd10..b17342dbebf4bb02bdd5af913ce673725d35a633 100644 (file)
@@ -52,6 +52,7 @@
 #include "preferences.h"
 
 #include "xywindow.h"
+#include "camwindow.h"
 
 
 
@@ -2151,9 +2152,9 @@ void OpenGLShader::construct( const char* name ){
                        state.m_sort = OpenGLState::eSortFullbright;
                }
                else if ( string_equal( name + 1, "CAM_HIGHLIGHT" ) ) {
-                       state.m_colour[0] = 1;
-                       state.m_colour[1] = 0;
-                       state.m_colour[2] = 0;
+                       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] = 0.3f;
                        state.m_state = RENDER_FILL | RENDER_DEPTHTEST | RENDER_CULLFACE | RENDER_BLEND | RENDER_COLOURWRITE | RENDER_DEPTHWRITE;
                        state.m_sort = OpenGLState::eSortHighlight;
@@ -2363,6 +2364,7 @@ void OpenGLShader::construct( const char* name ){
                                BlendFunc blendFunc = m_shader->getBlendFunc();
                                state.m_blend_src = convertBlendFactor( blendFunc.m_src );
                                state.m_blend_dst = convertBlendFactor( blendFunc.m_dst );
+                               state.m_depthfunc = GL_LEQUAL;
                                if ( state.m_blend_src == GL_SRC_ALPHA || state.m_blend_dst == GL_SRC_ALPHA ) {
                                        state.m_state |= RENDER_DEPTHWRITE;
                                }