glTexCoord2f(particle_texcoord2f[6], particle_texcoord2f[7]);glVertex3f(particle_vertex3f[ 9], particle_vertex3f[10], particle_vertex3f[11]);
glEnd();
#else
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
#endif
}
// renders triangles using vertices from the active arrays
int paranoidblah = 0;
-void R_Mesh_Draw(int numverts, int numtriangles, const int *elements)
+void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *elements)
{
unsigned int numelements = numtriangles * 3;
- if (numverts == 0 || numtriangles == 0)
+ if (numvertices < 3 || numtriangles < 1)
{
- Con_Printf("R_Mesh_Draw(%d, %d, %08p);\n", numverts, numtriangles, elements);
+ Con_Printf("R_Mesh_Draw(%d, %d, %d, %08p);\n", firstvertex, numvertices, numtriangles, elements);
return;
}
//CHECKGLERROR
if (r_showtrispass)
{
- R_Mesh_Draw_ShowTris(numverts, numtriangles, elements);
+ R_Mesh_Draw_ShowTris(firstvertex, numvertices, numtriangles, elements);
return;
}
c_meshs++;
const int *p;
if (!qglIsEnabled(GL_VERTEX_ARRAY))
Con_Print("R_Mesh_Draw: vertex array not enabled\n");
- for (j = 0, size = numverts * (int)sizeof(float[3]), p = gl_state.pointer_vertex;j < size;j += sizeof(int), p++)
+ for (j = 0, size = numvertices * 3, p = gl_state.pointer_vertex + firstvertex * 3;j < size;j++, p++)
paranoidblah += *p;
if (gl_state.pointer_color)
{
if (!qglIsEnabled(GL_COLOR_ARRAY))
Con_Print("R_Mesh_Draw: color array set but not enabled\n");
- for (j = 0, size = numverts * (int)sizeof(float[4]), p = gl_state.pointer_color;j < size;j += sizeof(int), p++)
+ for (j = 0, size = numvertices * 4, p = gl_state.pointer_color + firstvertex * 4;j < size;j++, p++)
paranoidblah += *p;
}
for (i = 0;i < backendarrayunits;i++)
GL_ClientActiveTexture(i);
if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY))
Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n");
- for (j = 0, size = numverts * ((gl_state.units[i].t3d || gl_state.units[i].tcubemap) ? (int)sizeof(float[3]) : (int)sizeof(float[2])), p = gl_state.units[i].pointer_texcoord;j < size;j += sizeof(int), p++)
+ for (j = 0, size = numvertices * gl_state.units[i].arraycomponents, p = gl_state.units[i].pointer_texcoord + firstvertex * gl_state.units[i].arraycomponents;j < size;j++, p++)
paranoidblah += *p;
}
}
for (i = 0;i < (unsigned int) numtriangles * 3;i++)
{
- if (elements[i] < 0 || elements[i] >= numverts)
+ if (elements[i] < firstvertex || elements[i] >= firstvertex + numvertices)
{
- Con_Printf("R_Mesh_Draw: invalid vertex index %i (outside range 0 - %i) in elements list\n", elements[i], numverts);
+ Con_Printf("R_Mesh_Draw: invalid vertex index %i (outside range %i - %i) in elements list\n", elements[i], firstvertex, firstvertex + numvertices);
return;
}
}
}
else if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL)
{
- qglDrawRangeElements(GL_TRIANGLES, 0, numverts, numelements, GL_UNSIGNED_INT, elements);
+ qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_INT, elements);
CHECKGLERROR
}
else
}
}
-void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, const int *elements)
+void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, const int *elements)
{
qglBegin(GL_LINES);
for (;numtriangles;numtriangles--, elements += 3)
varray_texcoord2f[0][4] = 1;varray_texcoord2f[0][5] = 1;
varray_texcoord2f[0][6] = 0;varray_texcoord2f[0][7] = 1;
GL_LockArrays(0, 4);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
GL_LockArrays(0, 0);
R_Mesh_Finish();
// refresh
void R_Mesh_State(const rmeshstate_t *m);
// renders a mesh
-void R_Mesh_Draw(int numverts, int numtriangles, const int *elements);
+void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *elements);
// renders a mesh as lines
-void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, const int *elements);
+void R_Mesh_Draw_ShowTris(int firstvertex, int numvertices, int numtriangles, const int *elements);
// saves a section of the rendered frame to a .tga or .jpg file
qboolean SCR_ScreenShot(char *filename, qbyte *buffer1, qbyte *buffer2, qbyte *buffer3, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg);
if (batchcount >= 128)
{
GL_LockArrays(0, batchcount * 4);
- R_Mesh_Draw(batchcount * 4, batchcount * 2, quadelements);
+ R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements);
GL_LockArrays(0, 0);
batchcount = 0;
at = varray_texcoord2f[0];
if (batchcount > 0)
{
GL_LockArrays(0, batchcount * 4);
- R_Mesh_Draw(batchcount * 4, batchcount * 2, quadelements);
+ R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements);
GL_LockArrays(0, 0);
}
break;
m.pointer_texcoord[0] = NULL;
R_Mesh_State(&m);
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
break;
case DRAWQUEUE_SETCLIP:
while (c[0] >= 1.01f || c[1] >= 1.01f || c[2] >= 1.01f)
{
GL_Color(bound(0, c[0] - 1, 1), bound(0, c[1] - 1, 1), bound(0, c[2] - 1, 1), 1);
- R_Mesh_Draw(3, 1, polygonelements);
+ R_Mesh_Draw(0, 3, 1, polygonelements);
VectorScale(c, 0.5, c);
}
}
{
GL_BlendFunc(GL_ONE, GL_ONE);
GL_Color(c[0], c[1], c[2], 1);
- R_Mesh_Draw(3, 1, polygonelements);
+ R_Mesh_Draw(0, 3, 1, polygonelements);
}
}
}
R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
m.tex[1] = 0;
m.pointer_texcoord[1] = NULL;
R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
}
R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
}
R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
}
R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
GL_LockArrays(0, mesh->num_vertices);
- R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_LockArrays(0, 0);
}
}
qglViewport(r_view_x, vid.realheight - (r_view_y + bloomheight), bloomwidth, bloomheight);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1, 1, 1, 1);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += bloomwidth * bloomheight;
// render multiple times with a multiply blendfunc to raise to a power
GL_BlendFunc(GL_DST_COLOR, GL_ZERO);
for (x = 1;x < r_bloom_power.integer;x++)
{
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += bloomwidth * bloomheight;
}
if (r < 0.01f)
continue;
GL_Color(r, r, r, 1);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += bloomwidth * bloomheight;
GL_BlendFunc(GL_ONE, GL_ONE);
if (r < 0.01f)
continue;
GL_Color(r, r, r, 1);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += bloomwidth * bloomheight;
GL_BlendFunc(GL_ONE, GL_ONE);
R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1,1,1,1);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += r_view_width * r_view_height;
// now blend on the bloom texture if multipass
R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ONE);
GL_Color(1,1,1,1);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
c_bloomdraws++;
c_bloomdrawpixels += r_view_width * r_view_height;
}
R_Mesh_State(&m);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_Color(r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
}
}
else
m.pointer_color = nomodelcolor4f;
R_Mesh_State(&m);
- R_Mesh_Draw(6, 8, nomodelelements);
+ R_Mesh_Draw(0, 6, 8, nomodelelements);
}
void R_DrawNoModel(entity_render_t *ent)
m.pointer_vertex = varray_vertex3f;
R_Mesh_State(&m);
GL_Color(cr, cg, cb, ca);
- R_Mesh_Draw(4, 2, polygonelements);
+ R_Mesh_Draw(0, 4, 2, polygonelements);
}
R_Mesh_ColorPointer(surface->lightmaptexture ? NULL : (surface->groupmesh->data_lightmapcolor4f + 4 * surface->num_firstvertex));
R_Mesh_VertexPointer((surface->groupmesh->data_vertex3f + 3 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
qglEnable(GL_CULL_FACE);
surface = texturesurfacelist[texturesurfaceindex];
R_Mesh_VertexPointer((surface->groupmesh->data_vertex3f + 3 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
R_Mesh_TexCoordPointer(0, 2, (surface->groupmesh->data_texcoordtexture2f + 2 * surface->num_firstvertex));
R_Mesh_TexCoordPointer(1, 2, (surface->groupmesh->data_texcoordtexture2f + 2 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
c[3] = a;
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
GL_Color(r, g, b, a);
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_VertexPointer(RSurf_GetVertexPointer(ent, texture, surface, modelorg));
R_Mesh_TexCoordPointer(0, 2, (surface->groupmesh->data_texcoordtexture2f + 2 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
surface = texturesurfacelist[texturesurfaceindex];
R_Mesh_VertexPointer(RSurf_GetVertexPointer(ent, texture, surface, modelorg));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_ColorPointer((surface->groupmesh->data_lightmapcolor4f + 4 * surface->num_firstvertex));
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_ColorPointer((surface->groupmesh->data_lightmapcolor4f + 4 * surface->num_firstvertex));
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
#endif
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_TexCoordPointer(0, 2, (surface->groupmesh->data_texcoordlightmap2f + 2 * surface->num_firstvertex));
R_Mesh_ColorPointer(surface->lightmaptexture ? NULL : (surface->groupmesh->data_lightmapcolor4f + 4 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_VertexPointer(RSurf_GetVertexPointer(ent, texture, surface, modelorg));
R_Mesh_TexCoordPointer(0, 2, (surface->groupmesh->data_texcoordtexture2f + 2 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
c[3] = a;
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
R_Mesh_VertexPointer(RSurf_GetVertexPointer(ent, texture, surface, modelorg));
R_Mesh_TexCoordPointer(0, 2, (surface->groupmesh->data_texcoorddetail2f + 2 * surface->num_firstvertex));
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
GL_Color(r, g, b, a);
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
}
}
GL_LockArrays(0, surface->num_vertices);
- R_Mesh_Draw(surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+ R_Mesh_Draw(0, surface->num_vertices, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
GL_LockArrays(0, 0);
}
}
for (i = 0, v = varray_vertex3f;i < portal->numpoints;i++, v += 3)
VectorCopy(portal->points[i].position, v);
GL_LockArrays(0, portal->numpoints);
- R_Mesh_Draw(portal->numpoints, portal->numpoints - 2, polygonelements);
+ R_Mesh_Draw(0, portal->numpoints, portal->numpoints - 2, polygonelements);
GL_LockArrays(0, 0);
}
i = (int)(((size_t)brush) / sizeof(colbrushf_t));
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_LockArrays(0, brush->numpoints);
- R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
+ R_Mesh_Draw(0, brush->numpoints, brush->numtriangles, brush->elements);
GL_LockArrays(0, 0);
}
i = (int)(((size_t)surface) / sizeof(msurface_t));
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_LockArrays(0, surface->num_collisionvertices);
- R_Mesh_Draw(surface->num_collisionvertices, surface->num_collisiontriangles, surface->data_collisionelement3i);
+ R_Mesh_Draw(0, surface->num_collisionvertices, surface->num_collisiontriangles, surface->data_collisionelement3i);
GL_LockArrays(0, 0);
}
GL_Color(alpha, alpha, alpha, 1);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, explosiontris[0]);
+ R_Mesh_Draw(0, numverts, numtriangles, explosiontris[0]);
GL_LockArrays(0, 0);
}
// draw the 3 polygons as one batch of 6 triangles using the 12 vertices
GL_LockArrays(0, 12);
- R_Mesh_Draw(12, 6, r_lightningbeamelements);
+ R_Mesh_Draw(0, 12, 6, r_lightningbeamelements);
GL_LockArrays(0, 0);
}
// increment stencil if backface is behind depthbuffer
qglCullFace(GL_BACK); // quake is backwards, this culls front faces
qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
- R_Mesh_Draw(numvertices, numtriangles, element3i);
+ R_Mesh_Draw(0, numvertices, numtriangles, element3i);
c_rt_shadowmeshes++;
c_rt_shadowtris += numtriangles;
// decrement stencil if frontface is behind depthbuffer
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
}
- R_Mesh_Draw(numvertices, numtriangles, element3i);
+ R_Mesh_Draw(0, numvertices, numtriangles, element3i);
c_rt_shadowmeshes++;
c_rt_shadowtris += numtriangles;
GL_LockArrays(0, 0);
}
CHECKGLERROR
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_LockArrays(0, 0);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
}
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
}
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
// 0.5 * 0.5 = 0.25 (done by the BlendFunc earlier)
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_LockArrays(0, 0);
R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
// 0.5 * 0.5 = 0.25 (done by the BlendFunc earlier)
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_LockArrays(0, 0);
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
// 0.5 * 0.5 = 0.25 (done by the BlendFunc earlier)
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
GL_LockArrays(0, 0);
R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
}
else
R_Shadow_VertexNoShadingWithXYZAttenuation(numverts, vertex3f, color, matrix_modeltolight);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
else
R_Shadow_VertexShadingWithXYZAttenuation(numverts, vertex3f, normal3f, color, matrix_modeltolight);
GL_LockArrays(0, numverts);
- R_Mesh_Draw(numverts, numtriangles, elements);
+ R_Mesh_Draw(0, numverts, numtriangles, elements);
GL_LockArrays(0, 0);
c_rt_lightmeshes++;
c_rt_lighttris += numtriangles;
// increment stencil if backface is behind depthbuffer
qglCullFace(GL_BACK); // quake is backwards, this culls front faces
qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
- R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
+ R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
c_rtcached_shadowmeshes++;
c_rtcached_shadowtris += mesh->numtriangles;
// decrement stencil if frontface is behind depthbuffer
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
}
- R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
+ R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
c_rtcached_shadowmeshes++;
c_rtcached_shadowtris += mesh->numtriangles;
GL_LockArrays(0, 0);
{
m.tex[0] = R_GetTexture(skyboxside[i]);
R_Mesh_State(&m);
- R_Mesh_Draw(6*4, 2, skyboxelements + i * 6);
+ R_Mesh_Draw(0, 6*4, 2, skyboxelements + i * 6);
}
GL_LockArrays(0, 0);
}
m.texmatrix[1] = scroll2matrix;
R_Mesh_State(&m);
GL_LockArrays(0, skysphere_numverts);
- R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
+ R_Mesh_Draw(0, skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
GL_LockArrays(0, 0);
}
else
// two pass
R_Mesh_State(&m);
GL_LockArrays(0, skysphere_numverts);
- R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
+ R_Mesh_Draw(0, skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
GL_LockArrays(0, 0);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
m.texmatrix[0] = scroll2matrix;
R_Mesh_State(&m);
GL_LockArrays(0, skysphere_numverts);
- R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
+ R_Mesh_Draw(0, skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
GL_LockArrays(0, 0);
}
}