made r_showtris transparent (quite faint actually), color coded different types of...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 3 Mar 2004 15:26:27 +0000 (15:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 3 Mar 2004 15:26:27 +0000 (15:26 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3961 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
gl_backend.h
gl_draw.c
gl_rmain.c
gl_rsurf.c
r_shadow.c
r_sky.c
render.h

index b20f734..f4ccc39 100644 (file)
@@ -345,6 +345,7 @@ static struct
        int blendfunc2;
        int blend;
        GLboolean depthmask;
+       int colormask; // stored as bottom 4 bits: r g b a (3 2 1 0 order)
        int depthtest;
        int scissortest;
        int unit;
@@ -427,6 +428,7 @@ void GL_Backend_ResetState(void)
        gl_state.blendfunc2 = GL_ZERO;
        gl_state.blend = false;
        gl_state.depthmask = GL_TRUE;
+       gl_state.colormask = 15;
        gl_state.color4f[0] = gl_state.color4f[1] = gl_state.color4f[2] = gl_state.color4f[3] = 1;
        gl_state.lockrange_first = 0;
        gl_state.lockrange_count = 0;
@@ -435,6 +437,7 @@ void GL_Backend_ResetState(void)
 
        CHECKGLERROR
 
+       qglColorMask(1, 1, 1, 1);
        qglEnable(GL_CULL_FACE);CHECKGLERROR
        qglCullFace(GL_FRONT);CHECKGLERROR
        qglEnable(GL_DEPTH_TEST);CHECKGLERROR
@@ -545,6 +548,18 @@ void GL_DepthTest(int state)
        }
 }
 
+void GL_ColorMask(int r, int g, int b, int a)
+{
+       int state = r*8 + g*4 + b*2 + a*1;
+       if (gl_state.colormask != state)
+       {
+               if (r_showtrispass)
+                       return;
+               gl_state.colormask = state;
+               qglColorMask(r, g, b, a);CHECKGLERROR
+       }
+}
+
 void GL_VertexPointer(const float *p)
 {
        if (gl_state.pointer_vertex != p)
@@ -596,6 +611,16 @@ void GL_Color(float cr, float cg, float cb, float ca)
        }
 }
 
+void GL_ShowTrisColor(float cr, float cg, float cb, float ca)
+{
+       if (!r_showtrispass)
+               return;
+       r_showtrispass = false;
+       GL_Color(cr,cg,cb,ca);
+       r_showtrispass = true;
+}
+
+
 void GL_LockArrays(int first, int count)
 {
        if (gl_state.lockrange_count != count || gl_state.lockrange_first != first)
@@ -638,6 +663,13 @@ void GL_ScissorTest(int state)
        CHECKGLERROR
 }
 
+void GL_Clear(int mask)
+{
+       if (r_showtrispass)
+               return;
+       qglClear(mask);CHECKGLERROR
+}
+
 void GL_TransformToScreen(const vec4_t in, vec4_t out)
 {
        vec4_t temp;
@@ -1081,7 +1113,7 @@ void R_ClearScreen(void)
                        qglClearStencil(128);CHECKGLERROR
                }
                // clear the screen
