From 23e525f6db56601dc6ba04e625fa9429eda368b9 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 15 Apr 2011 02:49:58 +0300 Subject: [PATCH] Revert back to old drawstring method. It's just some components that need a better positioning, and method of drawing the strings --- data/qcsrc/client/miscfunctions.qc | 22 ---------------------- data/qcsrc/client/sbar.qc | 4 ++-- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/data/qcsrc/client/miscfunctions.qc b/data/qcsrc/client/miscfunctions.qc index 885d1eda..0d72bfec 100644 --- a/data/qcsrc/client/miscfunctions.qc +++ b/data/qcsrc/client/miscfunctions.qc @@ -481,28 +481,6 @@ void drawpic_expanding_two(vector position, string pic, vector scale, vector rgb drawpic(position, pic, scale, rgb, alpha * fadelerp, flag); } -// drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box -void drawstring_aspect(vector pos, string text, vector sz, vector color, float alpha, float drawflag) { - vector textsize; - textsize = '1 0 0' * stringwidth(text, FALSE, '1 1 1' * sz_y) + '1 0 0' * sz_y; - - float textaspect; - textaspect = textsize_x/textsize_y; - - vector oldsz; - oldsz = sz; - float aspect; - aspect = sz_x/sz_y; - - if(aspect > textaspect) { - sz_x = sz_y * textaspect; - drawstring(pos + '1 0 0' * (oldsz_x - sz_x) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag); - } else { - sz_y = sz_x / textaspect; - drawstring(pos + '0 1 0' * (oldsz_y - sz_y) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag); - } -} - vector drawfontscale; void drawstring_expanding(vector position, string text, vector scale, vector rgb, float alpha, float flag, float fadelerp) { diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index aff0939d..78f7d2af 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -123,7 +123,7 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl pos_x += lettersize / 2; } - drawstring_aspect(pos, str, vsize, rgb, alpha, dflags); + drawstring(pos, str, vsize, rgb, alpha, dflags); } void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha) @@ -2985,7 +2985,7 @@ void Sbar_Draw (void) } vector health_pos, armor_pos; - health_pos = bottom - '55 58 0'; + health_pos = bottom - '43 58 0'; armor_pos = bottom - '52.5 68 0'; // armor -- 2.39.2