]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix severe (crashing) bugs with two calls to qglDrawElements when using
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Jun 2013 06:20:52 +0000 (06:20 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 27 Jun 2013 17:31:25 +0000 (19:31 +0200)
index buffers (this bug was hidden by gl_mesh_drawrangeelements being 1
by default)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11961 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=48aa8723e4e82f2329a6053f95075af8cbf37444

gl_backend.c

index 81e71c3b2ab7c273ba30e64575a0cb15a3bbe892..a03060c1d33ca4f4b97f38f4e8eba2ba3ab347e7 100644 (file)
@@ -3112,7 +3112,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                                else
 #endif
                                {
-                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_SHORT, (void *)(firsttriangle * sizeof(unsigned short[3])));
+                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_SHORT, (void *)bufferoffset3s);
                                        CHECKGLERROR
                                }
                        }
@@ -3128,7 +3128,7 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                                else
 #endif
                                {
-                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_INT, (void *)(firsttriangle * sizeof(unsigned int[3])));
+                                       qglDrawElements(GL_TRIANGLES, numelements, GL_UNSIGNED_INT, (void *)bufferoffset3i);
                                        CHECKGLERROR
                                }
                        }