{
float alpha1 = bound(0, alpha, 1);
float alpha2 = bound(0, autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha, 1);
- if((alpha1 + alpha2) == 0) return;
+ if(alpha1 + alpha2 == 0) return;
float color_ratio = alpha1 / (alpha1 + alpha2);
vector segment_size = size;
drawstring_aspect(panel_pos + pos, text, size, color, alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
+// checks whether the current style is a gradient style
bool StrafeHUD_IsGradient(int style)
{
return style == STRAFEHUD_STYLE_GRADIENT || style == STRAFEHUD_STYLE_SOFT_GRADIENT;
// epsilon value for the slick detector steps to avoid
// an infinite loop due to floating point rounding errors
-// (works with current limits as long as uncapped mode is not used)
+// (works with current limits)
#define SLICKDETECT_STEPS_EPSILON 0.00001
// slick detector
}
// mix two colors based on a ratio
+// TODO: move mixing colors out of the HUD, this could be useful for other code
vector StrafeHUD_MixColors(vector color1, vector color2, float ratio)
{
if(ratio <= 0) return color1;