From 1584b69e04ea4dcd6042197b925f8d72127f5120 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 19 Aug 2009 08:29:31 +0000 Subject: [PATCH] fix glDrawRangeElements issue with mesa git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9131 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index 89b789c3..c0907b36 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -1279,7 +1279,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri GL_BindEBO(bufferobject3s); if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL) { - qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3]))); + qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3]))); CHECKGLERROR } else @@ -1293,7 +1293,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri GL_BindEBO(bufferobject3i); if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL) { - qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3]))); + qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3]))); CHECKGLERROR } else @@ -1307,7 +1307,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri GL_BindEBO(0); if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL) { - qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_SHORT, element3s); + qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_SHORT, element3s); CHECKGLERROR } else @@ -1321,7 +1321,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri GL_BindEBO(0); if (gl_mesh_drawrangeelements.integer && qglDrawRangeElements != NULL) { - qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices, numelements, GL_UNSIGNED_INT, element3i); + qglDrawRangeElements(GL_TRIANGLES, firstvertex, firstvertex + numvertices - 1, numelements, GL_UNSIGNED_INT, element3i); CHECKGLERROR } else -- 2.39.2