]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: misc cosmetic code changes
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 12 Jan 2025 14:49:05 +0000 (15:49 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 12 Jan 2025 14:49:05 +0000 (15:49 +0100)
qcsrc/client/hud/panel/strafehud/draw.qc
qcsrc/client/hud/panel/strafehud/extra.qc
qcsrc/client/hud/panel/strafehud/util.qc

index 9218b11676a8dbd72535b5f6a45c63fae691c4a3..51f92f8c9658f26d9a7ac289eefdb8e9e8bf4f57 100644 (file)
@@ -244,7 +244,7 @@ void StrafeHUD_DrawSoftGradient(
 {
        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;
@@ -329,6 +329,7 @@ void StrafeHUD_DrawTextIndicator(
        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;
index 0d12a035f6f327051be34dc8130944ecc1d89ed0..e5803955428eadb501666b6e251a4a7f11ccdf2f 100644 (file)
@@ -14,7 +14,7 @@
 
 // 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
index 7c18c0182870b2b23131879c89ed4a956f2f82c3..c3786e1a59397e3b91d6f8416b6c8e126f2ec8d1 100644 (file)
@@ -318,6 +318,7 @@ bool StrafeHUD_DetermineJumpHeld(entity e, int keys, bool is_local)
 }
 
 // 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;