]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: rename some stuff
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 2 Sep 2024 18:04:53 +0000 (20:04 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 2 Sep 2024 20:36:42 +0000 (22:36 +0200)
qcsrc/client/hud/panel/strafehud/core.qc
qcsrc/client/hud/panel/strafehud/draw.qc
qcsrc/client/hud/panel/strafehud/draw.qh
qcsrc/client/hud/panel/strafehud/util.qc
qcsrc/client/hud/panel/strafehud/util.qh

index a5ea087a3092409d1f19bdd4d633904c785e104e..954ca668d6a9b5638f040f2d3ffbe11369b8bcd8 100644 (file)
@@ -53,9 +53,9 @@ void StrafeHUD_DrawStrafeMeter(
 
                accelzone_offsetangle = 90 - absolute_bestangle;
 
-               float neutral_startangle;
                float overturn_offsetangle = 180;
-               float neutral_endangle = 360 - accelzone_offsetangle * 2 - preaccelzone_offsetangle * 2 - overturn_offsetangle;
+               float neutral_offsetangle = 360 - accelzone_offsetangle * 2 - preaccelzone_offsetangle * 2 - overturn_offsetangle;
+               float neutral_startangle;
 
                {
                        float current_offsetangle = 0;
@@ -78,7 +78,7 @@ void StrafeHUD_DrawStrafeMeter(
                }
 
                // calculate how far off-center the strafe zones currently are
-               shift_angle += neutral_endangle / 2 - wishangle;
+               shift_angle += neutral_offsetangle / 2 - wishangle;
 
                // shift strafe zones into correct place
                neutral_startangle += shift_angle;
@@ -89,7 +89,7 @@ void StrafeHUD_DrawStrafeMeter(
                overturn_startangle += shift_angle;
 
                // draw left acceleration zone
-               HUD_Panel_drawStrafeHUD(
+               StrafeHUD_drawStrafeHUD(
                        accelzone_left_startangle, accelzone_offsetangle,
                        autocvar_hud_panel_strafehud_bar_accel_color,
                        autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha,
@@ -97,7 +97,7 @@ void StrafeHUD_DrawStrafeMeter(
                        true, hudangle);
 
                if(autocvar_hud_panel_strafehud_bar_preaccel)
-                       HUD_Panel_drawStrafeHUD(
+                       StrafeHUD_drawStrafeHUD(
                                preaccelzone_left_startangle, preaccelzone_offsetangle,
                                autocvar_hud_panel_strafehud_bar_accel_color,
                                autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha,
@@ -105,7 +105,7 @@ void StrafeHUD_DrawStrafeMeter(
                                true, hudangle);
 
                // draw right acceleration zone
-               HUD_Panel_drawStrafeHUD(
+               StrafeHUD_drawStrafeHUD(
                        accelzone_right_startangle, accelzone_offsetangle,
                        autocvar_hud_panel_strafehud_bar_accel_color,
                        autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha,
@@ -113,7 +113,7 @@ void StrafeHUD_DrawStrafeMeter(
                        true, hudangle);
 
                if(autocvar_hud_panel_strafehud_bar_preaccel)
-                       HUD_Panel_drawStrafeHUD(
+                       StrafeHUD_drawStrafeHUD(
                                preaccelzone_right_startangle, preaccelzone_offsetangle,
                                autocvar_hud_panel_strafehud_bar_accel_color,
                                autocvar_hud_panel_strafehud_bar_accel_alpha * panel_fg_alpha,
@@ -124,7 +124,7 @@ void StrafeHUD_DrawStrafeMeter(
                //   this is technically incorrect
                //   acceleration decreases at 90 degrees but speed loss happens a little bit after 90 degrees,
                //   however due to sv_airstopaccelerate that's hard to calculate
-               HUD_Panel_drawStrafeHUD(
+               StrafeHUD_drawStrafeHUD(
                        overturn_startangle, overturn_offsetangle,
                        autocvar_hud_panel_strafehud_bar_overturn_color,
                        autocvar_hud_panel_strafehud_bar_overturn_alpha * panel_fg_alpha,
@@ -132,8 +132,8 @@ void StrafeHUD_DrawStrafeMeter(
                        true, hudangle);
 
                // draw neutral zone
-               HUD_Panel_drawStrafeHUD(
-                       neutral_startangle, neutral_endangle,
+               StrafeHUD_drawStrafeHUD(
+                       neutral_startangle, neutral_offsetangle,
                        autocvar_hud_panel_strafehud_bar_neutral_color,
                        autocvar_hud_panel_strafehud_bar_neutral_alpha * panel_fg_alpha,
                        autocvar_hud_panel_strafehud_style, STRAFEHUD_GRADIENT_NONE,
@@ -153,28 +153,28 @@ void StrafeHUD_DrawStrafeMeter(
                        if(direction == STRAFEHUD_DIRECTION_LEFT)
                        {
                                if(!opposite_direction)
-                                       opposite_offsetangle -= StrafeHUD_offsetToAngle(bestangle_width, hudangle);
+                                       opposite_offsetangle -= StrafeHUD_widthToAngle(bestangle_width, hudangle);
                                else
-                                       offsetangle -= StrafeHUD_offsetToAngle(bestangle_width, hudangle);
+                                       offsetangle -= StrafeHUD_widthToAngle(bestangle_width, hudangle);
                        }
                        else
                        {
                                if(!opposite_direction)
-                                       offsetangle -= StrafeHUD_offsetToAngle(bestangle_width, hudangle);
+                                       offsetangle -= StrafeHUD_widthToAngle(bestangle_width, hudangle);
                                else
-                                       opposite_offsetangle -= StrafeHUD_offsetToAngle(bestangle_width, hudangle);
+                                       opposite_offsetangle -= StrafeHUD_widthToAngle(bestangle_width, hudangle);
                        }
 
-                       HUD_Panel_drawStrafeHUD(
-                               offsetangle, StrafeHUD_offsetToAngle(bestangle_width, hudangle),
+                       StrafeHUD_drawStrafeHUD(
+                               offsetangle, StrafeHUD_widthToAngle(bestangle_width, hudangle),
                                autocvar_hud_panel_strafehud_switch_color,
                                autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha,
                                STRAFEHUD_STYLE_DRAWFILL, STRAFEHUD_GRADIENT_NONE,
                                false, hudangle);
 
                        if(direction == STRAFEHUD_DIRECTION_NONE)
-                               HUD_Panel_drawStrafeHUD(
-                                       opposite_offsetangle, StrafeHUD_offsetToAngle(bestangle_width, hudangle),
+                               StrafeHUD_drawStrafeHUD(
+                                       opposite_offsetangle, StrafeHUD_widthToAngle(bestangle_width, hudangle),
                                        autocvar_hud_panel_strafehud_switch_color,
                                        autocvar_hud_panel_strafehud_switch_alpha * panel_fg_alpha,
                                        STRAFEHUD_STYLE_DRAWFILL, STRAFEHUD_GRADIENT_NONE,
index 91bd964d31972fd40c4cdd5cc3b953f4712d25f4..41c548c53a09d0847d3d77437a77114e1eb72653 100644 (file)
@@ -3,7 +3,7 @@
 #include <client/draw.qh>
 
 // functions to make hud elements align perfectly in the hud area
-void HUD_Panel_drawStrafeHUD(float startangle, float offsetangle, vector color, float alpha, int type, int gradientType, bool doProject, float range)
+void StrafeHUD_drawStrafeHUD(float startangle, float offsetangle, vector color, float alpha, int type, int gradientType, bool doProject, float range)
 {
        float offset = StrafeHUD_angleToOffset(startangle % 360, range);
        float width = StrafeHUD_angleToWidth(offsetangle, range);
index 898df4b9016c003d4660afb3593df9c6b6ab84b8..f369adcc2d3e0d7bfd76362bda3ec5b02c36082b 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 #include "../strafehud.qh"
 
-void HUD_Panel_drawStrafeHUD(float, float, vector, float, int, int, bool, float);
+void StrafeHUD_drawStrafeHUD(float, float, vector, float, int, int, bool, float);
 void StrafeHUD_drawGradient(vector, vector, vector, float, float, float, float, float, int, bool, float);
 void StrafeHUD_drawStrafeArrow(vector, float, vector, float, bool, float);
 bool StrafeHUD_drawTextIndicator(string, float, vector, float, float, float, int);
index 1d712892c5298934fdac57403a19388078e9d9cc..feaff4f1c872772220edb68b9663c52e3e587549 100644 (file)
@@ -14,7 +14,7 @@ float StrafeHUD_angleToOffset(float angle, float range)
        return StrafeHUD_angleToWidth(angle, range) + panel_size.x / 2;
 }
 
-float StrafeHUD_offsetToAngle(float offset, float range)
+float StrafeHUD_widthToAngle(float offset, float range)
 {
        return offset / panel_size.x * range;
 }
index 3fab9a04eb0b064fbb544c099ab72b013b4f4ecd..9053ff61045ed0431192b8cdd36de23484d9aa30 100644 (file)
@@ -9,7 +9,7 @@ float StrafeHUD_projectOffset(float, float, bool);
 float StrafeHUD_projectWidth(float, float, float);
 float StrafeHUD_angleToWidth(float, float);
 float StrafeHUD_angleToOffset(float, float);
-float StrafeHUD_offsetToAngle(float, float);
+float StrafeHUD_widthToAngle(float, float);
 float DetectWaterLevel(entity);
 float DetectFrameTime();
 float DetectWishAngle(vector, int, bool);