From 94e6c0fbd372468f1d1847781ffda085a61e10e8 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Fri, 3 May 2002 22:06:05 +0000 Subject: [PATCH] hopefully this fixes the problem in TNT drivers with the options menu (too much text in one batch) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1817 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_draw.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gl_draw.c b/gl_draw.c index a82e009e..edab967b 100644 --- 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; } -- 2.39.2