]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
added Print versions of Printf functions and made all calls that do not need formatin...
[xonotic/darkplaces.git] / gl_draw.c
index f0905e98d787051e07beeef4f25cb349902b1a04..f2aa89200195c822be6a18564b9224db2c4497fd 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -197,10 +197,24 @@ static rtexture_t *draw_generatecrosshair(int num)
 
 static rtexture_t *draw_generateditherpattern(void)
 {
+#if 1
+       int x, y;
+       qbyte data[8*8*4];
+       for (y = 0;y < 8;y++)
+       {
+               for (x = 0;x < 8;x++)
+               {
+                       data[(y*8+x)*4+0] = data[(y*8+x)*4+1] = data[(y*8+x)*4+2] = ((x^y) & 4) ? 255 : 0;
+                       data[(y*8+x)*4+3] = 255;
+               }
+       }
+       return R_LoadTexture2D(drawtexturepool, "ditherpattern", 8, 8, data, TEXTYPE_RGBA, TEXF_FORCENEAREST | TEXF_PRECACHE, NULL);
+#else
        qbyte data[16];
        memset(data, 255, sizeof(data));
        data[0] = data[1] = data[2] = data[12] = data[13] = data[14] = 0;
        return R_LoadTexture2D(drawtexturepool, "ditherpattern", 2, 2, data, TEXTYPE_RGBA, TEXF_FORCENEAREST | TEXF_PRECACHE, NULL);
+#endif
 }
 
 /*
@@ -268,7 +282,7 @@ cachepic_t  *Draw_CachePic (char *path)
                pic->tex = draw_generateditherpattern();
        if (pic->tex == NULL)
        {
-               Con_Printf ("Draw_CachePic: failed to load %s\n", path);
+               Con_Printf("Draw_CachePic: failed to load %s\n", path);
                pic->tex = r_notexture;
        }
 
@@ -404,10 +418,9 @@ void R_DrawQueue(void)
                        quadelements[pos++] = num + 3;
                }
        }
-       GL_SetupView_ViewPort(vid.realx, vid.realy, vid.realwidth, vid.realheight);
+       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);
@@ -511,11 +524,11 @@ void R_DrawQueue(void)
                        {
                                // We have to convert the con coords into real coords
                                int x , y, width, height;
-                               x = dq->x * (vid.realwidth / vid.conwidth) + vid.realx;
+                               x = dq->x * ((float)vid.realwidth / vid.conwidth);
                                // OGL uses top to bottom 
-                               y = (dq->y + dq->scaley) * (vid.realheight / vid.conheight) + vid.realy;
-                               width = dq->scalex * (vid.realwidth / vid.conwidth);
-                               height = dq->scaley * (vid.realheight / vid.conheight);
+                               y = dq->y * ((float) vid.realheight / vid.conheight);
+                               width = dq->scalex * ((float)vid.realwidth / vid.conwidth);
+                               height = dq->scaley * ((float)vid.realheight / vid.conheight);
 
                                GL_Scissor(x, y, width, height);
 
@@ -570,6 +583,5 @@ void R_DrawQueue(void)
                        R_Mesh_Draw(3, 1, polygonelements);
                }
        }
-       R_Mesh_Finish();
 }