]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
fix severe (crashing) bugs with two calls to qglDrawElements when using
[xonotic/darkplaces.git] / 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
                                }
                        }