.float HookSilent;
.float HookRange;
-void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag, vector vieworg)
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
{
// I want to draw a quad...
// from and to are MIDPOINTS.
D = to - thickdir * (thickness / 2);
R_BeginPolygon(texture, drawflag);
- R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, alpha);
- R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, alpha);
- R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, alpha);
- R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, alpha);
+ R_PolygonVertex(A, '0 0 0' + shift * '1 0 0', rgb, theAlpha);
+ R_PolygonVertex(B, '0 1 0' + shift * '1 0 0', rgb, theAlpha);
+ R_PolygonVertex(C, '0 1 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
+ R_PolygonVertex(D, '0 0 0' + (shift + length_tex) * '1 0 0', rgb, theAlpha);
R_EndPolygon();
}
return stringwidth(s, FALSE, theSize);
}
-void drawstringright(vector position, string text, vector scale, vector rgb, float alpha, float flag)
+void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
{
position_x -= 2 / 3 * strlen(text) * scale_x;
- drawstring(position, text, scale, rgb, alpha, flag);
+ drawstring(position, text, scale, rgb, theAlpha, flag);
}
-void drawstringcenter(vector position, string text, vector scale, vector rgb, float alpha, float flag)
+void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
{
position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x);
- drawstring(position, text, scale, rgb, alpha, flag);
+ drawstring(position, text, scale, rgb, theAlpha, flag);
}
// return the string of the given race place
*/
// draw the background/borders
-#define HUD_Panel_DrawBg(alpha)\
+#define HUD_Panel_DrawBg(theAlpha)\
if(panel_bg != "0")\
- draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER))
+ draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER))
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, float vertical, float baralign, vector theColor, float theAlpha, float drawflag)
}
}
-void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float alpha, float drawflag)
+void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, float drawflag)
{
- if(!alpha)
+ if(!theAlpha)
return;
string pic;
pic = "gfx/hud/default/num_leading";
}
- drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0 0 0', '0.25 1 0', color, alpha, drawflag);
+ drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0 0 0', '0.25 1 0', color, theAlpha, drawflag);
if(mySize_x/mySize_y > 2)
- drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, pic, '0.25 0 0', '0.5 1 0', color, alpha, drawflag);
- drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0.75 0 0', '0.25 1 0', color, alpha, drawflag);
+ drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, pic, '0.25 0 0', '0.5 1 0', color, theAlpha, drawflag);
+ drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0.75 0 0', '0.25 1 0', color, theAlpha, drawflag);
}
// Weapon icons (#0)
else
color = '1 1 1';
- float alpha;
+ float theAlpha;
if(currently_selected)
- alpha = 1;
+ theAlpha = 1;
else
- alpha = 0.7;
+ theAlpha = 0.7;
vector picpos, numpos;
if(autocvar_hud_panel_ammo_iconalign)
drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
if(a > 0 && autocvar_hud_panel_ammo_progressbar)
- HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, a/autocvar_hud_panel_ammo_maxammo, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, a/autocvar_hud_panel_ammo_maxammo, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
if(autocvar_hud_panel_ammo_text)
{
if(a > 0 || infinite_ammo)
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
else // "ghost" ammo count
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * theAlpha * 0.5, DRAWFLAG_NORMAL);
}
if(a > 0 || infinite_ammo)
- drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
else // "ghost" ammo icon
- drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '0 0 0', panel_fg_alpha * theAlpha * 0.5, DRAWFLAG_NORMAL);
}
void HUD_Ammo(void)
}
}
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float alpha)
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
{
vector newPos, newSize;
vector picpos, numpos;
}
newSize_y /= 2;
- drawpic_aspect_skin(picpos, icon, newSize, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, icon, newSize, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
// make number smaller than icon, it looks better
// reduce only y to draw numbers with different number of digits with the same y size
numpos_y += newSize_y * ((1 - 0.7) / 2);
newSize_y *= 0.7;
- drawstring_aspect(numpos, ftos(x), newSize, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(x), newSize, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
return;
}
picpos = newPos;
}
- drawstring_aspect(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
- drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
}
void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float fadelerp)
switch(keyteam)
{
case COLOR_TEAM1:
- drawpic_aspect_skin(pa, "kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(pa, "kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case COLOR_TEAM2:
- drawpic_aspect_skin(pa, "kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(pa, "kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case COLOR_TEAM3:
- drawpic_aspect_skin(pa, "kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(pa, "kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case COLOR_TEAM4:
- drawpic_aspect_skin(pa, "kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(pa, "kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
default:
break;
switch(i) // YAY! switch(i) inside a for loop for i. DailyWTF, here we come!
{
case 0:
- drawpic_aspect_skin(p, "kh_red", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(p, "kh_red", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case 1:
- drawpic_aspect_skin(p, "kh_blue", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(p, "kh_blue", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case 2:
- drawpic_aspect_skin(p, "kh_yellow", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(p, "kh_yellow", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
case 3:
- drawpic_aspect_skin(p, "kh_pink", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% alpha key
+ drawpic_aspect_skin(p, "kh_pink", kh_size, '1 1 1', a, DRAWFLAG_NORMAL); // show 30% theAlpha key
break;
}
}
}
}
}
- panel_bg_alpha = max(0.75, panel_bg_alpha); // force an alpha of at least 0.75
+ panel_bg_alpha = max(0.75, panel_bg_alpha); // force an theAlpha of at least 0.75
}
vector pos, mySize;
{
vector chatsize;
chatsize = '1 1 0' * autocvar_con_chatsize;
- cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
+ cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over theAlpha and such
float i, a;
for(i = 0; i < autocvar_con_chat; ++i)
{
// also fade it based on positioning
if(autocvar_hud_panel_centerprint_fade_subsequent)
{
- a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half alpha
- a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower alpha even more for each message
+ a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half theAlpha
+ a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower theAlpha even more for each message
}
- // finally set the size based on the new alpha from subsequent fading
+ // finally set the size based on the new theAlpha from subsequent fading
sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize));
drawfontscale = sz * '1 1 0';
void HUD_Main (void)
{
float i;
- // global hud alpha fade
+ // global hud theAlpha fade
if(menu_enabled == 1)
hud_fade_alpha = 1;
else
hud_configure_prev = autocvar__hud_configure;
- if (!autocvar__hud_configure) // hud config mode disabled, enable normal alpha stuff again
+ if (!autocvar__hud_configure) // hud config mode disabled, enable normal theAlpha stuff again
if (menu_enabled)
menu_enabled = 0;
}
/*
print("menu_enabled: ", ftos(menu_enabled), "\n");
print("Highlighted: ", ftos(highlightedPanel), "\n");
- print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n");
+ print("Menu theAlpha: ", ftos(autocvar__menu_alpha), "\n");
*/
// instantly hide the editor cursor if we open the HUDExit dialog
const float hlBorderSize = 4;
const string hlBorder = "gfx/hud/default/border_highlighted";
const string hlBorder2 = "gfx/hud/default/border_highlighted2";
-void HUD_Panel_HlBorder(float myBorder, vector color, float alpha)
+void HUD_Panel_HlBorder(float myBorder, vector color, float theAlpha)
{
- drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * alpha, DRAWFLAG_NORMAL);
- drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
- drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size_y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
- drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
- drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size_x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
+ drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * theAlpha, DRAWFLAG_NORMAL);
+ drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
+ drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size_y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
+ drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
+ drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size_x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, theAlpha, DRAWFLAG_NORMAL);
}
text_size = stringwidth(label, false, hud_fontsize);
- float alpha;
+ float theAlpha;
if (count < 0 && mv_top2_alpha)
- alpha = mv_top2_alpha;
+ theAlpha = mv_top2_alpha;
else
- alpha = 1;
+ theAlpha = 1;
pos_x -= text_size*0.5;
- drawstring(pos, label, hud_fontsize, rgb, alpha, DRAWFLAG_NORMAL);
+ drawstring(pos, label, hud_fontsize, rgb, theAlpha, DRAWFLAG_NORMAL);
pos_x = pos_x + text_size*0.5 - img_size_x*0.5;
pos_y = pos_y - img_size_y;
img_size -= (autocvar_scoreboard_border_thickness * 2) * '1 1 0';
if(pic == "")
{
- drawfill(pos, img_size, '.5 .5 .5', .7 * alpha, DRAWFLAG_NORMAL);
+ drawfill(pos, img_size, '.5 .5 .5', .7 * theAlpha, DRAWFLAG_NORMAL);
}
else
{
- drawpic(pos, pic, img_size, '1 1 1', alpha, DRAWFLAG_NORMAL);
+ drawpic(pos, pic, img_size, '1 1 1', theAlpha, DRAWFLAG_NORMAL);
}
if(id == mv_ownvote)
- drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, rgb, alpha, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, rgb, theAlpha, DRAWFLAG_NORMAL);
else
- drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, '0 0 0', alpha, DRAWFLAG_NORMAL);
+ drawborderlines(autocvar_scoreboard_border_thickness, pos, img_size, '0 0 0', theAlpha, DRAWFLAG_NORMAL);
if(id == mv_selection && count >= 0)
drawfill(pos, img_size, '1 1 1', 0.1, DRAWFLAG_NORMAL);
return boxsize * (0.5 * (1 - sz));
}
-void drawborderlines(float thickness, vector pos, vector dim, vector color, float alpha, float drawflag)
+void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
{
vector line_dim;
pos_x -= thickness;
line_dim_x = thickness;
line_dim_y = dim_y;
- drawfill(pos, line_dim, color, alpha, drawflag);
- drawfill(pos + (dim_x + thickness) * '1 0 0', line_dim, color, alpha, drawflag);
+ drawfill(pos, line_dim, color, theAlpha, drawflag);
+ drawfill(pos + (dim_x + thickness) * '1 0 0', line_dim, color, theAlpha, drawflag);
// upper and lower lines
pos_y -= thickness;
line_dim_x = dim_x + thickness * 2; // make upper and lower lines longer
line_dim_y = thickness;
- drawfill(pos, line_dim, color, alpha, drawflag);
- drawfill(pos + (dim_y + thickness) * '0 1 0', line_dim, color, alpha, drawflag);
+ drawfill(pos, line_dim, color, theAlpha, drawflag);
+ drawfill(pos + (dim_y + thickness) * '0 1 0', line_dim, color, theAlpha, drawflag);
}
-void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float alpha, float drawflag)
+void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag)
{
vector current_pos, end_pos, new_size, ratio;
end_pos = pos + area;
new_size_y = min(sz_y, end_pos_y - current_pos_y);
ratio_x = new_size_x / sz_x;
ratio_y = new_size_y / sz_y;
- drawsubpic(current_pos, new_size, pic, '0 0 0', ratio, color, alpha, drawflag);
+ drawsubpic(current_pos, new_size, pic, '0 0 0', ratio, color, theAlpha, drawflag);
current_pos_x += sz_x;
}
current_pos_y += sz_y;
var vector _drawpic_sz;
var float _drawpic_oldsz;
var string _drawpic_picpath;
-#define drawpic_aspect(pos,pic,mySize,color,alpha,drawflag)\
+#define drawpic_aspect(pos,pic,mySize,color,theAlpha,drawflag)\
do {\
_drawpic_imgsize = draw_getimagesize(pic);\
_drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\
if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\
_drawpic_oldsz = _drawpic_sz_x;\
_drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\
- drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
+ drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\
} else {\
_drawpic_oldsz = _drawpic_sz_y;\
_drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\
- drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
+ drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, theAlpha, drawflag);\
}\
} while(0)
// draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
-#define drawpic_aspect_skin(pos,pic,sz,color,alpha,drawflag)\
+#define drawpic_aspect_skin(pos,pic,sz,color,theAlpha,drawflag)\
do{\
_drawpic_picpath = strcat(hud_skin_path, "/", pic);\
if(precache_pic(_drawpic_picpath) == "") {\
_drawpic_picpath = strcat("gfx/hud/default/", pic);\
}\
- drawpic_aspect(pos, _drawpic_picpath, sz, color, alpha, drawflag);\
+ drawpic_aspect(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
_drawpic_picpath = string_null;\
} while(0)
// draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
-#define drawpic_skin(pos,pic,sz,color,alpha,drawflag)\
+#define drawpic_skin(pos,pic,sz,color,theAlpha,drawflag)\
do{\
_drawpic_picpath = strcat(hud_skin_path, "/", pic);\
if(precache_pic(_drawpic_picpath) == "") {\
_drawpic_picpath = strcat("gfx/hud/default/", pic);\
}\
- drawpic(pos, _drawpic_picpath, sz, color, alpha, drawflag);\
+ drawpic(pos, _drawpic_picpath, sz, color, theAlpha, drawflag);\
_drawpic_picpath = string_null;\
} while(0)
-void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float alpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, 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, alpha * (1 - fadelerp), flag);
+ drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag);
}
-void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float alpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
{
- drawpic_aspect_skin_expanding(position, pic, scale, rgb, alpha, flag, fadelerp);
- drawpic_skin(position, pic, scale, rgb, alpha * fadelerp, flag);
+ drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp);
+ drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag);
}
#define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
float textaspect, oldsz;\
}
// 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) {
+void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag) {
SET_POS_AND_SZ_Y_ASPECT(FALSE)
- drawstring(pos, text, '1 1 0' * sz_y, color, alpha, drawflag);
+ drawstring(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag);
}
// drawstring wrapper to draw a colorcodedstring as large as possible with preserved aspect ratio into a box
-void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float alpha, float drawflag) {
+void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float theAlpha, float drawflag) {
SET_POS_AND_SZ_Y_ASPECT(TRUE)
- drawcolorcodedstring(pos, text, '1 1 0' * sz_y, alpha, drawflag);
+ drawcolorcodedstring(pos, text, '1 1 0' * sz_y, theAlpha, drawflag);
}
vector drawfontscale;
-void drawstring_expanding(vector position, string text, vector scale, vector rgb, float alpha, float flag, float fadelerp)
+void drawstring_expanding(vector position, string text, vector scale, 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, alpha * (1 - fadelerp), flag);
+ 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);
// width parameter:
// (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
// SIZE1
}
// drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
-void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float alpha, float drawflag, float fadelerp) {
+void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag, float fadelerp) {
SET_POS_AND_SZ_Y_ASPECT(FALSE)
- drawstring_expanding(pos, text, '1 1 0' * sz_y, color, alpha, drawflag, fadelerp);
+ drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp);
}
-void drawcolorcodedstring_expanding(vector position, string text, vector scale, float alpha, float flag, float fadelerp)
+void drawcolorcodedstring_expanding(vector position, string text, vector scale, 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), alpha * (1 - fadelerp), flag);
+ 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);
drawfontscale = '1 1 0';
}
-void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float alpha, float drawflag, float fadelerp) {
+void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float theAlpha, float drawflag, float fadelerp) {
SET_POS_AND_SZ_Y_ASPECT(TRUE)
- drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz_y, alpha, drawflag, fadelerp);
+ drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz_y, theAlpha, drawflag, fadelerp);
}
// this draws the triangles of a model DIRECTLY. Don't expect high performance, really...