-               qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | (gl_stencil ? GL_STENCIL_BUFFER_BIT : 0));CHECKGLERROR
+               GL_Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | (gl_stencil ? GL_STENCIL_BUFFER_BIT : 0));
                // set dithering mode
                if (gl_dither.integer)
                {
@@ -1117,11 +1149,14 @@ void SCR_UpdateScreen (void)
 {
        if (gl_delayfinish.integer)
        {
-               VID_Finish ();
-
+               R_Mesh_Finish();
+               R_TimeReport("meshfinish");
+               VID_Finish();
                R_TimeReport("finish");
        }
 
+       R_Mesh_Start();
+
        if (r_textureunits.integer > gl_textureunits)
                Cvar_SetValueQuick(&r_textureunits, gl_textureunits);
        if (r_textureunits.integer < 1)
@@ -1130,6 +1165,7 @@ void SCR_UpdateScreen (void)
        if (gl_combine.integer && (!gl_combine_extension || r_textureunits.integer < 2))
                Cvar_SetValueQuick(&gl_combine, 0);
 
+showtris:
        R_TimeReport("setup");
 
        R_ClearScreen();
@@ -1211,6 +1247,21 @@ void SCR_UpdateScreen (void)
        // draw 2D stuff
        R_DrawQueue();
 
+       if (r_showtrispass)
+               r_showtrispass = false;
+       else if (r_showtris.integer)
+       {
+               rmeshstate_t m;
+               GL_BlendFunc(GL_ONE, GL_ONE);
+               GL_DepthTest(GL_FALSE);
+               GL_DepthMask(GL_FALSE);
+               memset(&m, 0, sizeof(m));
+               R_Mesh_State_Texture(&m);
+               r_showtrispass = true;
+               GL_ShowTrisColor(0.2,0.2,0.2,1);
+               goto showtris;
+       }
+
        if (gl_delayfinish.integer)
        {
                // tell driver to commit it's partially full geometry queue to the rendering queue
@@ -1219,8 +1270,9 @@ void SCR_UpdateScreen (void)
        }
        else
        {
-               VID_Finish ();
-
+               R_Mesh_Finish();
+               R_TimeReport("meshfinish");
+               VID_Finish();
                R_TimeReport("finish");
        }
 }
index 1bec413..6b50d07 100644 (file)
@@ -15,15 +15,18 @@ void GL_SetupView_Mode_Ortho(double x1, double y1, double x2, double y2, double
 void GL_BlendFunc(int blendfunc1, int blendfunc2);
 void GL_DepthMask(int state);
 void GL_DepthTest(int state);
+void GL_ColorMask(int r, int g, int b, int a);
 void GL_VertexPointer(const float *p);
 void GL_ColorPointer(const float *p);
 void GL_Color(float cr, float cg, float cb, float ca);
+void GL_ShowTrisColor(float cr, float cg, float cb, float ca);
 void GL_TransformToScreen(const vec4_t in, vec4_t out);
 void GL_LockArrays(int first, int count);
 void GL_ActiveTexture(int num);
 void GL_ClientActiveTexture(int num);
 void GL_Scissor(int x, int y, int width, int height); // AK for DRAWQUEUE_SETCLIP
 void GL_ScissorTest(int state);        // AK for DRAWQUEUE_(RE)SETCLIP
+void GL_Clear(int mask);
 
 extern cvar_t gl_lockarrays;
 extern cvar_t gl_mesh_copyarrays;
index e143ad3..8385218 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -421,7 +421,6 @@ void R_DrawQueue(void)
        qglViewport(0, 0, vid.realwidth, vid.realheight);
        GL_SetupView_Mode_Ortho(0, 0, vid.conwidth, vid.conheight, -10, 100);
        qglDepthFunc(GL_LEQUAL);
-       R_Mesh_Start();
        R_Mesh_Matrix(&r_identitymatrix);
 
        chartexnum = R_GetTexture(char_texture);
@@ -584,6 +583,5 @@ void R_DrawQueue(void)
                        R_Mesh_Draw(3, 1, polygonelements);
                }
        }
-       R_Mesh_Finish();
 }
 
index 9c0dfd0..61971ea 100644 (file)
@@ -628,8 +628,6 @@ void R_RenderView(void)
        GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
        GL_ScissorTest(true);
        R_ClearScreen();
-
-       R_Mesh_Start();
        R_TimeReport("setup");
 
        qglDepthFunc(GL_LEQUAL);
@@ -637,19 +635,6 @@ void R_RenderView(void)
        qglEnable(GL_POLYGON_OFFSET_FILL);
 
        R_RenderScene();
