From 82cd62c58f76985bf88024ed088ede76674f253c Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 1 Oct 2013 03:46:25 -0700 Subject: [PATCH] Also network scale for old monster models --- qcsrc/client/hud.qc | 12 ++++++------ qcsrc/client/miscfunctions.qc | 18 +++++++++--------- qcsrc/common/csqcmodel_settings.qh | 1 + 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 398078acec..7dfaa94859 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -142,16 +142,16 @@ float stringwidth_nocolors(string s, vector theSize) return stringwidth(s, FALSE, theSize); } -void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag) +void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag) { - position_x -= 2 / 3 * strlen(text) * scale_x; - drawstring(position, text, scale, rgb, theAlpha, flag); + position_x -= 2 / 3 * strlen(text) * theScale_x; + drawstring(position, text, theScale, rgb, theAlpha, flag); } -void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag) +void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag) { - position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x); - drawstring(position, text, scale, rgb, theAlpha, flag); + position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale_x); + drawstring(position, text, theScale, rgb, theAlpha, flag); } // return the string of the onscreen race timer diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 926e11399d..cdd55f8a4c 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -302,18 +302,18 @@ var string _drawpic_picpath; _drawpic_picpath = string_null;\ } while(0) -void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); - drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag); + drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, theScale, 1), pic, theScale * sz, rgb, theAlpha * (1 - fadelerp), flag); } -void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { - drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp); - drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag); + drawpic_aspect_skin_expanding(position, pic, theScale, rgb, theAlpha, flag, fadelerp); + drawpic_skin(position, pic, theScale, rgb, theAlpha * fadelerp, flag); } #define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\ float textaspect, oldsz;\ @@ -341,14 +341,14 @@ void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float theAl } vector drawfontscale; -void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp) +void drawstring_expanding(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); drawfontscale = sz * '1 1 0'; dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); - drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag); + drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag); // width parameter: // (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz) // SIZE1 @@ -361,14 +361,14 @@ void drawstring_aspect_expanding(vector pos, string text, vector sz, vector colo drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp); } -void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp) +void drawcolorcodedstring_expanding(vector position, string text, vector theScale, float theAlpha, float flag, float fadelerp) { float sz; sz = expandingbox_sizefactor_from_fadelerp(fadelerp); drawfontscale = sz * '1 1 0'; dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); - drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag); + drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag); drawfontscale = '1 1 0'; } diff --git a/qcsrc/common/csqcmodel_settings.qh b/qcsrc/common/csqcmodel_settings.qh index 3e7e3f5f99..c79ff007dc 100644 --- a/qcsrc/common/csqcmodel_settings.qh +++ b/qcsrc/common/csqcmodel_settings.qh @@ -48,6 +48,7 @@ CSQCMODEL_ENDIF \ CSQCMODEL_IF(!isplayer) \ CSQCMODEL_PROPERTY(2048, float, ReadByte, WriteByte, monsterid) \ + CSQCMODEL_PROPERTY(4096, float, ReadByte, WriteByte, scale) \ CSQCMODEL_ENDIF // TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody -- 2.39.2