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 48d4982..7de9f38 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;
        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);
        if (gl_supportslockarrays && gl_lockarrays.integer)
        {
                qglLockArraysEXT(firstvert, endvert - firstvert);