-       if (r_showtris.integer)
-       {
-               rmeshstate_t m;
-               GL_Color(1,1,1,1);
-               GL_BlendFunc(GL_ONE, GL_ZERO);
-               GL_DepthTest(GL_FALSE);
-               GL_DepthMask(GL_FALSE);
-               memset(&m, 0, sizeof(m));
-               R_Mesh_State_Texture(&m);
-               r_showtrispass = true;
-               R_RenderScene();
-               r_showtrispass = false;
-       }
 
        qglPolygonOffset(0, 0);
        qglDisable(GL_POLYGON_OFFSET_FILL);
@@ -657,9 +642,6 @@ void R_RenderView(void)
        R_BlendView();
        R_TimeReport("blendview");
        
-       R_Mesh_Finish();
-       R_TimeReport("meshfinish");
-
        GL_Scissor(0, 0, vid.realwidth, vid.realheight);
        GL_ScissorTest(false);
 }
@@ -675,6 +657,8 @@ void R_RenderScene(void)
 
        r_framecount++;
 
+       GL_ShowTrisColor(0.05, 0.05, 0.05, 1);
+
        R_SetFrustum();
 
        r_farclip = R_FarClip(r_vieworigin, r_viewforward, 768.0f) + 256.0f;
@@ -715,6 +699,8 @@ void R_RenderScene(void)
        if (!intimerefresh && !r_speeds.integer)
                S_ExtraUpdate ();
 
+       GL_ShowTrisColor(0, 0.015, 0, 1);
+
        R_DrawModels();
        R_TimeReport("models");
 
@@ -722,6 +708,7 @@ void R_RenderScene(void)
        if (!intimerefresh && !r_speeds.integer)
                S_ExtraUpdate ();
 
+       GL_ShowTrisColor(0, 0, 0.033, 1);
        R_ShadowVolumeLighting(false);
        R_TimeReport("rtlights");
 
@@ -729,6 +716,8 @@ void R_RenderScene(void)
        if (!intimerefresh && !r_speeds.integer)
                S_ExtraUpdate ();
 
+       GL_ShowTrisColor(0.1, 0, 0, 1);
+
        R_DrawLightningBeams();
        R_TimeReport("lightning");
 
@@ -750,12 +739,14 @@ void R_RenderScene(void)
        R_MeshQueue_Render();
        R_MeshQueue_EndScene();
 
-       if (r_shadow_visiblevolumes.integer)
+       if (r_shadow_visiblevolumes.integer && !r_showtrispass)
        {
                R_ShadowVolumeLighting(true);
                R_TimeReport("shadowvolume");
        }
 
+       GL_ShowTrisColor(0.05, 0.05, 0.05, 1);
+
        // don't let sound skip if going slow
        if (!intimerefresh && !r_speeds.integer)
                S_ExtraUpdate ();
index bdff531..597206d 100644 (file)
@@ -749,7 +749,7 @@ static void RSurfShader_Sky(const entity_render_t *ent, const texture_t *texture
        if (skyrendermasked)
        {
                // depth-only (masking)
-               qglColorMask(0,0,0,0);
+               GL_ColorMask(0,0,0,0);
                // just to make sure that braindead drivers don't draw anything
                // despite that colormask...
                GL_BlendFunc(GL_ZERO, GL_ONE);
@@ -773,7 +773,7 @@ static void RSurfShader_Sky(const entity_render_t *ent, const texture_t *texture
                        R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
                }
        }
-       qglColorMask(1,1,1,1);
+       GL_ColorMask(1,1,1,1);
 }
 
 static void RSurfShader_Water_Callback(const void *calldata1, int calldata2)
@@ -2056,7 +2056,7 @@ void R_Q3BSP_DrawSkyFace(entity_render_t *ent, q3mface_t *face)
        if (skyrendermasked)
        {
                // depth-only (masking)
-               qglColorMask(0,0,0,0);
+               GL_ColorMask(0,0,0,0);
                // just to make sure that braindead drivers don't draw anything
                // despite that colormask...
                GL_BlendFunc(GL_ZERO, GL_ONE);
@@ -2074,7 +2074,7 @@ void R_Q3BSP_DrawSkyFace(entity_render_t *ent, q3mface_t *face)
 
        GL_VertexPointer(face->data_vertex3f);
        R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
-       qglColorMask(1,1,1,1);
+       GL_ColorMask(1,1,1,1);
 }
 
 void R_Q3BSP_DrawFace_OpaqueWall_Pass_OpaqueGlow(entity_render_t *ent, q3mface_t *face)
