+ // go on and read normal text in until the next control char
+ while( len > 0 && *current != STRING_COLOR_TAG ) {
+ current++;
+ len--;
+ }
+ // display the text
+ if( start != current ) {
+ // draw the string
+ DrawQ_String( x, y, start, current - start, scalex, scaley, basered * color[0], basegreen * color[1], baseblue * color[2], basealpha * color[3], flags );
+ // update x to be at the new start position
+ x += (current - start) * scalex;
+ // set start accordingly
+ start = current;
+ }
+ }
+
+ // return the last colorindex
+ if( outcolor ) {
+ *outcolor = colorindex;
+ }
+}
+
+void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags)
+{
+ float floats[36];
+
+ if (!r_refdef.draw2dstage)
+ {
+ Con_Printf("DrawQ_SuperPic: not in 2d rendering stage!\n");
+ return;
+ }
+
+ _DrawQ_ProcessDrawFlag(flags);
+
+ R_Mesh_VertexPointer(floats);
+ R_Mesh_ColorPointer(floats + 20);
+ R_Mesh_ResetTextureState();
+ if (pic)
+ {
+ if (width == 0)
+ width = pic->width;
+ if (height == 0)
+ height = pic->height;
+ R_Mesh_TexBind(0, R_GetTexture(pic->tex));
+ R_Mesh_TexCoordPointer(0, 2, floats + 12);
+ floats[12] = s1;floats[13] = t1;
+ floats[14] = s2;floats[15] = t2;
+ floats[16] = s4;floats[17] = t4;
+ floats[18] = s3;floats[19] = t3;
+ }
+
+ floats[2] = floats[5] = floats[8] = floats[11] = 0;
+ floats[0] = floats[9] = x;
+ floats[1] = floats[4] = y;
+ floats[3] = floats[6] = x + width;
+ floats[7] = floats[10] = y + height;
+ floats[20] = r1;floats[21] = g1;floats[22] = b1;floats[23] = a1;
+ floats[24] = r2;floats[25] = g2;floats[26] = b2;floats[27] = a2;
+ floats[28] = r4;floats[29] = g4;floats[30] = b4;floats[31] = a4;
+ floats[32] = r3;floats[33] = g3;floats[34] = b3;floats[35] = a3;
+
+ R_Mesh_Draw(0, 4, 2, polygonelements);
+}
+
+void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
+{
+ if (!r_refdef.draw2dstage)
+ {
+ Con_Printf("DrawQ_Mesh: not in 2d rendering stage!\n");
+ return;
+ }
+
+ _DrawQ_ProcessDrawFlag(flags);
+
+ R_Mesh_VertexPointer(mesh->data_vertex3f);
+ R_Mesh_ColorPointer(mesh->data_color4f);
+ R_Mesh_ResetTextureState();
+ R_Mesh_TexBind(0, R_GetTexture(mesh->texture));
+ R_Mesh_TexCoordPointer(0, 2, mesh->data_texcoord2f);
+
+ GL_LockArrays(0, mesh->num_vertices);
+ R_Mesh_Draw(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
+ GL_LockArrays(0, 0);
+}
+
+void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags)
+{
+ int num;
+
+ if (!r_refdef.draw2dstage)
+ {
+ Con_Printf("DrawQ_LineLoop: not in 2d rendering stage!\n");
+ return;
+ }
+
+ _DrawQ_ProcessDrawFlag(flags);
+
+ GL_Color(1,1,1,1);
+ CHECKGLERROR
+ qglBegin(GL_LINE_LOOP);
+ for (num = 0;num < mesh->num_vertices;num++)
+ {
+ if (mesh->data_color4f)
+ GL_Color(mesh->data_color4f[num*4+0], mesh->data_color4f[num*4+1], mesh->data_color4f[num*4+2], mesh->data_color4f[num*4+3]);
+ qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]);
+ }
+ qglEnd();
+ CHECKGLERROR
+}
+
+//LordHavoc: FIXME: this is nasty!
+void DrawQ_LineWidth (float width)
+{
+ if (!r_refdef.draw2dstage)
+ {
+ Con_Printf("DrawQ_LineWidth: not in 2d rendering stage!\n");
+ return;