From 7f9c228cb46439f0fa31af7b1fe6a66ca827dbd3 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 18 Apr 2007 05:52:36 +0000 Subject: [PATCH] refactored DrawQ_Pic to actually do the drawing rather than wasting time on a DrawQ_SuperPic call added DrawQ_Fill as an optimized case of DrawQ_Pic this significantly improved performance of shownetgraph git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7120 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 22 +++++++++++----------- draw.h | 2 ++ gl_draw.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- menu.c | 22 +++++++++++----------- prvm_cmds.c | 2 +- sbar.c | 24 ++++++++++++------------ 6 files changed, 86 insertions(+), 36 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 72f62e30..faef96f5 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -195,9 +195,9 @@ void SCR_DrawNetGraph_DrawGraph (int graphx, int graphy, int barwidth, int barhe y = graphy + barheight; index = (packetcounter + j) % NETGRAPH_PACKETS; if (parameters[0][index] == NETGRAPH_LOSTPACKET) - DrawQ_Pic(x, y - barheight, NULL, barwidth, barheight, 1, 0, 0, 1, 0); + DrawQ_Fill(x, y - barheight, barwidth, barheight, 1, 0, 0, 1, 0); else if (parameters[0][index] == NETGRAPH_CHOKEDPACKET) - DrawQ_Pic(x, y - min(2, barheight), NULL, barwidth, min(2, barheight), 1, 1, 0, 1, 0); + DrawQ_Fill(x, y - min(2, barheight), barwidth, min(2, barheight), 1, 1, 0, 1, 0); else { offset = 0; @@ -207,7 +207,7 @@ void SCR_DrawNetGraph_DrawGraph (int graphx, int graphy, int barwidth, int barhe height = min(height, barheight - offset); offset += height; if (height) - DrawQ_Pic(x, y - offset, NULL, barwidth, height, parametercolors[k][0], parametercolors[k][1], parametercolors[k][2], parametercolors[k][3], 0); + DrawQ_Fill(x, y - offset, barwidth, height, parametercolors[k][0], parametercolors[k][1], parametercolors[k][2], parametercolors[k][3], 0); } } } @@ -225,8 +225,8 @@ 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); + DrawQ_Fill(graphx , graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + DrawQ_Fill(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); // draw the bar graphs numparameters = 3; parameters[0] = conn->incoming_unreliablesize; @@ -247,8 +247,8 @@ void SCR_DrawNetGraph_DrawConnection_Server (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); + DrawQ_Fill(graphx , graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); + DrawQ_Fill(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0); // draw the bar graphs numparameters = 3; parameters[0] = conn->outgoing_unreliablesize; @@ -464,7 +464,7 @@ static int SCR_DrawQWDownload(int offset) len = (int)strlen(temp); 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_Fill(0, y, vid_conwidth.integer, size, 0, 0, 0, 0.5, 0); DrawQ_String(x, y, temp, len, size, size, 1, 1, 1, 1, 0, NULL, true); return 8; } @@ -495,7 +495,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_Fill(0, y - size, vid_conwidth.integer, size, 1, 1, 1, 0.8, 0); DrawQ_String(x, y - size, addinfo, len, size, size, 0, 0, 0, 1, 0, NULL, true); } @@ -509,7 +509,7 @@ static int SCR_DrawCurlDownload(int offset) dpsnprintf(temp, sizeof(temp), "Downloading %s ... %5.1f%% @ %.1f KiB/s\n", downinfo[i].filename, 100.0 * downinfo[i].progress, downinfo[i].speed / 1024.0); 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_Fill(0, y + i * size, 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, NULL, true); } @@ -660,7 +660,7 @@ void R_TimeReport_Frame(void) lines++; y = vid_conheight.integer - sb_lines - lines * 8; i = j = 0; - DrawQ_Pic(0, y, NULL, vid_conwidth.integer, lines * 8, 0, 0, 0, 0.5, 0); + DrawQ_Fill(0, y, vid_conwidth.integer, lines * 8, 0, 0, 0, 0.5, 0); while (r_speeds_string[i]) { j = i; diff --git a/draw.h b/draw.h index 5f99eb62..8d325860 100644 --- a/draw.h +++ b/draw.h @@ -78,6 +78,8 @@ 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 filled rectangle (slightly faster than DrawQ_Pic with pic = NULL) +void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags); // draw a text string, // with optional color tag support, // returns final unclipped x coordinate diff --git a/gl_draw.c b/gl_draw.c index 11186d0f..82b2bea7 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -577,7 +577,55 @@ static void _DrawQ_ProcessDrawFlag(int flags) void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags) { - 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); + float floats[20]; + + _DrawQ_ProcessDrawFlag(flags); + GL_Color(red, green, blue, alpha); + + R_Mesh_VertexPointer(floats, 0, 0); + R_Mesh_ColorPointer(NULL, 0, 0); + 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, 0, 0); + floats[12] = 0;floats[13] = 0; + floats[14] = 1;floats[15] = 0; + floats[16] = 1;floats[17] = 1; + floats[18] = 0;floats[19] = 1; + } + + 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; + + R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0); +} + +void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags) +{ + float floats[12]; + + _DrawQ_ProcessDrawFlag(flags); + GL_Color(red, green, blue, alpha); + + R_Mesh_VertexPointer(floats, 0, 0); + R_Mesh_ColorPointer(NULL, 0, 0); + R_Mesh_ResetTextureState(); + + 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; + + R_Mesh_Draw(0, 4, 2, polygonelements, 0, 0); } // color tag printing diff --git a/menu.c b/menu.c index 930ffeae..86e9a170 100644 --- a/menu.c +++ b/menu.c @@ -167,8 +167,8 @@ static void M_Background(int width, int height) menu_height = bound(1, height, vid_conheight.integer); menu_x = (vid_conwidth.integer - menu_width) * 0.5; menu_y = (vid_conheight.integer - menu_height) * 0.5; - //DrawQ_Pic(menu_x, menu_y, NULL, menu_width, menu_height, 0, 0, 0, 0.5, 0); - DrawQ_Pic(0, 0, NULL, vid_conwidth.integer, vid_conheight.integer, 0, 0, 0, 0.5, 0); + //DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0); + DrawQ_Fill(0, 0, vid_conwidth.integer, vid_conheight.integer, 0, 0, 0, 0.5, 0); } /* @@ -1606,7 +1606,7 @@ static void M_Options_PrintCommand(const char *s, int enabled) if (opty >= 32) { if (optnum == optcursor) - DrawQ_Pic(menu_x + 48, menu_y + opty, NULL, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); + DrawQ_Fill(menu_x + 48, menu_y + opty, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); M_ItemPrint(0 + 48, opty, s, enabled); } opty += 8; @@ -1618,7 +1618,7 @@ static void M_Options_PrintCheckbox(const char *s, int enabled, int yes) if (opty >= 32) { if (optnum == optcursor) - DrawQ_Pic(menu_x + 48, menu_y + opty, NULL, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); + DrawQ_Fill(menu_x + 48, menu_y + opty, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); M_ItemPrint(0 + 48, opty, s, enabled); M_DrawCheckbox(0 + 48 + (int)strlen(s) * 8 + 8, opty, yes); } @@ -1631,7 +1631,7 @@ static void M_Options_PrintSlider(const char *s, int enabled, float value, float if (opty >= 32) { if (optnum == optcursor) - DrawQ_Pic(menu_x + 48, menu_y + opty, NULL, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); + DrawQ_Fill(menu_x + 48, menu_y + opty, 320, 8, optnum == optcursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); M_ItemPrint(0 + 48, opty, s, enabled); M_DrawSlider(0 + 48 + (int)strlen(s) * 8 + 8, opty, value, minvalue, maxvalue); } @@ -2222,7 +2222,7 @@ static void M_Options_ColorControl_Draw (void) M_Options_PrintSlider( " White: Grey ", v_color_enable.integer, (v_color_white_r.value + v_color_white_g.value + v_color_white_b.value) / 3, 1, 5); opty += 4; - DrawQ_Pic(menu_x, menu_y + opty, NULL, 320, 4 + 64 + 8 + 64 + 4, 0, 0, 0, 1, 0);opty += 4; + DrawQ_Fill(menu_x, menu_y + opty, 320, 4 + 64 + 8 + 64 + 4, 0, 0, 0, 1, 0);opty += 4; s = (float) 312 / 2 * vid.width / vid_conwidth.integer; t = (float) 4 / 2 * vid.height / vid_conheight.integer; DrawQ_SuperPic(menu_x + 4, menu_y + opty, dither, 312, 4, 0,0, 1,0,0,1, s,0, 1,0,0,1, 0,t, 1,0,0,1, s,t, 1,0,0,1, 0);opty += 4; @@ -2241,19 +2241,19 @@ static void M_Options_ColorControl_Draw (void) v = t * 0.5; opty += 8; x = 4; - DrawQ_Pic(menu_x + x, menu_y + opty, NULL, 64, 48, c, 0, 0, 1, 0); + DrawQ_Fill(menu_x + x, menu_y + opty, 64, 48, c, 0, 0, 1, 0); DrawQ_SuperPic(menu_x + x + 16, menu_y + opty + 16, dither, 16, 16, 0,0, 1,0,0,1, s,0, 1,0,0,1, 0,t, 1,0,0,1, s,t, 1,0,0,1, 0); DrawQ_SuperPic(menu_x + x + 32, menu_y + opty + 16, dither, 16, 16, 0,0, 1,0,0,1, u,0, 1,0,0,1, 0,v, 1,0,0,1, u,v, 1,0,0,1, 0); x += 80; - DrawQ_Pic(menu_x + x, menu_y + opty, NULL, 64, 48, 0, c, 0, 1, 0); + DrawQ_Fill(menu_x + x, menu_y + opty, 64, 48, 0, c, 0, 1, 0); DrawQ_SuperPic(menu_x + x + 16, menu_y + opty + 16, dither, 16, 16, 0,0, 0,1,0,1, s,0, 0,1,0,1, 0,t, 0,1,0,1, s,t, 0,1,0,1, 0); DrawQ_SuperPic(menu_x + x + 32, menu_y + opty + 16, dither, 16, 16, 0,0, 0,1,0,1, u,0, 0,1,0,1, 0,v, 0,1,0,1, u,v, 0,1,0,1, 0); x += 80; - DrawQ_Pic(menu_x + x, menu_y + opty, NULL, 64, 48, 0, 0, c, 1, 0); + DrawQ_Fill(menu_x + x, menu_y + opty, 64, 48, 0, 0, c, 1, 0); DrawQ_SuperPic(menu_x + x + 16, menu_y + opty + 16, dither, 16, 16, 0,0, 0,0,1,1, s,0, 0,0,1,1, 0,t, 0,0,1,1, s,t, 0,0,1,1, 0); DrawQ_SuperPic(menu_x + x + 32, menu_y + opty + 16, dither, 16, 16, 0,0, 0,0,1,1, u,0, 0,0,1,1, 0,v, 0,0,1,1, u,v, 0,0,1,1, 0); x += 80; - DrawQ_Pic(menu_x + x, menu_y + opty, NULL, 64, 48, c, c, c, 1, 0); + DrawQ_Fill(menu_x + x, menu_y + opty, 64, 48, c, c, c, 1, 0); DrawQ_SuperPic(menu_x + x + 16, menu_y + opty + 16, dither, 16, 16, 0,0, 1,1,1,1, s,0, 1,1,1,1, 0,t, 1,1,1,1, s,t, 1,1,1,1, 0); DrawQ_SuperPic(menu_x + x + 32, menu_y + opty + 16, dither, 16, 16, 0,0, 1,1,1,1, u,0, 1,1,1,1, 0,v, 1,1,1,1, u,v, 1,1,1,1, 0); } @@ -4372,7 +4372,7 @@ static void M_ServerList_Draw (void) { for (n = start;n < end;n++) { - DrawQ_Pic(menu_x, menu_y + y, NULL, 640, 16, n == slist_cursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); + DrawQ_Fill(menu_x, menu_y + y, 640, 16, n == slist_cursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0); M_PrintColored(0, y, serverlist_viewlist[n]->line1);y += 8; M_PrintColored(0, y, serverlist_viewlist[n]->line2);y += 8; } diff --git a/prvm_cmds.c b/prvm_cmds.c index e990d4bf..f846a0be 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2693,7 +2693,7 @@ void VM_drawfill(void) if(pos[2] || size[2]) Con_Printf("VM_drawfill: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size"))); - DrawQ_Pic(pos[0], pos[1], NULL, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag); + DrawQ_Fill(pos[0], pos[1], size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag); PRVM_G_FLOAT(OFS_RETURN) = 1; } diff --git a/sbar.c b/sbar.c index 050fca08..af30d244 100644 --- a/sbar.c +++ b/sbar.c @@ -719,7 +719,7 @@ static void Sbar_DrawWeapon(int nr, float fade, int active) //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); + DrawQ_Fill(vid_conwidth.integer - (w_width + w_space) * w_scale, (w_height + w_space) * w_scale * nr + w_space, w_width * w_scale, w_height * w_scale, 0.3, 0.3, 0.3, fade * sbar_alpha_fg.value, DRAWFLAG_ADDITIVE); } /* @@ -897,9 +897,9 @@ void Sbar_DrawFrags (void) // draw background c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; - DrawQ_Pic (sbar_x + x + 10, sbar_y - 23, NULL, 28, 4, 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); + DrawQ_Fill (sbar_x + x + 10, sbar_y - 23, 28, 4, 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); c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8]; - DrawQ_Pic (sbar_x + x + 10, sbar_y + 4 - 23, NULL, 28, 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); + DrawQ_Fill (sbar_x + x + 10, sbar_y + 4 - 23, 28, 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); // draw number f = s->frags; @@ -941,9 +941,9 @@ void Sbar_DrawFace (void) // draw background Sbar_DrawPic (112, 0, rsb_teambord); c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; - DrawQ_Pic (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+3, NULL, 22, 9, 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); + DrawQ_Fill (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+3, 22, 9, 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); c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8]; - DrawQ_Pic (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+12, NULL, 22, 9, 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); + DrawQ_Fill (sbar_x + 113, vid_conheight.integer-SBAR_HEIGHT+12, 22, 9, 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); // draw number f = s->frags; @@ -1033,7 +1033,7 @@ void Sbar_ShowFPS(void) if (fpsstring[0]) { 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); + DrawQ_Fill(fps_x, fps_y, 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, NULL, true); else @@ -1043,14 +1043,14 @@ void Sbar_ShowFPS(void) 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_Fill(fps_x, fps_y, 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, 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_Fill(fps_x, fps_y, 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, NULL, true); fps_y += fps_scaley; } @@ -1448,9 +1448,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) { // draw colors behind score c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; - DrawQ_Pic(x + 14*8, y+1, 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); + DrawQ_Fill(x + 14*8, y+1, 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); 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); + DrawQ_Fill(x + 14*8, y+4, 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, NULL, true); if (s->qw_ping || s->qw_packetloss) @@ -1472,9 +1472,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) { // draw colors behind score c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; - DrawQ_Pic(x + 9*8, y+1, 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); + DrawQ_Fill(x + 9*8, y+1, 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); 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); + DrawQ_Fill(x + 9*8, y+4, 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, NULL, true); if (s->qw_ping || s->qw_packetloss) -- 2.39.2