From 0f3892680a01d9a7e0170582744f652322c06c62 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 2 Sep 2024 20:04:53 +0200 Subject: [PATCH] strafehud: rename some stuff --- qcsrc/client/hud/panel/strafehud/core.qc | 36 ++++++++++++------------ qcsrc/client/hud/panel/strafehud/draw.qc | 2 +- qcsrc/client/hud/panel/strafehud/draw.qh | 2 +- qcsrc/client/hud/panel/strafehud/util.qc | 2 +- qcsrc/client/hud/panel/strafehud/util.qh | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/qcsrc/client/hud/panel/strafehud/core.qc b/qcsrc/client/hud/panel/strafehud/core.qc index a5ea087a3..954ca668d 100644 --- a/qcsrc/client/hud/panel/strafehud/core.qc +++ b/qcsrc/client/hud/panel/strafehud/core.qc @@ -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, diff --git a/qcsrc/client/hud/panel/strafehud/draw.qc b/qcsrc/client/hud/panel/strafehud/draw.qc index 91bd964d3..41c548c53 100644 --- a/qcsrc/client/hud/panel/strafehud/draw.qc +++ b/qcsrc/client/hud/panel/strafehud/draw.qc @@ -3,7 +3,7 @@ #include // 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); diff --git a/qcsrc/client/hud/panel/strafehud/draw.qh b/qcsrc/client/hud/panel/strafehud/draw.qh index 898df4b90..f369adcc2 100644 --- a/qcsrc/client/hud/panel/strafehud/draw.qh +++ b/qcsrc/client/hud/panel/strafehud/draw.qh @@ -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); diff --git a/qcsrc/client/hud/panel/strafehud/util.qc b/qcsrc/client/hud/panel/strafehud/util.qc index 1d712892c..feaff4f1c 100644 --- a/qcsrc/client/hud/panel/strafehud/util.qc +++ b/qcsrc/client/hud/panel/strafehud/util.qc @@ -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; } diff --git a/qcsrc/client/hud/panel/strafehud/util.qh b/qcsrc/client/hud/panel/strafehud/util.qh index 3fab9a04e..9053ff610 100644 --- a/qcsrc/client/hud/panel/strafehud/util.qh +++ b/qcsrc/client/hud/panel/strafehud/util.qh @@ -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); -- 2.39.2