]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
GL_DrawRangeElements now reports if it got a bogus indexcount and vertex range
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Oct 2002 14:43:11 +0000 (14:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Oct 2002 14:43:11 +0000 (14:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2508 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 48d49829a25568c44ae6f9df4920cfbc9996fcdb..7de9f388d5261e6c7b175632c5599ff9941e7c5b 100644 (file)
@@ -449,6 +449,11 @@ void GL_DrawRangeElements(int firstvert, int endvert, int indexcount, int *index
        int arraylocked = false;
        c_meshs++;
        c_meshelements += indexcount;
+       if (indexcount == 0 || endvert == firstvert)
+       {
+               Con_Printf("GL_DrawRangeElements(%d, %d, %d, %08p);\n", firstvert, endvert, indexcount, index);
+               return;
+       }
        if (gl_supportslockarrays && gl_lockarrays.integer)
        {
                qglLockArraysEXT(firstvert, endvert - firstvert);