- rmeshbufferinfo_t m;
- float diff[3];
-
- if (fogenabled)
- {
- VectorSubtract(origin, r_origin, diff);
- ca *= 1 - exp(fogdensity/DotProduct(diff,diff));
- }
-
- memset(&m, 0, sizeof(m));
- m.transparent = false;
- m.blendfunc1 = GL_SRC_ALPHA;
- m.blendfunc2 = GL_ONE;
- m.depthdisable = true;
- m.numtriangles = 2;
- m.numverts = 4;
- m.tex[0] = R_GetTexture(texture);
- if (R_Mesh_Draw_GetBuffer(&m, false))
- {
- m.index[0] = 0;
- m.index[1] = 1;
- m.index[2] = 2;
- m.index[3] = 0;
- m.index[4] = 2;
- m.index[5] = 3;
- m.color[0] = m.color[4] = m.color[8] = m.color[12] = cr * m.colorscale;
- m.color[1] = m.color[5] = m.color[9] = m.color[13] = cg * m.colorscale;
- m.color[2] = m.color[6] = m.color[10] = m.color[14] = cb * m.colorscale;
- m.color[3] = m.color[7] = m.color[11] = m.color[15] = ca;
- m.texcoords[0][0] = 0;
- m.texcoords[0][1] = 0;
- m.texcoords[0][2] = 0;
- m.texcoords[0][3] = 1;
- m.texcoords[0][4] = 1;
- m.texcoords[0][5] = 1;
- m.texcoords[0][6] = 1;
- m.texcoords[0][7] = 0;
- m.vertex[0] = origin[0] - vright[0] * scale - vup[0] * scale;
- m.vertex[1] = origin[1] - vright[1] * scale - vup[1] * scale;
- m.vertex[2] = origin[2] - vright[2] * scale - vup[2] * scale;
- m.vertex[4] = origin[0] - vright[0] * scale + vup[0] * scale;
- m.vertex[5] = origin[1] - vright[1] * scale + vup[1] * scale;
- m.vertex[6] = origin[2] - vright[2] * scale + vup[2] * scale;
- m.vertex[8] = origin[0] + vright[0] * scale + vup[0] * scale;
- m.vertex[9] = origin[1] + vright[1] * scale + vup[1] * scale;
- m.vertex[10] = origin[2] + vright[2] * scale + vup[2] * scale;
- m.vertex[12] = origin[0] + vright[0] * scale - vup[0] * scale;
- m.vertex[13] = origin[1] + vright[1] * scale - vup[1] * scale;
- m.vertex[14] = origin[2] + vright[2] * scale - vup[2] * scale;
- R_Mesh_Render();
- }
-}
-
-void R_DrawCrosshair(void)
-{
- int i, num;