X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=gl_draw.c;h=32d736fa84c7bf4f06352647a7ff4d0b1acaed84;hb=02ca98a2932d9a8963eb96f27453f672cd71947e;hp=7fec01f1943baacbd0b028d2158cd41c5be61868;hpb=c9eef8bd881a5a38f9b2c0ff764a12fcb0062734;p=xonotic%2Fdarkplaces.git diff --git a/gl_draw.c b/gl_draw.c index 7fec01f1..32d736fa 100644 --- 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); @@ -1858,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) @@ -1896,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); @@ -1980,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; @@ -2034,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);