From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Thu, 19 Sep 2024 18:10:06 +0000 (+0200) Subject: strafehud: simplify color mixing function X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9863967fdc2298b1cdb7676064b7b1f1ae8bbd2d;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: simplify color mixing function --- diff --git a/qcsrc/client/hud/panel/strafehud/util.qc b/qcsrc/client/hud/panel/strafehud/util.qc index 189621c40..c15c99b19 100644 --- a/qcsrc/client/hud/panel/strafehud/util.qc +++ b/qcsrc/client/hud/panel/strafehud/util.qc @@ -298,11 +298,7 @@ bool StrafeHUD_DetermineJumpHeld(entity e, int keys, bool islocal) vector StrafeHUD_MixColors(vector color1, vector color2, float ratio) { - vector mixedColor; if(ratio <= 0) return color1; if(ratio >= 1) return color2; - mixedColor.x = color1.x + (color2.x - color1.x) * ratio; - mixedColor.y = color1.y + (color2.y - color1.y) * ratio; - mixedColor.z = color1.z + (color2.z - color1.z) * ratio; - return mixedColor; + return color1 + (color2 - color1) * ratio; }