}
-static int blendviewpolyindex[3] = {0, 1, 2};
-
static void R_BlendView(void)
{
- rmeshinfo_t m;
- float tvxyz[3][4], r;
+ rmeshbufferinfo_t m;
+ float r;
if (r_refdef.viewblend[3] < 0.01f)
return;
m.depthdisable = true; // magic
m.numtriangles = 1;
m.numverts = 3;
- m.index = blendviewpolyindex;
- m.vertex = &tvxyz[0][0];
- m.vertexstep = sizeof(float[4]);
- m.cr = r_refdef.viewblend[0];
- m.cg = r_refdef.viewblend[1];
- m.cb = r_refdef.viewblend[2];
- m.ca = r_refdef.viewblend[3];
- r = 64000;
- tvxyz[0][0] = r_origin[0] + vpn[0] * 1.5 - vright[0] * r - vup[0] * r;
- tvxyz[0][1] = r_origin[1] + vpn[1] * 1.5 - vright[1] * r - vup[1] * r;
- tvxyz[0][2] = r_origin[2] + vpn[2] * 1.5 - vright[2] * r - vup[2] * r;
- r *= 3;
- tvxyz[1][0] = tvxyz[0][0] + vup[0] * r;
- tvxyz[1][1] = tvxyz[0][1] + vup[1] * r;
- tvxyz[1][2] = tvxyz[0][2] + vup[2] * r;
- tvxyz[2][0] = tvxyz[0][0] + vright[0] * r;
- tvxyz[2][1] = tvxyz[0][1] + vright[1] * r;
- tvxyz[2][2] = tvxyz[0][2] + vright[2] * r;
- R_Mesh_Draw(&m);
+ if (R_Mesh_Draw_GetBuffer(&m))
+ {
+ m.index[0] = 0;
+ m.index[1] = 1;
+ m.index[2] = 2;
+ m.color[0] = m.color[4] = m.color[8] = r_refdef.viewblend[0];
+ m.color[1] = m.color[5] = m.color[9] = r_refdef.viewblend[1];
+ m.color[2] = m.color[6] = m.color[10] = r_refdef.viewblend[2];
+ m.color[3] = m.color[7] = m.color[11] = r_refdef.viewblend[3];
+ r = 64000;
+ m.vertex[0] = r_origin[0] + vpn[0] * 1.5 - vright[0] * r - vup[0] * r;
+ m.vertex[1] = r_origin[1] + vpn[1] * 1.5 - vright[1] * r - vup[1] * r;
+ m.vertex[2] = r_origin[2] + vpn[2] * 1.5 - vright[2] * r - vup[2] * r;
+ r *= 3;
+ m.vertex[4] = m.vertex[0] + vup[0] * r;
+ m.vertex[5] = m.vertex[1] + vup[1] * r;
+ m.vertex[6] = m.vertex[2] + vup[2] * r;
+ m.vertex[8] = m.vertex[0] + vright[0] * r;
+ m.vertex[9] = m.vertex[1] + vright[1] * r;
+ m.vertex[10] = m.vertex[2] + vright[2] * r;
+ }
}
/*