added a firstvertex parameter to R_Mesh_DrawMesh
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 28 Mar 2005 12:33:25 +0000 (12:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 28 Mar 2005 12:33:25 +0000 (12:33 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5132 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c
gl_backend.c
gl_backend.h
gl_draw.c
gl_models.c
gl_rmain.c
gl_rsurf.c
r_explosion.c
r_lightning.c
r_shadow.c
r_sky.c

index 88ed492..3dba711 100644 (file)
@@ -2037,7 +2037,7 @@ void R_DrawParticleCallback(const void *calldata1, int calldata2)
        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
 }
 
index 36dbde8..cd1d482 100644 (file)
@@ -876,18 +876,18 @@ void GL_Backend_RenumberElements(int *out, int count, const int *in, int offset)
 
 // 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++;
@@ -898,13 +898,13 @@ void R_Mesh_Draw(int numverts, int numtriangles, const int *elements)
                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++)
@@ -914,15 +914,15 @@ void R_Mesh_Draw(int numverts, int numtriangles, const int *elements)
                                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;
                        }
                }
@@ -1014,7 +1014,7 @@ void R_Mesh_Draw(int numverts, int numtriangles, const int *elements)
                }
                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
@@ -1592,7 +1592,7 @@ void R_Mesh_State(const rmeshstate_t *m)
        }
 }
 
-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)
@@ -1817,7 +1817,7 @@ void SCR_UpdateLoadingScreen (void)
        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
index af6b5a6..e7517ac 100644 (file)
@@ -93,9 +93,9 @@ void R_Mesh_TexCombine(unsigned int unitnum, int combinergb, int combinealpha, i
 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);
index e861f11..0ab9c19 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -559,7 +559,7 @@ void R_DrawQueue(void)
                                        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];
@@ -571,7 +571,7 @@ void R_DrawQueue(void)
                        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;
@@ -585,7 +585,7 @@ void R_DrawQueue(void)
                                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:
@@ -631,7 +631,7 @@ void R_DrawQueue(void)
                        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);
                        }
                }
@@ -647,7 +647,7 @@ void R_DrawQueue(void)
                {
                        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);
                }
        }
 }
index 7e78b2e..f663486 100644 (file)
@@ -158,7 +158,7 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
        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;
@@ -188,7 +188,7 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
                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);
        }
 
@@ -216,7 +216,7 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
                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);
        }
 
@@ -233,7 +233,7 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
                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);
        }
 
@@ -247,7 +247,7 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
                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);
        }
 }
index c613c66..6cac87e 100644 (file)
@@ -661,14 +661,14 @@ static void R_BlendView(void)
                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;
                }
@@ -707,7 +707,7 @@ static void R_BlendView(void)
                        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);
@@ -742,7 +742,7 @@ static void R_BlendView(void)
                        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);
@@ -777,7 +777,7 @@ static void R_BlendView(void)
                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
@@ -790,7 +790,7 @@ static void R_BlendView(void)
                        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;
                }
@@ -803,7 +803,7 @@ static void R_BlendView(void)
                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);
        }
 }
 
@@ -1098,7 +1098,7 @@ void R_DrawNoModelCallback(const void *calldata1, int calldata2)
        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)
@@ -1176,6 +1176,6 @@ void R_DrawSprite(int blendfunc1, int blendfunc2, rtexture_t *texture, int depth
        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);
 }
 
index bc0047a..85db63d 100644 (file)
@@ -440,7 +440,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                        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);
@@ -493,7 +493,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                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);
@@ -528,7 +528,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                        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);
                }
 
@@ -633,7 +633,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                }
                                        }
                                        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);
                                }
                        }
@@ -722,7 +722,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                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);
                                        }
                                }
@@ -763,7 +763,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                }
                                                        }
                                                        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);
                                                }
                                        }
@@ -792,7 +792,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                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);
                                                }
                                        }
@@ -817,7 +817,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                        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);
                                }
                        }
@@ -833,7 +833,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                        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);
                                }
                        }
@@ -876,7 +876,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                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);
                                                }
                                        }
@@ -906,7 +906,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                }
                                                        }
                                                        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);
                                                }
                                        }
@@ -965,7 +965,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                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
@@ -996,7 +996,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                                }
                                                        }
                                                        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);
                                                }
                                        }
@@ -1018,7 +1018,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                        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);
                                }
                        }
@@ -1038,7 +1038,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                        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);
                                }
                        }
@@ -1088,7 +1088,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                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);
                        }
                }
@@ -1106,7 +1106,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                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);
                        }
                }
@@ -1160,7 +1160,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                }
                                        }
                                        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);
                                }
                        }
@@ -1189,7 +1189,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                                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);
                                }
                        }
@@ -1254,7 +1254,7 @@ static void R_DrawSurfaceList(const entity_render_t *ent, texture_t *texture, in
                                        }
                                }
                                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);
                        }
                }
@@ -1436,7 +1436,7 @@ static void R_DrawPortal_Callback(const void *calldata1, int calldata2)
                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);
 }
 
@@ -1474,7 +1474,7 @@ static void R_DrawCollisionBrush(colbrushf_t *brush)
        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);
 }
 
@@ -1490,7 +1490,7 @@ static void R_DrawCollisionSurface(entity_render_t *ent, msurface_t *surface)
        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);
 }
 
index a620177..800c910 100644 (file)
@@ -206,7 +206,7 @@ void R_DrawExplosionCallback(const void *calldata1, int calldata2)
        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);
 }
 
index 1f5f90c..639df83 100644 (file)
@@ -321,7 +321,7 @@ void R_DrawLightningBeamCallback(const void *calldata1, int calldata2)
 
        // 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);
 }
 
index 949c233..9575f9c 100644 (file)
@@ -917,14 +917,14 @@ void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *verte
                // 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);
@@ -1642,7 +1642,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                }
                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);
@@ -1797,7 +1797,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -1827,7 +1827,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                        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;
                        }
@@ -1868,7 +1868,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -1907,7 +1907,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -1924,7 +1924,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -1962,7 +1962,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2013,7 +2013,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2060,7 +2060,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2077,7 +2077,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2107,7 +2107,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                        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;
                        }
@@ -2136,7 +2136,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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;
@@ -2151,10 +2151,10 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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);
@@ -2172,7 +2172,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        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;
@@ -2210,7 +2210,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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;
@@ -2225,10 +2225,10 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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);
@@ -2263,7 +2263,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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;
@@ -2278,10 +2278,10 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        // 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);
@@ -2307,7 +2307,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                        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;
@@ -2336,7 +2336,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
                                }
@@ -2395,7 +2395,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2447,7 +2447,7 @@ void R_Shadow_RenderLighting(int numverts, int numtriangles, const int *elements
                                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;
@@ -2737,14 +2737,14 @@ void R_DrawRTLight(rtlight_t *rtlight, int visiblevolumes)
                                        // 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);
diff --git a/r_sky.c b/r_sky.c
index 3647a57..fa9c0df 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -283,7 +283,7 @@ static void R_SkyBox(void)
        {
                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);
 }
@@ -387,7 +387,7 @@ static void R_SkySphere(void)
                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
@@ -395,7 +395,7 @@ static void R_SkySphere(void)
                // 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);
@@ -403,7 +403,7 @@ static void R_SkySphere(void)
                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);
        }
 }