]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
hopefully this fixes the problem in TNT drivers with the options menu (too much text...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 3 May 2002 22:06:05 +0000 (22:06 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 3 May 2002 22:06:05 +0000 (22:06 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1817 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index a82e009ee8bb0e671a47fdd39f38f56e664a6625..edab967b5fb20906241d0af485264c2e827e052a 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -308,7 +308,7 @@ void R_DrawQueue(void)
        cachepic_t *pic;
        drawqueue_t *dq;
        char *str, *currentpic;
-       int batch, additive;
+       int batch, batchcount, additive;
        unsigned int color;
 
        if (!r_render.integer)
@@ -359,6 +359,7 @@ void R_DrawQueue(void)
 
        overbright = v_overbrightbits.integer;
        batch = false;
+       batchcount = 0;
        for (pos = 0;pos < r_refdef.drawqueuesize;pos += ((drawqueue_t *)(r_refdef.drawqueue + pos))->size)
        {
                dq = (drawqueue_t *)(r_refdef.drawqueue + pos);
@@ -393,6 +394,11 @@ void R_DrawQueue(void)
                        color = dq->color;
                        glColor4ub((qbyte)(((color >> 24) & 0xFF) >> overbright), (qbyte)(((color >> 16) & 0xFF) >> overbright), (qbyte)(((color >> 8) & 0xFF) >> overbright), (qbyte)(color & 0xFF));
                }
+               if (batch && batchcount > 128)
+               {
+                       batch = false;
+                       glEnd();
+               }
                x = dq->x;
                y = dq->y;
                w = dq->scalex;
@@ -422,12 +428,14 @@ void R_DrawQueue(void)
                                {
                                        batch = true;
                                        glBegin(GL_QUADS);
+                                       batchcount = 0;
                                }
                                //DrawQuad(dq->x, dq->y, w, h, 0, 0, 1, 1);
                                glTexCoord2f (0, 0);glVertex2f (x  , y  );
                                glTexCoord2f (1, 0);glVertex2f (x+w, y  );
                                glTexCoord2f (1, 1);glVertex2f (x+w, y+h);
                                glTexCoord2f (0, 1);glVertex2f (x  , y+h);
+                               batchcount++;
                        }
                        else
                        {
@@ -445,12 +453,14 @@ void R_DrawQueue(void)
                                {
                                        batch = true;
                                        glBegin(GL_QUADS);
+                                       batchcount = 0;
                                }
                                //DrawQuad(dq->x, dq->y, dq->scalex, dq->scaley, 0, 0, 1, 1);
                                glTexCoord2f (0, 0);glVertex2f (x  , y  );
                                glTexCoord2f (1, 0);glVertex2f (x+w, y  );
                                glTexCoord2f (1, 1);glVertex2f (x+w, y+h);
                                glTexCoord2f (0, 1);glVertex2f (x  , y+h);
+                               batchcount++;
                        }
                        break;
                case DRAWQUEUE_STRING:
@@ -469,6 +479,7 @@ void R_DrawQueue(void)
                        {
                                batch = true;
                                glBegin(GL_QUADS);
+                               batchcount = 0;
                        }
                        while ((num = *str++) && x < vid.conwidth)
                        {
@@ -483,6 +494,7 @@ void R_DrawQueue(void)
                                        glTexCoord2f (s+u, t  );glVertex2f (x+w, y  );
                                        glTexCoord2f (s+u, t+v);glVertex2f (x+w, y+h);
                                        glTexCoord2f (s  , t+v);glVertex2f (x  , y+h);
+                                       batchcount++;
                                }
                                x += w;
                        }