]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
allow longer player names
[xonotic/darkplaces.git] / gl_draw.c
index ec9392de31811c6d44a4ff74223bcdb0dc7c3ee2..32d736fa84c7bf4f06352647a7ff4d0b1acaed84 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1080,7 +1080,7 @@ void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, flo
        if(!r_draw2d.integer && !r_draw2d_force)
                return;
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        floats[12] = 0.0f;floats[13] = 0.0f;
        floats[14] = 1.0f;floats[15] = 0.0f;
        floats[16] = 1.0f;floats[17] = 1.0f;
@@ -1137,7 +1137,7 @@ void DrawQ_RotPic(float x, float y, cachepic_t *pic, float width, float height,
        if(!r_draw2d.integer && !r_draw2d_force)
                return;
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        if (pic)
        {
                if (width == 0)
@@ -1188,7 +1188,7 @@ void DrawQ_Fill(float x, float y, float width, float height, float red, float gr
        if(!r_draw2d.integer && !r_draw2d_force)
                return;
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1);
 
        floats[2] = floats[5] = floats[8] = floats[11] = 0;
@@ -1513,7 +1513,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
        if(!r_draw2d.integer && !r_draw2d_force)
                return startx + DrawQ_TextWidth_UntilWidth_TrackColors_Scale(text, &maxlen, w, h, sw, sh, NULL, ignorecolorcodes, fnt, 1000000000);
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        if (!fontmap)
                R_Mesh_TexBind(0, fnt->tex);
        R_SetupShader_Generic(fnt->tex, NULL, GL_MODULATE, 1);
@@ -1634,10 +1634,10 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
                        }
                        if (!fontmap || (ch <= 0xFF && fontmap->glyphs[ch].image) || (ch >= 0xE000 && ch <= 0xE0FF))
                        {
-                               if (ch > 0xE000)
+                               if (ch >= 0xE000)
                                        ch -= 0xE000;
                                if (ch > 0xFF)
-                                       continue;
+                                       goto out;
                                if (fontmap)
                                {
                                        if (map != ft2_oldstyle_map)
@@ -1769,6 +1769,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
                                //prevmap = map;
                                prevch = ch;
                        }
+out:
                        if (shadow)
                        {
                                x -= 1.0/pix_x * r_textshadow.value;
@@ -1857,7 +1858,7 @@ void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height
        if(!r_draw2d.integer && !r_draw2d_force)
                return;
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        if (pic)
        {
                if (width == 0)
@@ -1895,7 +1896,7 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags, qboolean hasalpha)
                return;
        DrawQ_ProcessDrawFlag(flags, hasalpha);
 
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        R_SetupShader_Generic(mesh->texture, NULL, GL_MODULATE, 1);
 
        R_Mesh_PrepareVertices_Generic_Arrays(mesh->num_vertices, mesh->data_vertex3f, mesh->data_color4f, mesh->data_texcoord2f);
@@ -1979,6 +1980,48 @@ void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, f
        }
 }
 
+void DrawQ_Lines (float width, int numlines, const float *vertex3f, const float *color4f, int flags)
+{
+       int i;
+       qboolean hasalpha = false;
+       for (i = 0;i < numlines*2;i++)
+               if (color4f[i*4+3] < 1.0f)
+                       hasalpha = true;
+
+       _DrawQ_SetupAndProcessDrawFlag(flags, NULL, hasalpha ? 0.5f : 1.0f);
+
+       if(!r_draw2d.integer && !r_draw2d_force)
+               return;
+
+       switch(vid.renderpath)
+       {
+       case RENDERPATH_GL11:
+       case RENDERPATH_GL13:
+       case RENDERPATH_GL20:
+       case RENDERPATH_CGGL:
+               CHECKGLERROR
+
+               R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1);
+
+               //qglLineWidth(width);CHECKGLERROR
+
+               CHECKGLERROR
+               R_Mesh_PrepareVertices_Generic_Arrays(numlines*2, vertex3f, color4f, NULL);
+               qglDrawArrays(GL_LINES, 0, numlines*2);
+               CHECKGLERROR
+               break;
+       case RENDERPATH_D3D9:
+               //Con_DPrintf("FIXME D3D9 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+               break;
+       case RENDERPATH_D3D10:
+               Con_DPrintf("FIXME D3D10 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+               break;
+       case RENDERPATH_D3D11:
+               Con_DPrintf("FIXME D3D11 %s:%i %s\n", __FILE__, __LINE__, __FUNCTION__);
+               break;
+       }
+}
+
 void DrawQ_SetClipArea(float x, float y, float width, float height)
 {
        int ix, iy, iw, ih;
@@ -2033,7 +2076,7 @@ void R_DrawGamma(void)
                break;
        }
        // all the blends ignore depth
-       R_Mesh_ResetTextureState();
+//     R_Mesh_ResetTextureState();
        R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1);
        GL_DepthMask(true);
        GL_DepthRange(0, 1);