-void DrawQ_String_Real(float x, float y, const char *string, int maxlen, float w, float h, float red, float green, float blue, float alpha, int flags)
-{
- int i, num;
- float *av, *at;
- int batchcount;
- float vertex3f[QUADELEMENTS_MAXQUADS*4*3];
- float texcoord2f[QUADELEMENTS_MAXQUADS*4*2];
-
- if (!r_refdef.draw2dstage)
- {
- Con_Printf("DrawQ_String: not in 2d rendering stage!\n");
- return;
- }
-
- if (alpha < (1.0f / 255.0f))
- return;
-
- _DrawQ_ProcessDrawFlag(flags);
-
- GL_Color(red, green, blue, alpha);
-
- R_Mesh_VertexPointer(vertex3f);
- R_Mesh_ColorPointer(NULL);
- R_Mesh_ResetTextureState();
- R_Mesh_TexBind(0, R_GetTexture(char_texture));
- R_Mesh_TexCoordPointer(0, 2, texcoord2f);
-
- at = texcoord2f;
- av = vertex3f;
- batchcount = 0;
-
- if (maxlen < 1)
- maxlen = 9999;
- for (i = 0;i < maxlen && x < vid_conwidth.integer && (num = string[i]);i++, x += w)
- {
- float s, t, u, v;
- if (num == ' ')
- continue;
- s = (num & 15)*0.0625f + (0.5f / 256.0f);
- t = (num >> 4)*0.0625f + (0.5f / 256.0f);
- u = 0.0625f - (1.0f / 256.0f);
- v = 0.0625f - (1.0f / 256.0f);
- at[ 0] = s ;at[ 1] = t ;
- at[ 2] = s+u;at[ 3] = t ;
- at[ 4] = s+u;at[ 5] = t+v;
- at[ 6] = s ;at[ 7] = t+v;
- av[ 0] = x ;av[ 1] = y ;av[ 2] = 10;
- av[ 3] = x+w;av[ 4] = y ;av[ 5] = 10;
- av[ 6] = x+w;av[ 7] = y+h;av[ 8] = 10;
- av[ 9] = x ;av[10] = y+h;av[11] = 10;
- at += 8;
- av += 12;
- batchcount++;
- if (batchcount >= QUADELEMENTS_MAXQUADS)
- {
- GL_LockArrays(0, batchcount * 4);
- R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements);
- GL_LockArrays(0, 0);
- batchcount = 0;
- at = texcoord2f;
- av = vertex3f;
- }
- }
- if (batchcount > 0)
- {
- GL_LockArrays(0, batchcount * 4);
- R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements);
- GL_LockArrays(0, 0);
- }
-}
-
-void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags)
-{
- if (!r_refdef.draw2dstage)
- {
- Con_Printf("DrawQ_String: not in 2d rendering stage!\n");
- return;
- }
-
- if (r_textshadow.integer)
- DrawQ_String_Real(x+scalex*0.25,y+scaley*0.25,string,maxlen,scalex,scaley,0,0,0,alpha*0.8,flags);
-
- DrawQ_String_Real(x,y,string,maxlen,scalex,scaley,red,green,blue,alpha,flags);
-}
-