X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=sbar.c;h=f28fd46ff390421c27bc7b73ba5eca523e4fc70c;hb=4a0c55c2f53d3b18ae28eddb822a0c670636c0f9;hp=39b03c03210b9182fe2b8bf5912ecda7751f2231;hpb=d97392d62862fd1cb8994128ced9b3b1385f3293;p=xonotic%2Fdarkplaces.git diff --git a/sbar.c b/sbar.c index 39b03c03..f28fd46f 100644 --- a/sbar.c +++ b/sbar.c @@ -863,12 +863,14 @@ void Sbar_DrawInventory (void) // ammo counts for (i=0 ; i<4 ; i++) { - sprintf (num, "%3i",cl.stats[STAT_SHELLS+i] ); + sprintf (num, "%4i",cl.stats[STAT_SHELLS+i] ); if (num[0] != ' ') - Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0'); + Sbar_DrawCharacter ( (6*i+0)*8 - 2, -24, 18 + num[0] - '0'); if (num[1] != ' ') - Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0'); + Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[1] - '0'); if (num[2] != ' ') + Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[2] - '0'); + if (num[3] != ' ') Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0'); } @@ -933,9 +935,9 @@ void Sbar_DrawFrags (void) s = &cl.scores[k]; // draw background - c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; + c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4]; 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]; + c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf]; 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 @@ -977,9 +979,9 @@ void Sbar_DrawFace (void) s = &cl.scores[cl.viewentity - 1]; // draw background Sbar_DrawPic (112, 0, rsb_teambord); - c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; + c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4]; 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]; + c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf]; 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 @@ -1597,9 +1599,14 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) else { // draw colors behind score - c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; + // + // + // + // + // + c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4]; 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]; + c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf]; 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", myself ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true); @@ -1621,9 +1628,9 @@ float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y) else { // draw colors behind score - c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8]; + c = (unsigned char *)&palette_pantsscoreboard[(s->colors & 0xf0) >> 4]; 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]; + c = (unsigned char *)&palette_shirtscoreboard[s->colors & 0xf]; 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", myself ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true); @@ -1854,7 +1861,7 @@ void Sbar_Score (int margin) for(i = 0; i < teamlines; ++i) { int cindex = teamcolorsort[i]->colors & 15; - unsigned char *c = (unsigned char *)&palette_complete[(cindex << 4) + 8]; + unsigned char *c = (unsigned char *)&palette_shirtscoreboard[cindex]; float cm = max(max(c[0], c[1]), c[2]); float cr = c[0] / cm; float cg = c[1] / cm;