Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SCR_HUD_DrawGunByNum (hud_t *hud, int num, float scale, int style, int wide)
- {
- extern mpic_t *sb_weapons[7][8]; // sbar.c
- int i = num - 2;
- int width, height;
- int x, y;
- char *tmp;
- scale = max(scale, 0.01);
- switch (style)
- {
- if (!HUD_PrepareDraw(hud, width, height, &x, &y))
- return;
- if ( HUD_Stats(STAT_ITEMS) & (IT_SHOTGUN<<i) )
- {
- case 3:
- case 1: // text
- width = 16 * scale;
- height = 8 * scale;
- switch (num)
- {
- case 2: tmp = "sg"; break;
- case 3: tmp = "bs"; break;
- case 4: tmp = "ng"; break;
- case 5: tmp = "sn"; break;
- case 6: tmp = "gl"; break;
- case 7: tmp = "rl"; break;
- case 8: tmp = "lg"; break;
- default: tmp = "";
- }
- if ( ((HUD_Stats(STAT_ACTIVEWEAPON) == (IT_SHOTGUN<<i)) && (style==1)) ||
- ((HUD_Stats(STAT_ACTIVEWEAPON) != (IT_SHOTGUN<<i)) && (style==3))
- )
- Draw_SString(x, y, tmp, scale);
- else
- Draw_SAlt_String(x, y, tmp, scale);
- break;
- case 4:
- case 2: // numbers
- width = 8 * scale;
- height = 8 * scale;
- if ( HUD_Stats(STAT_ACTIVEWEAPON) == (IT_SHOTGUN<<i) )
- num += '0' + (style == 4 ? 128 : 0);
- else
- num += '0' + (style == 4 ? 0 : 128);
- Draw_SCharacter(x, y, num, scale);
- break;
- default: // classic - pictures
- width = scale * (wide ? 48 : 24);
- height = scale * 16;
- float time;
- int flashon;
- time = cl.item_gettime[i];
- flashon = (int)((cl.time - time)*10);
- if (flashon < 0)
- flashon = 0;
- if (flashon >= 10)
- {
- if ( HUD_Stats(STAT_ACTIVEWEAPON) == (IT_SHOTGUN<<i) )
- flashon = 1;
- else
- flashon = 0;
- }
- else
- flashon = (flashon%5) + 2;
- if (wide || num != 8)
- Draw_SPic (x, y, sb_weapons[flashon][i], scale);
- else
- Draw_SSubPic (x, y, sb_weapons[flashon][i], 0, 0, 24, 16, scale);
- break;
- }
- }
Add Comment
Please, Sign In to add comment