- case DRAWQUEUE_PIC:
- str = (char *)(dq + 1);
- if (*str)
- {
- if (strcmp(str, currentpic))
- {
- if (batch)
- {
- batch = false;
- qglEnd();
- }
- currentpic = str;
- pic = Draw_CachePic(str);
- qglBindTexture(GL_TEXTURE_2D, R_GetTexture(pic->tex));
- }
- if (w == 0)
- w = pic->width;
- if (h == 0)
- h = pic->height;
- if (!batch)
- {
- batch = true;
- qglBegin(GL_TRIANGLES);
- batchcount = 0;
- }
- qglTexCoord2f (0, 0);qglVertex2f (x , y );
- qglTexCoord2f (1, 0);qglVertex2f (x+w, y );
- qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
- qglTexCoord2f (0, 0);qglVertex2f (x , y );
- qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
- qglTexCoord2f (0, 1);qglVertex2f (x , y+h);
- batchcount++;
- }
- else
- {
- if (currentpic[0])
- {
- if (batch)
- {
- batch = false;
- qglEnd();
- }
- currentpic = "";
- qglBindTexture(GL_TEXTURE_2D, 0);
- }
- if (!batch)
- {
- batch = true;
- qglBegin(GL_TRIANGLES);
- batchcount = 0;
- }
- qglTexCoord2f (0, 0);qglVertex2f (x , y );
- qglTexCoord2f (1, 0);qglVertex2f (x+w, y );
- qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
- qglTexCoord2f (0, 0);qglVertex2f (x , y );
- qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
- qglTexCoord2f (0, 1);qglVertex2f (x , y+h);
- batchcount++;
- }
- break;