]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small optimization to the crosshair code
authorterencehill <piuntn@gmail.com>
Tue, 24 Mar 2020 14:42:07 +0000 (15:42 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 24 Mar 2020 14:42:07 +0000 (15:42 +0100)
qcsrc/client/view.qc

index 57cd15a78bd7fd68cac6454b13232d56a4b1d1c4..1b448b8ebb5ba2b00975bc47691a5c599a42d28d 100644 (file)
@@ -1450,8 +1450,10 @@ void HUD_Crosshair(entity this)
                        if(time < wcross_name_changedonetime && wcross_name != wcross_name_goal_prev_prev && wcross_name_goal_prev_prev)
                        {
                                f = (wcross_name_changedonetime - time) / (wcross_name_changedonetime - wcross_name_changestarttime);
+                               vector wcross_size_save = wcross_size;
                                wcross_size = draw_getimagesize(wcross_name_goal_prev_prev) * wcross_scale;
                                CROSSHAIR_DRAW(wcross_resolution_goal_prev_prev, wcross_name_goal_prev_prev, wcross_alpha * f * wcross_name_alpha_goal_prev_prev);
+                               wcross_size = wcross_size_save;
                                f = 1 - f;
                        }
                        else
@@ -1460,7 +1462,6 @@ void HUD_Crosshair(entity this)
                        }
                        wcross_name_alpha_goal_prev = f;
 
-                       wcross_size = draw_getimagesize(wcross_name) * wcross_scale;
                        CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
 
                        if(autocvar_crosshair_dot)