index 4f5e1ca..d9cb969 100644 (file)
@@ -763,7 +763,7 @@ void R_Shadow_Stage_ShadowVolumes(void)
        memset(&m, 0, sizeof(m));
        R_Mesh_State_Texture(&m);
        GL_Color(1, 1, 1, 1);
-       qglColorMask(0, 0, 0, 0);
+       GL_ColorMask(0, 0, 0, 0);
        GL_BlendFunc(GL_ONE, GL_ZERO);
        GL_DepthMask(false);
        GL_DepthTest(true);
@@ -781,7 +781,7 @@ void R_Shadow_Stage_ShadowVolumes(void)
        qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
        qglStencilFunc(GL_ALWAYS, 128, 0xFF);
        r_shadowstage = SHADOWSTAGE_STENCIL;
-       qglClear(GL_STENCIL_BUFFER_BIT);
+       GL_Clear(GL_STENCIL_BUFFER_BIT);
        c_rt_clears++;
        // LordHavoc note: many shadow volumes reside entirely inside the world
        // (that is to say they are entirely bounded by their lit surfaces),
@@ -803,7 +803,7 @@ void R_Shadow_Stage_LightWithoutShadows(void)
        qglPolygonOffset(0, 0);
        //qglDisable(GL_POLYGON_OFFSET_FILL);
        GL_Color(1, 1, 1, 1);
-       qglColorMask(1, 1, 1, 1);
+       GL_ColorMask(1, 1, 1, 1);
        qglDepthFunc(GL_EQUAL);
        qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
        qglDisable(GL_STENCIL_TEST);
@@ -824,7 +824,7 @@ void R_Shadow_Stage_LightWithShadows(void)
        qglPolygonOffset(0, 0);
        //qglDisable(GL_POLYGON_OFFSET_FILL);
        GL_Color(1, 1, 1, 1);
-       qglColorMask(1, 1, 1, 1);
+       GL_ColorMask(1, 1, 1, 1);
        qglDepthFunc(GL_EQUAL);
        qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
        qglEnable(GL_STENCIL_TEST);
@@ -847,7 +847,7 @@ void R_Shadow_Stage_End(void)
        qglPolygonOffset(0, 0);
        //qglDisable(GL_POLYGON_OFFSET_FILL);
        GL_Color(1, 1, 1, 1);
-       qglColorMask(1, 1, 1, 1);
+       GL_ColorMask(1, 1, 1, 1);
        GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
        qglDepthFunc(GL_LEQUAL);
        qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
@@ -1178,7 +1178,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        m.pointer_texcoord[2] = varray_texcoord3f[2];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        GL_BlendFunc(GL_ONE, GL_ZERO);
                        R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
                        R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[2], numverts, vertex3f, matrix_modeltoattenuationxyz);
@@ -1196,7 +1196,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                                R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
                        }
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -1217,7 +1217,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.tex3d[0] = R_GetTexture(r_shadow_attenuation3dtexture);
                        m.pointer_texcoord[0] = varray_texcoord3f[0];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        GL_BlendFunc(GL_ONE, GL_ZERO);
                        R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
                        R_Mesh_Draw(numverts, numtriangles, elements);
@@ -1248,7 +1248,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                                R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
                        }
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -1273,7 +1273,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        GL_BlendFunc(GL_ONE, GL_ZERO);
                        R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
                        R_Mesh_Draw(numverts, numtriangles, elements);
@@ -1286,7 +1286,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
                        VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
