]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
Configure all of the CL_MeshEntities* meshes the same, the material flags decide...
[xonotic/darkplaces.git] / gl_draw.c
index 88431d9a83e206deeb34ae1cc6d1467889d4e317..66f6de4f915cea1cdac0538a51d408febcd9d0b4 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1971,8 +1971,6 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags, qboolean hasalpha)
 
 void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags)
 {
-       int num;
-
        _DrawQ_SetupAndProcessDrawFlag(flags, NULL, 1);
        if(!r_draw2d.integer && !r_draw2d_force)
                return;
@@ -1984,16 +1982,19 @@ void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags)
        case RENDERPATH_GL13:
        case RENDERPATH_GL20:
 #ifndef USE_GLES2
-               CHECKGLERROR
-               qglBegin(GL_LINE_LOOP);
-               for (num = 0;num < mesh->num_vertices;num++)
                {
-                       if (mesh->data_color4f)
-                               GL_Color(mesh->data_color4f[num*4+0], mesh->data_color4f[num*4+1], mesh->data_color4f[num*4+2], mesh->data_color4f[num*4+3]);
-                       qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]);
+                       int num;
+                       CHECKGLERROR
+                       qglBegin(GL_LINE_LOOP);
+                       for (num = 0;num < mesh->num_vertices;num++)
+                       {
+                               if (mesh->data_color4f)
+                                       GL_Color(mesh->data_color4f[num*4+0], mesh->data_color4f[num*4+1], mesh->data_color4f[num*4+2], mesh->data_color4f[num*4+3]);
+                               qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]);
+                       }
+                       qglEnd();
+                       CHECKGLERROR
                }
-               qglEnd();
-               CHECKGLERROR
 #endif
                break;
        case RENDERPATH_D3D9:
@@ -2110,10 +2111,10 @@ void DrawQ_SetClipArea(float x, float y, float width, float height)
 
        // We have to convert the con coords into real coords
        // OGL uses top to bottom
-       ix = (int)(0.5 + x * ((float)vid.width / vid_conwidth.integer));
-       iy = (int)(0.5 + y * ((float) vid.height / vid_conheight.integer));
-       iw = (int)(0.5 + (x+width) * ((float)vid.width / vid_conwidth.integer)) - ix;
-       ih = (int)(0.5 + (y+height) * ((float) vid.height / vid_conheight.integer)) - iy;
+       ix = (int)(0.5 + x * ((float)r_refdef.view.width / vid_conwidth.integer)) + r_refdef.view.x;
+       iy = (int)(0.5 + y * ((float)r_refdef.view.height / vid_conheight.integer)) + r_refdef.view.y;
+       iw = (int)(0.5 + width * ((float)r_refdef.view.width / vid_conwidth.integer));
+       ih = (int)(0.5 + height * ((float)r_refdef.view.height / vid_conheight.integer));
        switch(vid.renderpath)
        {
        case RENDERPATH_GL11:
@@ -2166,13 +2167,11 @@ void R_DrawGamma(void)
        case RENDERPATH_D3D10:
        case RENDERPATH_D3D11:
        case RENDERPATH_GLES2:
-               if (vid_usinghwgamma || v_glslgamma.integer)
+               if (v_glslgamma.integer)
                        return;
                break;
        case RENDERPATH_GL11:
        case RENDERPATH_GL13:
-               if (vid_usinghwgamma)
-                       return;
                break;
        case RENDERPATH_GLES1:
        case RENDERPATH_SOFT: