From: MirceaKitsune Date: Sun, 29 Jan 2012 21:12:35 +0000 (+0200) Subject: Get the portrait to draw on the screen. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2671f25eda44c3b32c3cf33c34dae76799c78c2d;p=voretournament%2Fvoretournament.git Get the portrait to draw on the screen. --- diff --git a/data/qcsrc/client/hud.qc b/data/qcsrc/client/hud.qc index 976c1ec6..f5d6466f 100644 --- a/data/qcsrc/client/hud.qc +++ b/data/qcsrc/client/hud.qc @@ -25,6 +25,9 @@ float sbar_accuracy_hud; float sbar_scoreboard_alpha_name; float sbar_scoreboard_alpha_name_self; +string portrait_image; +float portrait_time; + float ps_primary, ps_secondary; float ts_primary, ts_secondary; @@ -1677,6 +1680,19 @@ void Sbar_DrawRaceStatus(vector pos) } } +void Sbar_Portrait() +{ + vector left; + left_x = vid_conwidth / 2; + left_y = vid_conheight / 2; + +dprint(strcat(ftos(portrait_time), " --------\n")); +dprint(strcat(portrait_image, " --------\n")); + + if(portrait_time) + drawpic(left + '0 0 0', portrait_image, '192 96 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); +} + void Sbar_Score() { float score, distribution, leader; @@ -3207,11 +3223,12 @@ void Sbar_Draw (void) Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred); } - // draw status, scores, timer, and ring + // draw status, scores, timer, ring and portrait Sbar_Status(); Sbar_Score(); Sbar_Timer(); Sbar_Ring(); + Sbar_Portrait(); // draw strength/invincibility icon and timer CSQC_Strength_Timer(); @@ -3555,10 +3572,13 @@ void Ent_ReadPortrait() { string pl_model, pl_name, img; float pl_skin; + pl_model = ReadString(); pl_skin = ReadByte(); pl_name = ReadString(); + portrait_time = time; + // obtain the image name from the text file float glob, i, fh; string fn; @@ -3577,7 +3597,7 @@ void Ent_ReadPortrait() img = fgets(fh); if(pl_skin == stof(fgets(fh))) if(pl_model == fgets(fh)) - dprint(strcat(img, " ----------------\n")); + portrait_image = strzone(img); fclose(fh); }