@@ -1316,7 +1316,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.pointer_texcoord[2] = varray_texcoord2f[2];
                        m.pointer_texcoord[3] = varray_texcoord2f[3];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        GL_BlendFunc(GL_ONE, GL_ZERO);
                        R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
                        R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[2], numverts, vertex3f, matrix_modeltoattenuationxyz);
@@ -1335,7 +1335,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                                R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
                        }
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -1358,7 +1358,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                        m.pointer_texcoord[0] = varray_texcoord2f[0];
                        m.pointer_texcoord[1] = varray_texcoord2f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        GL_BlendFunc(GL_ONE, GL_ZERO);
                        R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
                        R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[1], numverts, vertex3f, matrix_modeltoattenuationz);
@@ -1390,7 +1390,7 @@ void R_Shadow_DiffuseLighting(int numverts, int numtriangles, const int *element
                                R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
                        }
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -1467,7 +1467,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        // this squares the result
                        GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
                        R_Shadow_GenTexCoords_Specular_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin, relativeeyeorigin);
@@ -1510,7 +1510,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        }
                        m.pointer_texcoord[0] = texcoord2f;
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, colorscale, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -1534,7 +1534,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        // this squares the result
                        GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
                        R_Shadow_GenTexCoords_Specular_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin, relativeeyeorigin);
@@ -1563,7 +1563,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
                        VectorScale(lightcolor, colorscale, color2);
@@ -1588,7 +1588,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        m.pointer_texcoord[0] = texcoord2f;
                        m.pointer_texcoord[1] = varray_texcoord3f[1];
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(0,0,0,1);
+                       GL_ColorMask(0,0,0,1);
                        // this squares the result
                        GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
                        R_Shadow_GenTexCoords_Specular_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin, relativeeyeorigin);
@@ -1634,7 +1634,7 @@ void R_Shadow_SpecularLighting(int numverts, int numtriangles, const int *elemen
                        }
                        m.pointer_texcoord[0] = texcoord2f;
                        R_Mesh_State_Texture(&m);
-                       qglColorMask(1,1,1,0);
+                       GL_ColorMask(1,1,1,0);
                        GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
                        VectorScale(lightcolor, colorscale, color2);
                        for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
@@ -2038,7 +2038,7 @@ void R_DrawRTLight(rtlight_t *rtlight, int visiblevolumes)
                                qglDisable(GL_DEPTH_TEST);
                                qglDisable(GL_STENCIL_TEST);
                                //qglDisable(GL_CULL_FACE);
-                               qglColorMask(1,1,1,1);
+                               GL_ColorMask(1,1,1,1);
                                memset(&m, 0, sizeof(m));
                                R_Mesh_State_Texture(&m);
                                GL_Color(0,0.1,0,1);
@@ -2054,7 +2054,7 @@ void R_DrawRTLight(rtlight_t *rtlight, int visiblevolumes)
                                if (stencilenabled)
                                {
                                        qglEnable(GL_STENCIL_TEST);
-                                       qglColorMask(0,0,0,0);
+                                       GL_ColorMask(0,0,0,0);
                                }
                        }
                        R_Shadow_RenderShadowMeshVolume(rtlight->static_meshchain_shadow);
diff --git a/r_sky.c b/r_sky.c
index b8ed536..a6fe724 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -378,7 +378,7 @@ void R_Sky(void)
                        // this modifies the depth buffer so we have to clear it afterward
                        //R_SkyRoom();
                        // clear the depthbuffer that was used while rendering the skyroom
-                       //qglClear(GL_DEPTH_BUFFER_BIT);
+                       //GL_Clear(GL_DEPTH_BUFFER_BIT);
                }
                */
        }
index 0e47172..ec03626 100644 (file)
--- a/render.h
+++ b/render.h
@@ -87,6 +87,7 @@ extern        mplane_t        frustum[4];
 extern int             c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_models, c_bmodels, c_sprites, c_particles, c_dlights;
 
 // forces all rendering to draw triangle outlines
+extern cvar_t r_showtris;
 extern int r_showtrispass;
 
 //