From 400eea51c1057da42bbb1a5f92dae7625fff44f7 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 18 Apr 2007 05:33:17 +0000 Subject: [PATCH] changed r_textshadow behavior to always draw a black shadow, but with alpha dependent on the brightness of the primary text color, this means you don't get white shadows under black text, but do get black shadows under white text rewrote DrawQ_String and friends to be one combined function that draws colored strings more efficiently by batching characters with differing colors together, and it even batches the shadow with the text which can help performance significantly with r_textshadow on git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7119 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 30 ++++-- console.c | 12 +-- draw.h | 11 +- gl_draw.c | 304 +++++++++++++++++++++++++--------------------------- menu.c | 12 +-- prvm_cmds.c | 4 +- r_shadow.c | 32 +++--- sbar.c | 38 +++---- todo | 2 +- 9 files changed, 225 insertions(+), 220 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 6958e16d..72f62e30 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -148,7 +148,7 @@ void SCR_DrawCenterString (void) { if (remaining < l) l = remaining; - DrawQ_ColoredString(x, y, start, l, 8, 8, 1, 1, 1, 1, 0, &color); + DrawQ_String(x, y, start, l, 8, 8, 1, 1, 1, 1, 0, &color, false); remaining -= l; if (remaining <= 0) return; @@ -188,10 +188,6 @@ void SCR_CheckDrawCenterString (void) void SCR_DrawNetGraph_DrawGraph (int graphx, int graphy, int barwidth, int barheight, int bardivide, const char *label, float textsize, int packetcounter, int numparameters, const int **parameters, const float parametercolors[][4]) { int j, k, x, y, index, offset, height; - // dim background - DrawQ_Pic (graphx, graphy, NULL, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); - // draw a label - DrawQ_String (graphx, graphy + barheight, label, 0, textsize, textsize, 1, 1, 1, 1, 0); // draw the bar graph itself for (j = 0;j < NETGRAPH_PACKETS;j++) { @@ -228,6 +224,10 @@ void SCR_DrawNetGraph_DrawConnection_Client (netconn_t *conn, int graphx, int gr { int numparameters; const int *parameters[3]; + // dim background + DrawQ_Pic (graphx , graphy, NULL, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + DrawQ_Pic (graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, NULL, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + // draw the bar graphs numparameters = 3; parameters[0] = conn->incoming_unreliablesize; parameters[1] = conn->incoming_reliablesize; @@ -237,21 +237,31 @@ void SCR_DrawNetGraph_DrawConnection_Client (netconn_t *conn, int graphx, int gr parameters[1] = conn->outgoing_reliablesize; parameters[2] = conn->outgoing_acksize; SCR_DrawNetGraph_DrawGraph(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth, barheight, bardivide, labeloutgoing, textsize, conn->outgoing_packetcounter, numparameters, parameters, netgraphcolors); + // draw labels + DrawQ_String(graphx , graphy + barheight, labelincoming, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false); + DrawQ_String(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy + barheight, labeloutgoing, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false); } void SCR_DrawNetGraph_DrawConnection_Server (netconn_t *conn, int graphx, int graphy, int barwidth, int barheight, int bardivide, const char *labeloutgoing, int separator, const char *labelincoming, float textsize) { int numparameters; const int *parameters[3]; + // dim background + DrawQ_Pic (graphx , graphy, NULL, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + DrawQ_Pic (graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, NULL, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + // draw the bar graphs numparameters = 3; parameters[0] = conn->outgoing_unreliablesize; parameters[1] = conn->outgoing_reliablesize; parameters[2] = conn->outgoing_acksize; - SCR_DrawNetGraph_DrawGraph(graphx, graphy, barwidth, barheight, bardivide, labeloutgoing, textsize, conn->outgoing_packetcounter, numparameters, parameters, netgraphcolors); + SCR_DrawNetGraph_DrawGraph(graphx , graphy, barwidth, barheight, bardivide, labeloutgoing, textsize, conn->outgoing_packetcounter, numparameters, parameters, netgraphcolors); parameters[0] = conn->incoming_unreliablesize; parameters[1] = conn->incoming_reliablesize; parameters[2] = conn->incoming_acksize; SCR_DrawNetGraph_DrawGraph(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth, barheight, bardivide, labelincoming, textsize, conn->incoming_packetcounter, numparameters, parameters, netgraphcolors); + // draw labels + DrawQ_String(graphx , graphy + barheight, labeloutgoing, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false); + DrawQ_String(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy + barheight, labelincoming, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false); } /* @@ -455,7 +465,7 @@ static int SCR_DrawQWDownload(int offset) x = (vid_conwidth.integer - len*size) / 2; y = vid_conheight.integer - size - offset; DrawQ_Pic(0, y, NULL, vid_conwidth.integer, size, 0, 0, 0, 0.5, 0); - DrawQ_String(x, y, temp, len, size, size, 1, 1, 1, 1, 0); + DrawQ_String(x, y, temp, len, size, size, 1, 1, 1, 1, 0, NULL, true); return 8; } @@ -486,7 +496,7 @@ static int SCR_DrawCurlDownload(int offset) len = (int)strlen(addinfo); x = (vid_conwidth.integer - len*size) / 2; DrawQ_Pic(0, y - size, NULL, vid_conwidth.integer, size, 1, 1, 1, 0.8, 0); - DrawQ_String(x, y - size, addinfo, len, size, size, 0, 0, 0, 1, 0); + DrawQ_String(x, y - size, addinfo, len, size, size, 0, 0, 0, 1, 0, NULL, true); } for(i = 0; i != nDownloads; ++i) @@ -500,7 +510,7 @@ static int SCR_DrawCurlDownload(int offset) len = (int)strlen(temp); x = (vid_conwidth.integer - len*size) / 2; DrawQ_Pic(0, y + i * size, NULL, vid_conwidth.integer, size, 0, 0, 0, 0.8, 0); - DrawQ_String(x, y + i * size, temp, len, size, size, 1, 1, 1, 1, 0); + DrawQ_String(x, y + i * size, temp, len, size, size, 1, 1, 1, 1, 0, NULL, true); } Z_Free(downinfo); @@ -657,7 +667,7 @@ void R_TimeReport_Frame(void) while (r_speeds_string[i] && r_speeds_string[i] != '\n') i++; if (i - j > 0) - DrawQ_String(0, y, r_speeds_string + j, i - j, 8, 8, 1, 1, 1, 1, 0); + DrawQ_String(0, y, r_speeds_string + j, i - j, 8, 8, 1, 1, 1, 1, 0, NULL, true); if (r_speeds_string[i] == '\n') i++; y += 8; diff --git a/console.c b/console.c index 97f6526b..1c9f6721 100644 --- a/console.c +++ b/console.c @@ -930,7 +930,7 @@ void Con_DrawInput (void) text += 1 + key_linepos - con_linewidth; // draw it - DrawQ_ColoredString(0, con_vislines - con_textsize.value*2, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, NULL ); + DrawQ_String(0, con_vislines - con_textsize.value*2, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, NULL, false ); // remove cursor // key_lines[edit_line][key_linepos] = 0; @@ -999,7 +999,7 @@ void Con_DrawNotify (void) } else x = 0; - DrawQ_ColoredString( x, v, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex ); + DrawQ_String( x, v, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex, false ); v += con_textsize.value; } @@ -1018,13 +1018,13 @@ void Con_DrawNotify (void) sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); while ((int)strlen(temptext) >= con_linewidth) { - DrawQ_ColoredString( 0, v, temptext, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex ); + DrawQ_String( 0, v, temptext, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex, false ); strlcpy(temptext, &temptext[con_linewidth], sizeof(temptext)); v += con_textsize.value; } if (strlen(temptext) > 0) { - DrawQ_ColoredString( 0, v, temptext, 0, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex ); + DrawQ_String( 0, v, temptext, 0, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex, false ); v += con_textsize.value; } } @@ -1050,7 +1050,7 @@ void Con_DrawConsole (int lines) // draw the background DrawQ_Pic(0, lines - vid_conheight.integer, scr_conbrightness.value >= 0.01f ? Draw_CachePic("gfx/conback", true) : NULL, vid_conwidth.integer, vid_conheight.integer, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, scr_conalpha.value, 0); - DrawQ_String(vid_conwidth.integer - strlen(engineversion) * con_textsize.value - con_textsize.value, lines - con_textsize.value, engineversion, 0, con_textsize.value, con_textsize.value, 1, 0, 0, 1, 0); + DrawQ_String(vid_conwidth.integer - strlen(engineversion) * con_textsize.value - con_textsize.value, lines - con_textsize.value, engineversion, 0, con_textsize.value, con_textsize.value, 1, 0, 0, 1, 0, NULL, true); // draw the text con_vislines = lines; @@ -1065,7 +1065,7 @@ void Con_DrawConsole (int lines) j = max(i - con_backscroll, 0); text = con_text + (j % con_totallines)*con_linewidth; - DrawQ_ColoredString( 0, y, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex ); + DrawQ_String( 0, y, text, con_linewidth, con_textsize.value, con_textsize.value, 1.0, 1.0, 1.0, 1.0, 0, &colorindex, false ); } // draw the input prompt, user text, and cursor if desired diff --git a/draw.h b/draw.h index 6d6f4e3f..5f99eb62 100644 --- a/draw.h +++ b/draw.h @@ -78,10 +78,13 @@ DRAWFLAG_NUMFLAGS // draw an image (or a filled rectangle if pic == NULL) void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags); -// draw a text string -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); -// draw a text string that supports color tags (colorindex can either be NULL, -1 to make it choose the default color or valid index to start with) -float DrawQ_ColoredString( float x, float y, const char *text, int maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor ); +// draw a text string, +// with optional color tag support, +// returns final unclipped x coordinate +// if outcolor is provided the initial color is read from it, and it is updated at the end with the new value at the end of the text (not at the end of the clipped part) +// the color is tinted by the provided base color +// if r_textshadow is not zero, an additional instance of the text is drawn first at an offset with an inverted shade of gray (black text produces a white shadow, brightly colored text produces a black shadow) +float DrawQ_String(float x, float y, const char *text, int maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes); // draw a very fancy pic (per corner texcoord/color control), the order is tl, tr, bl, br 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); // draw a triangle mesh diff --git a/gl_draw.c b/gl_draw.c index 3267e505..11186d0f 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -580,84 +580,6 @@ void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, flo DrawQ_SuperPic(x,y,pic,width,height,0,0,red,green,blue,alpha,1,0,red,green,blue,alpha,0,1,red,green,blue,alpha,1,1,red,green,blue,alpha,flags); } -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 (alpha < (1.0f / 255.0f)) - return; - - _DrawQ_ProcessDrawFlag(flags); - - GL_Color(red, green, blue, alpha); - - R_Mesh_VertexPointer(vertex3f, 0, 0); - R_Mesh_ColorPointer(NULL, 0, 0); - R_Mesh_ResetTextureState(); - R_Mesh_TexBind(0, R_GetTexture(char_texture)); - R_Mesh_TexCoordPointer(0, 2, texcoord2f, 0, 0); - - 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, 0, 0); - 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, 0, 0); - 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) -{ - float shadow; - if (r_textshadow.value) - { - shadow = (1-((red+green+blue))); - shadow = bound(0, shadow, 1); - DrawQ_String_Real(x+r_textshadow.value,y+r_textshadow.value,string,maxlen,scalex,scaley,shadow,shadow,shadow,alpha*0.8,flags); - } - - DrawQ_String_Real(x,y,string,maxlen,scalex,scaley,red,green,blue,alpha,flags); -} - // color tag printing static vec4_t string_colors[] = { @@ -688,95 +610,165 @@ static vec4_t string_colors[] = #define STRING_COLORS_COUNT (sizeof(string_colors) / sizeof(vec4_t)) -// color is read and changed in the end -float DrawQ_ColoredString( float x, float y, const char *text, int maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor ) +static void DrawQ_GetTextColor(float color[4], int colorindex, float r, float g, float b, float a, qboolean shadow) { - vec_t *color; - int len; - int colorindex; - const char *start, *current; - - if( !outcolor || *outcolor == -1 ) { - colorindex = STRING_COLOR_DEFAULT; - } else { - colorindex = *outcolor; + Vector4Copy(string_colors[colorindex], color); + Vector4Set(color, color[0] * r, color[1] * g, color[2] * b, color[3] * a); + if (shadow) + { + float shadowalpha = color[0]+color[1]+color[2] * 0.8; + Vector4Set(color, 0, 0, 0, color[3] * bound(0, shadowalpha, 1)); } - color = string_colors[colorindex]; +} - if( maxlen < 1) - len = (int)strlen( text ); - else - len = min( maxlen, (int) strlen( text ) ); - - start = current = text; - while( len > 0 ) { - // check for color control char - if( *current == STRING_COLOR_TAG ) { - // get next char - current++; - len--; - if( len == 0 ) { - break; +float DrawQ_String(float startx, float starty, const char *text, int maxlen, float w, float h, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes) +{ + int i, num, shadow, colorindex; + float x, y, s, t, u, v; + float *av, *at, *ac; + float color[4]; + int batchcount; + float vertex3f[QUADELEMENTS_MAXQUADS*4*3]; + float texcoord2f[QUADELEMENTS_MAXQUADS*4*2]; + float color4f[QUADELEMENTS_MAXQUADS*4*4]; + + if (maxlen < 1) + maxlen = 1<<30; + + _DrawQ_ProcessDrawFlag(flags); + + R_Mesh_ColorPointer(color4f, 0, 0); + R_Mesh_ResetTextureState(); + R_Mesh_TexBind(0, R_GetTexture(char_texture)); + R_Mesh_TexCoordPointer(0, 2, texcoord2f, 0, 0); + R_Mesh_VertexPointer(vertex3f, 0, 0); + + ac = color4f; + at = texcoord2f; + av = vertex3f; + batchcount = 0; + + for (shadow = r_textshadow.value != 0;shadow >= 0;shadow--) + { + if (!outcolor || *outcolor == -1) + colorindex = STRING_COLOR_DEFAULT; + else + colorindex = *outcolor; + DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow); + + x = startx; + y = starty; + if (shadow) + { + x += r_textshadow.value; + y += r_textshadow.value; + } + // because this loop increments x before it draws, we must bias x first + x -= w; + for (i = 0;i < maxlen && text[i];) + { + if (text[i] == STRING_COLOR_TAG && !ignorecolorcodes && i + 1 < maxlen) + { + if (text[i+1] == STRING_COLOR_TAG) + i++; + else if (text[i+1] >= '0' && text[i+1] <= '9') + { + colorindex = text[i+1] - '0'; + DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow); + i += 2; + continue; + } } - // display the tag char? - if( *current == STRING_COLOR_TAG ) { - // only display one of the two - start = current; - // get the next char - current++; - len--; - } else if( '0' <= *current && *current <= '9' ) { - colorindex = 0; - do { - colorindex = colorindex * 10 + (*current - '0'); - // only read as long as it makes a valid index - if( colorindex >= (int)STRING_COLORS_COUNT ) { - // undo the last operation - colorindex /= 10; - break; - } - current++; - len--; - } while( len > 0 && '0' <= *current && *current <= '9' ); - // set the color - color = string_colors[colorindex]; - // we jump over the color tag - start = current; + num = text[i++]; + x += w; + 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); + ac[ 0] = color[0];ac[ 1] = color[1];ac[ 2] = color[2];ac[ 3] = color[3]; + ac[ 4] = color[0];ac[ 5] = color[1];ac[ 6] = color[2];ac[ 7] = color[3]; + ac[ 8] = color[0];ac[ 9] = color[1];ac[10] = color[2];ac[11] = color[3]; + ac[12] = color[0];ac[13] = color[1];ac[14] = color[2];ac[15] = color[3]; + 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; + ac += 16; + at += 8; + av += 12; + batchcount++; + if (batchcount >= QUADELEMENTS_MAXQUADS) + { + if (basealpha >= (1.0f / 255.0f)) + { + GL_LockArrays(0, batchcount * 4); + R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements, 0, 0); + GL_LockArrays(0, 0); + } + batchcount = 0; + ac = color4f; + at = texcoord2f; + av = vertex3f; } } - // 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; - } } - - 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; + if (batchcount > 0) + { + if (basealpha >= (1.0f / 255.0f)) + { + GL_LockArrays(0, batchcount * 4); + R_Mesh_Draw(0, batchcount * 4, batchcount * 2, quadelements, 0, 0); + GL_LockArrays(0, 0); + } } + // note: this relies on the proper text (not shadow) being drawn last + return x; +} - // return the last colorindex - if( outcolor ) { - *outcolor = colorindex; +#if 0 +// not used +static int DrawQ_BuildColoredText(char *output2c, size_t maxoutchars, const char *text, int maxreadchars, qboolean ignorecolorcodes, int *outcolor) +{ + int color, numchars = 0; + char *outputend2c = output2c + maxoutchars - 2; + if (!outcolor || *outcolor == -1) + color = STRING_COLOR_DEFAULT; + else + color = *outcolor; + if (!maxreadchars) + maxreadchars = 1<<30; + textend = text + maxreadchars; + while (text != textend && *text) + { + if (*text == STRING_COLOR_TAG && !ignorecolorcodes && text + 1 != textend) + { + if (text[1] == STRING_COLOR_TAG) + text++; + else if (text[1] >= '0' && text[1] <= '9') + { + color = text[1] - '0'; + text += 2; + continue; + } + } + if (output2c >= outputend2c) + break; + *output2c++ = *text++; + *output2c++ = color; + numchars++; } - - // return the new x position - return x; + output2c[0] = output2c[1] = 0; + if (outcolor) + *outcolor = color; + return numchars; } +#endif 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) { diff --git a/menu.c b/menu.c index 70cb146b..930ffeae 100644 --- a/menu.c +++ b/menu.c @@ -183,30 +183,30 @@ static void M_DrawCharacter (float cx, float cy, int num) char temp[2]; temp[0] = num; temp[1] = 0; - DrawQ_String(menu_x + cx, menu_y + cy, temp, 1, 8, 8, 1, 1, 1, 1, 0); + DrawQ_String(menu_x + cx, menu_y + cy, temp, 1, 8, 8, 1, 1, 1, 1, 0, NULL, true); } static void M_PrintColored(float cx, float cy, const char *str) { - DrawQ_ColoredString(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0, NULL); + DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0, NULL, false); } static void M_Print(float cx, float cy, const char *str) { - DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0); + DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true); } static void M_PrintRed(float cx, float cy, const char *str) { - DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 0, 0, 1, 0); + DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 0, 0, 1, 0, NULL, true); } static void M_ItemPrint(float cx, float cy, const char *str, int unghosted) { if (unghosted) - DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0); + DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true); else - DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 0.4, 0.4, 0.4, 1, 0); + DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 0.4, 0.4, 0.4, 1, 0, NULL, true); } static void M_DrawPic(float cx, float cy, const char *picname) diff --git a/prvm_cmds.c b/prvm_cmds.c index 9a4f138d..e990d4bf 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2574,7 +2574,7 @@ void VM_drawcharacter(void) return; } - DrawQ_String (pos[0], pos[1], &character, 1, scale[0], scale[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag); + DrawQ_String (pos[0], pos[1], &character, 1, scale[0], scale[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag, NULL, true); PRVM_G_FLOAT(OFS_RETURN) = 1; } @@ -2615,7 +2615,7 @@ void VM_drawstring(void) if(pos[2] || scale[2]) Con_Printf("VM_drawstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale"))); - DrawQ_String (pos[0], pos[1], string, 0, scale[0], scale[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag); + DrawQ_String (pos[0], pos[1], string, 0, scale[0], scale[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag, NULL, true); PRVM_G_FLOAT(OFS_RETURN) = 1; } /* diff --git a/r_shadow.c b/r_shadow.c index 897d352e..6221d942 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -4250,24 +4250,24 @@ void R_Shadow_EditLights_DrawSelectedLightProperties(void) for (lightcount = 0, light = r_shadow_worldlightchain;light;lightcount++, light = light->next) if (light == r_shadow_selectedlight) lightnumber = lightcount; - sprintf(temp, "Cursor %f %f %f Total Lights %i", r_editlights_cursorlocation[0], r_editlights_cursorlocation[1], r_editlights_cursorlocation[2], lightcount);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; + sprintf(temp, "Cursor %f %f %f Total Lights %i", r_editlights_cursorlocation[0], r_editlights_cursorlocation[1], r_editlights_cursorlocation[2], lightcount);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; if (r_shadow_selectedlight == NULL) return; - sprintf(temp, "Light #%i properties", lightnumber);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Origin : %f %f %f\n", r_shadow_selectedlight->origin[0], r_shadow_selectedlight->origin[1], r_shadow_selectedlight->origin[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Angles : %f %f %f\n", r_shadow_selectedlight->angles[0], r_shadow_selectedlight->angles[1], r_shadow_selectedlight->angles[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Color : %f %f %f\n", r_shadow_selectedlight->color[0], r_shadow_selectedlight->color[1], r_shadow_selectedlight->color[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Radius : %f\n", r_shadow_selectedlight->radius);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Corona : %f\n", r_shadow_selectedlight->corona);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Style : %i\n", r_shadow_selectedlight->style);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Shadows : %s\n", r_shadow_selectedlight->shadow ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Cubemap : %s\n", r_shadow_selectedlight->cubemapname);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "CoronaSize : %f\n", r_shadow_selectedlight->coronasizescale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Ambient : %f\n", r_shadow_selectedlight->ambientscale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Diffuse : %f\n", r_shadow_selectedlight->diffusescale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "Specular : %f\n", r_shadow_selectedlight->specularscale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "NormalMode : %s\n", (r_shadow_selectedlight->flags & LIGHTFLAG_NORMALMODE) ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; - sprintf(temp, "RealTimeMode : %s\n", (r_shadow_selectedlight->flags & LIGHTFLAG_REALTIMEMODE) ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0);y += 8; + sprintf(temp, "Light #%i properties", lightnumber);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Origin : %f %f %f\n", r_shadow_selectedlight->origin[0], r_shadow_selectedlight->origin[1], r_shadow_selectedlight->origin[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Angles : %f %f %f\n", r_shadow_selectedlight->angles[0], r_shadow_selectedlight->angles[1], r_shadow_selectedlight->angles[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Color : %f %f %f\n", r_shadow_selectedlight->color[0], r_shadow_selectedlight->color[1], r_shadow_selectedlight->color[2]);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Radius : %f\n", r_shadow_selectedlight->radius);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Corona : %f\n", r_shadow_selectedlight->corona);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Style : %i\n", r_shadow_selectedlight->style);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Shadows : %s\n", r_shadow_selectedlight->shadow ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Cubemap : %s\n", r_shadow_selectedlight->cubemapname);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "CoronaSize : %f\n", r_shadow_selectedlight->coronasizescale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Ambient : %f\n", r_shadow_selectedlight->ambientscale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Diffuse : %f\n", r_shadow_selectedlight->diffusescale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "Specular : %f\n", r_shadow_selectedlight->specularscale);DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "NormalMode : %s\n", (r_shadow_selectedlight->flags & LIGHTFLAG_NORMALMODE) ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; + sprintf(temp, "RealTimeMode : %s\n", (r_shadow_selectedlight->flags & LIGHTFLAG_REALTIMEMODE) ? "yes" : "no");DrawQ_String(x, y, temp, 0, 8, 8, 1, 1, 1, 1, 0, NULL, true);y += 8; } void R_Shadow_EditLights_ToggleShadow_f(void) diff --git a/sbar.c b/sbar.c index 141b3634..050fca08 100644 --- a/sbar.c +++ b/sbar.c @@ -401,7 +401,7 @@ Draws one solid graphics character */ void Sbar_DrawCharacter (int x, int y, int num) { - DrawQ_String (sbar_x + x + 4 , sbar_y + y, va("%c", num), 0, 8, 8, 1, 1, 1, sbar_alpha_fg.value, 0); + DrawQ_String (sbar_x + x + 4 , sbar_y + y, va("%c", num), 0, 8, 8, 1, 1, 1, sbar_alpha_fg.value, 0, NULL, true); } /* @@ -411,7 +411,7 @@ Sbar_DrawString */ void Sbar_DrawString (int x, int y, char *str) { - DrawQ_String (sbar_x + x, sbar_y + y, str, 0, 8, 8, 1, 1, 1, sbar_alpha_fg.value, 0); + DrawQ_String (sbar_x + x, sbar_y + y, str, 0, 8, 8, 1, 1, 1, sbar_alpha_fg.value, 0, NULL, true); } /* @@ -716,7 +716,7 @@ static void Sbar_DrawWeapon(int nr, float fade, int active) const float w_scale = 0.4; DrawQ_Pic(vid_conwidth.integer - (w_width + w_space) * w_scale, (w_height + w_space) * w_scale * nr + w_space, sb_weapons[0][nr], w_width * w_scale, w_height * w_scale, (active) ? 1 : 0.6, active ? 1 : 0.6, active ? 1 : 1, fade * sbar_alpha_fg.value, DRAWFLAG_ADDITIVE); - //DrawQ_String(vid_conwidth.integer - (w_space + font_size ), (w_height + w_space) * w_scale * nr + w_space, va("%i",nr+1), 0, font_size, font_size, 1, 0, 0, fade, 0); + //DrawQ_String(vid_conwidth.integer - (w_space + font_size ), (w_height + w_space) * w_scale * nr + w_space, va("%i",nr+1), 0, font_size, font_size, 1, 0, 0, fade, 0, NULL, true); if (active) DrawQ_Pic(vid_conwidth.integer - (w_width + w_space) * w_scale, (w_height + w_space) * w_scale * nr + w_space, NULL, w_width * w_scale, w_height * w_scale, 0.3, 0.3, 0.3, fade * sbar_alpha_fg.value, DRAWFLAG_ADDITIVE); @@ -1035,23 +1035,23 @@ void Sbar_ShowFPS(void) fps_x = vid_conwidth.integer - fps_scalex * strlen(fpsstring); DrawQ_Pic(fps_x, fps_y, NULL, fps_scalex * strlen(fpsstring), fps_scaley, 0, 0, 0, 0.5, 0); if (red) - DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 0, 0, 1, 0); + DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 0, 0, 1, 0, NULL, true); else - DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0); + DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true); fps_y += fps_scaley; } if (timestring[0]) { fps_x = vid_conwidth.integer - fps_scalex * strlen(timestring); DrawQ_Pic(fps_x, fps_y, NULL, fps_scalex * strlen(timestring), fps_scaley, 0, 0, 0, 0.5, 0); - DrawQ_String(fps_x, fps_y, timestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0); + DrawQ_String(fps_x, fps_y, timestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true); fps_y += fps_scaley; } if (datestring[0]) { fps_x = vid_conwidth.integer - fps_scalex * strlen(datestring); DrawQ_Pic(fps_x, fps_y, NULL, fps_scalex * strlen(datestring), fps_scaley, 0, 0, 0, 0.5, 0); - DrawQ_String(fps_x, fps_y, datestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0); + DrawQ_String(fps_x, fps_y, datestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true); fps_y += fps_scaley; } } @@ -1440,9 +1440,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) if (s->qw_spectator) { if (s->qw_ping || s->qw_packetloss) - DrawQ_ColoredString(x, y, va("%4i %3i %4i spectator %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("%4i %3i %4i spectator %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); else - DrawQ_ColoredString(x, y, va(" %4i spectator %c%s", minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va(" %4i spectator %c%s", minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } else { @@ -1452,11 +1452,11 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8]; DrawQ_Pic(x + 14*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0); // print the text - //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0); + //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true); if (s->qw_ping || s->qw_packetloss) - DrawQ_ColoredString(x, y, va("%4i %3i %4i %5i %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("%4i %3i %4i %5i %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); else - DrawQ_ColoredString(x, y, va(" %4i %5i %-4s %c%s", minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va(" %4i %5i %-4s %c%s", minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } } else @@ -1464,9 +1464,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) if (s->qw_spectator) { if (s->qw_ping || s->qw_packetloss) - DrawQ_ColoredString(x, y, va("%4i %3i spect %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("%4i %3i spect %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); else - DrawQ_ColoredString(x, y, va(" spect %c%s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va(" spect %c%s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } else { @@ -1476,11 +1476,11 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8]; DrawQ_Pic(x + 9*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0); // print the text - //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0); + //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true); if (s->qw_ping || s->qw_packetloss) - DrawQ_ColoredString(x, y, va("%4i %3i %5i %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("%4i %3i %5i %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); else - DrawQ_ColoredString(x, y, va(" %5i %c%s", (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va(" %5i %c%s", (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } } return 8; @@ -1534,12 +1534,12 @@ void Sbar_DeathmatchOverlay (void) if (cls.protocol == PROTOCOL_QUAKEWORLD) { x = (vid_conwidth.integer - (26 + 15) * 8) / 2; // 26 characters until name, then we assume 15 character names (they can be longer but usually aren't) - DrawQ_ColoredString(x, y, va("ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } else { x = (vid_conwidth.integer - (16 + 15) * 8) / 2; // 16 characters until name, then we assume 15 character names (they can be longer but usually aren't) - DrawQ_ColoredString(x, y, va("ping pl%% frags name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL ); + DrawQ_String(x, y, va("ping pl%% frags name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false ); } y += 8; diff --git a/todo b/todo index 2cca27b1..9aaca4e4 100644 --- a/todo +++ b/todo @@ -1,4 +1,3 @@ - - todo: difficulty ratings are: 0 = trivial, 1 = easy, 2 = easy-moderate, 3 = moderate, 4 = moderate-hard, 5 = hard, 6 = hard++, 7 = nightmare, d = done, -d = done but have not notified the people who asked for it, f = failed, -f = failed but have not notified the people who asked for it 0 bug darkplaces client: can't move mouse around in nexuiz menu if vid_mouse is 0 0 bug darkplaces client: decals are not sticking to submodels @@ -15,6 +14,7 @@ 0 bug darkplaces server csqc networking: csqc entity sending code does not currently detect packet loss and repeat lost entities (FrikaC, Chris Page, div0) 0 bug darkplaces server: SV_PushMove is ignoring model type in its angles_x handling, where as the renderer checks only model type to determine angles_x handling (Urre) 0 bug darkplaces server: SV_PushMove's call to SV_ClipMoveToEntity should do a trace, not just a point test, to support hollow pusher models (Urre) +0 bug darkplaces server: entity unsticking code should try 1 unit horizontal offsets, then diagonals, then vertical, not diagonal + vertical 0 bug darkplaces server: player entered the game is printed twice, test with +map start 0 bug darkplaces server: savegames do not save precaches, which means that automatic precaching frequently results in invalid modelindex values when reloading the savegame, and this bug also exists in many quake mods that randomly choose multiple variants of a monster, each with separate precaches, resulting in a different precache order when reloading the savegame 0 bug darkplaces server: when server quits, it does not notify the master that it is quitting, it should send out a couple forced heartbeats and dpmaster should be modified to remove servers that do not respond to queries within a reason time (jitspoe, div0) -- 2.39.2